20254 Reputation

15 years, 338 days

Both solutions are correct, as confirmed...

Both solutions are correct, as confirmed by the  odetest  command. One solution is obtained from another simply by replacing arbitrary constants:

 (1)
 > interface(version);
 (2)
 > Physics:-Version();
 (3)
 > restart;
 > ode :=[diff(x(t), t) = (3*x(t))/2 + 2*y(t), diff(y(t), t) = x(t)/2 + y(t)]; Sol:=dsolve(ode); odetest(Sol, ode);
 (4)
 > Sol1:=simplify(dsolve(ode,[x(t),y(t)]));
 (5)
 > odetest(Sol1, ode);
 (6)
 > Sol2:=simplify(eval(Sol,[_C1=_C1*(sqrt(17)+1)/2, _C2=-_C2*(sqrt(17)-1)/2]));
 (7)
 > is(Sol2=Sol1);
 (8)
 >

select...

```Expr:=3/16-3/16*m2^2-m2/4*tanh(2*k-2*c)+m2/16*tanh(4*k+2*c)-m2/4*tanh(2*k+2*c)+3*m2/8*tanh(2*c);
select(t->has(t,tanh), Expr);```

Names and objects...

You use the same name to create different objects: a point in 3d and a procedure. Use a different name, for example:

 > restart; with(geom3d): Point:=(a,b,c)->point(P, a,b,c); detail(Point(1,2,3));
 (1)
 >

Ways...

 > restart;
 > eqs := [u     + v     + w     = 1,         u*x   + v*y   + w*z   = 1/2,         u*x^2 + v*y^2 + w*z^2 = 1/3,         u*x^3 + v*y^3 + w*z^3 = 1/4,         u*x^4 + v*y^4 + w*z^4 = 1/5,         u*x^5 + v*y^5 + w*z^5 = 1/6]:
 (1)
 > soln := [solve(eqs, explicit)];
 (2)
 > # Show that each member of soln is a solution of eqs
 > andmap(t->is(`and`(seq(eval(eq,t),eq=eqs))), soln);
 (3)
 > # Show that the solutions are unique
 > is(nops(soln)=nops(convert(soln,set)));
 (4)
 >

LinearAlgebra:-LeastSquares...

To solve such systems, which are usually inconsistent, the least squares method is used. See help on the LinearAlgebra:-LeastSquares  command.

Justified solution of the problem by bru...

The  DirectSearch  package often solves problems of discrete optimization incorrectly. For this, see the discussion in the post  https://www.mapleprimes.com/posts/201020-About-DirectSearch
Therefore, the result obtained above, although true, cannot be considered justified. An justified solution can be easily obtained by brute-force method, if you notice that no variable  x1 ... x9 can be greater than 10, since 8*(-5)^3+11^3>0

```restart;
R:=[0,[0\$9]]:
for x1 from -5 to 10 do
for x2 from x1 to 10 do
for x3 from x2 to 10 do
for x4 from x3 to 10 do
for x5 from x4 to 10 do
for x6 from x5 to 10 do
for x7 from x6 to 10 do
for x8 from x7 to 10 do
for x9 from x8 to 10 do
if d>R[1] then R:=[d, [seq(x||i, i=1..9)]] fi; fi;
od: od: od: od: od: od: od: od: od:
R;
```

[12, [-5, -4, 3, 3, 3, 3, 3, 3, 3]]

A way...

```restart;
diffr1:=x^2+y^2-1:
diffr2:=(x-2)^2+y^2-(3/2)^2:
with(plots):
P1:=implicitplot(diffr1, x=-1..1, y=-1..1, color=black, thickness=2):
P2:=implicitplot(diffr2, x=0..4, y=-2..2, color=black, thickness=2):
P3:=inequal({diffr1<0,diffr2<0}, x=-2..4, y=-2..2, color=red):
P4:=inequal({diffr1<0,diffr2>0}, x=-2..4, y=-2..2, color=yellow):
P5:=inequal({diffr1>0,diffr2<0}, x=-2..4, y=-2..2, color=green):
P6:=inequal({diffr1>0,diffr2>0}, x=-2..4, y=-2..2, color="LightBlue"):
display(P1,P2,P3,P4,P5,P6, scaling=constrained);
```

```restart;
NM1 := proc(f, xold)
local x1, x0, precision;
x0 := xold;
x1 := evalf(x0 - f(x0)/D(f)(x0));
precision := 10^(-3);
if limit(f(x),x=x0) = 0 then
error("Newton's Method cannot do the calculation");
end if;
if D(f)(x0) = 0 then
error("Newton's Method cannot do the calculation");
else
while abs(x1-x0) > precision do
x0 := x1;
print(x0);
x1 := evalf(x0 - f(x0)/D(f)(x0));
end do;
end if;

return x1;
end proc:

# Examples
NM1(x->1-x-sin(x), 0);
fsolve(1-x-sin(x)); # Check
NM1(x->1-x-sin(x), %); # Check
```

The programm...

See the programm in the post  https://www.mapleprimes.com/posts/200677-Partition-Of-An-Integer-With-Restrictions

Examples of use:

```Partition(8, 2..8, {2,3,6,9});
Partition(9, 1..9, {2,3,6,9});
Partition(9, 3, {2,3,6,9});
```

argument...

You are wrong in assuming that  Phi = -b . Maple returns the principal value of the argument and simplification can only be obtained by using assumptions on the parameters  a  and , for example

 > restart; z:=-a*exp(-I*b): simplify(evalc(argument(z))) ; simplify(argument(z)) assuming a>0, b0;
 (1)
 >

geometry:-ellipse...

```restart;
with(geometry):
point(F1,[5,0]): point(F2,[0,-5]):
ellipse(p, ['foci'=[F1,F2], 'distance'=12], [x,y]);
Eq:=Equation(p);
d:=igcd(coeffs(lhs(Eq)));
Eq1:=Eq/d; # Simplified ellipse equation
plots:-implicitplot(Eq1, x=-12..12, y=-12..12, color=red, thickness=2);
```

Solution...

Consider 2 points   A(0,0)  and  B(1,0) . The line  BC  has the equation  y=tan(100*Pi/180)*(x-1) . We assume that the points  С  and  D   lie above the axis  Ox , and the length of the  BC  is equal to 1. Then we get  C(1+cos(100*Pi/180), sin(100*Pi/180)) . The slope of the straight line  CD  will be equal to  tan(100*Pi/180+70*Pi/180) .

 > restart; local D: A:=[0,0]: B:=[1,0]: C:=[1+cos(100*Pi/180),sin(100*Pi/180)]: D:=eval([x,y],solve({y=tan(120*Pi/180)*x, y=C[2]+tan(100*Pi/180+70*Pi/180)*(x-C[1])})); P:=plottools:-curve([A,B,C,D,A], color=red, thickness=2): T:=plots:-textplot([[A[],"A"],[B[],"B"],[C[],"C"],[D[],"D"]], font=[times,20], align=[left,below]): plots:-display(P,T, scaling=constrained, axes=none);
 >

 >
 >
 >
 (1)
 >
 (2)
 >
 (3)
 >

More...

There are other ways to solve the problem. For example, you can use the  seq  command, or just loop through the set  , applying the appropriate condition:

```restart;
A := {3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101};

{seq(`if`(modp(a,3)=1,a,NULL), a=A)}; # The second way

k:=1:  # The third way
for a in A do
if modp(a,3)=1 then k:=k+1; B[k]:=a fi;
od:
convert(B, set);
```

 3 4 5 6 7 8 9 Last Page 5 of 281
﻿