13999 Reputation

11 years, 189 days

Solution...

 > restart; with(geom3d): with(plots): cA:=[1,2,3]: point(A,cA): v:=[1,2,2]: cC:=[10,11,12]: point(C,cC): point(E,v+cA): line(AB,[A,E]): projection(B,C,AB): cB:=coordinates(B); # Coordinates of B. The angle ABC=90 degrees Curve:=plottools:-curve([cA,cB,cC], color=red,thickness=3): T:=textplot3d([[cA[],"A"],[cB[],"B"],[cC[],"C"]], font=[times,18], align=right): display(Curve,T, axes=normal, labels=[x,y,z], view=[0..14,0..14,0..15], orientation=[-45,75]);
 >

Addition. Below I made an animation of this travel (continuation of the above code). The first frame shows the initially given points  A  and  C  and a green vector that determines the direction of movement:

```Back:=display(textplot3d([cA[],"A"], font=[times,18], align=right),textplot3d([cC[],"C"], font=[times,18], align=right),arrow([1,2,4],v,color=green),pointplot3d([cA,cC],symbol=solidsphere,color=red,symbolsize=17)):
Anim1:=animate((display@plottools:-line),[cA,cA+~t*~(cB-cA), color=red,thickness=3],t=0..1,background=Back,paraminfo=false):
Anim2:=animate(display,[textplot3d([cB[],"B"], font=[times,18], align=right)],a=0..1,frames=5,background=display(Back,pointplot3d(cB,symbol=solidsphere,color=red,symbolsize=17)),paraminfo=false):
Anim3:=animate((display@plottools:-line),[cB,cB+~t*~(cC-cB), color=red,thickness=3],t=0..1,background=display(Back,pointplot3d(cB,symbol=solidsphere,color=red,symbolsize=17)),paraminfo=false):
display([Anim1, display(op([1,-1,1],Anim1),Anim2), display(op([1,-1,1],Anim1),op([1,-1,1],Anim2),Anim3)], insequence, axes=normal, labels=[x,y,z], view=[0..14,0..14,0..15], orientation=[-45,75]);
```

Edit.

Example...

Below is an example of solving your problem for a set of 10 random vectors:

 > restart; with(LinearAlgebra): n := 10: v:={seq(RandomVector(n),k=1..n)}; for i to n do for j to n do r[i,j] := DotProduct(v[i], v[j]); end do: end do: A:=Matrix(n, (i,j)->r[i,j]); b:={seq(,j=1..n)}; for k from 1 to n do LinearSolve(A,b[k]); od;
 (1)
 >

Normally ...

by the series command.

Example:

```N:=10:
series(cos(x)^n, x=0, N);```

1-(1/2)*n*x^2+(-(1/12)*n+(1/8)*n^2)*x^4+(-(1/45)*n+(1/24)*n^2-  (1/48)*n^3)*x^6+(-17/2520*n+7/480*(n^2)-(1/96)*n^3+(1/384)*n^4)*x^8+O(x^10)

Solution...

on a simple example from a help:

```restart;
with(plots):
A := Matrix([[2, 1, 0, 0, 3], [0, 2, 1, 0, 0], [0, 0, 2, 1, 0], [0, 0, 0, 2, 1], [0, 0, 0, 0, 2]]);
S := [([1, 2, 3, 4, 5]=~StringTools:-Char~(96+~[\$1..5]))[]];
sparsematrixplot(A, matrixview, tickmarks = [S, map(t->-lhs(t) = rhs(t) , S)]);```

Not implemented...

As far as I know, Maple does not implement a step-by-step solution of differential equations. However, you can find out the type of your equation, for example:

`DEtools:-odeadvisor(diff(y(x),x)=(x^2+1)*sin(y(x)), y(x));`

Output:                          [_separable]

For details see help on  ?dsolve,details

map...

Try the following, where  Expr  is your expression to be simplified. If this does not help, then upload your worksheet here.

map(simplify, Expr);

The  map  command forces the application of the  simplify  command separately to each operand of the expression.

Edit.

F2=infinity...

We see that the sequence  f1(k)  is the sequence of even numbers, starting with 2. Therefore, the sum of the corresponding series is equal to infinity:

```H := r->piecewise(r < 1, 1, 0);
f1 := k-> sum(2*(1-H(j)), j = 0 .. k);
seq(f1(k), k=1..10);
expand(sum(2*k, k=1..n));
sum(2*k, k=1..infinity);
```

plots:-implicitplot...

If you need to plot a graph of the dependence of the real roots of the equation on a parameter, then it is not necessary to solve this equation first (this is not always possible explicitly). The easiest way to use the  plots:-implicitplot  command for this.
Below your example is solved in two versions: first in the range a in  0 .. 1 , and then in a wider range  a in  -0.5 .. 2.5. For the range  0 .. 1, we see that there are 2 roots close to 0 and one positive root, significantly superior to the first two:

```restart;

A:=plots:-implicitplot(x^3+(a-3)^3*x^2-x*a^2+a^3 = 0, a=0..1, x=-1..30, color=red, grid=[100,20000], axes=box):
B:=plots:-implicitplot(x^3+(a-3)^3*x^2-x*a^2+a^3 = 0, a=0..1, x=-1..1, color=red, thickness=2, gridrefine=4):
plots:-display(< A | B >);

C:=plots:-implicitplot(x^3+(a-3)^3*x^2-x*a^2+a^3 = 0, a=-0.5..2.5, x=-100..100, color=red, thickness=2, gridrefine=3, axes=box):

plots:-display(C, B, size=[800,400]);
```

Addition. In your problem it is interesting to find values of the parameter a , at which the number of real roots changes. Visually, these are 0 and 1.8 (approximately). Next, we find the exact values using the discriminant:

```d:=discrim(x^3+(a-3)^3*x^2-x*a^2+a^3, x);
solve(d);
select(type, {%}, realcons);
evalf(%);
```

The final results:
{0, -(1/6)*(324+12*sqrt(741))^(1/3)+2/(324+12*sqrt(741))^(1/3)+3}
{0., 1.786588337}

In Maple 32 bit only...

Classic worksheet exists only in 32 bit Maple version.

Another 2 ways...

If a polynomial has degree greater than 4, then its roots in the general case are not expressed in radicals. In this case, you can use the  solve  command with subsequent selection of the roots (by select command) or the  Student:-Calculus1:-Roots  command, which immediately returns the real roots:

 > restart;
 > solve(x^6-3*x-5); evalf([%]); select(r->Im(r)=0, %); # Or Student:-Calculus1:-Roots(x^6-3*x-5, numeric);
 (1)
 >

Another way...

Since your equation allows a symbolic (analytical) solution, we first obtain this solution, and then look for a maximum at a suitable interval. I think that with the same Digits, this approach gives a more accurate result:

```restart;
Eq := {diff(y(t), t, t) + 2*diff(y(t), t) + 4*y(t) = 0.9*sin(9*t), y(0) = 0, D(y)(0) = 0}:
Sol:=dsolve(Eq);
plot(eval(y(t),Sol), t=0..10);
Optimization:-Maximize(eval(y(t),Sol), t=0..1);
Digits:=25:
Optimization:-Maximize(eval(y(t),Sol), t=0..1);
```

Should be...

```value(Diff(x,x));

sum(diff(x^k,x)/k! , k=1..infinity);```

diff( m(x+ diff(...) ...) / diff ?  Write the full code for this!

pdsolve...

I do not  know  Adomian decomposition method. You can just use the  pdsolve  command for this:

pdsolve(diff(U(x,t), x, t) = U(x,t));

Or...

indets(P, function(identical(t)));

The solution in my interpretation...

I understood the problem as follows. There are 10 questions and for each question a student can get a certain number of points from the set  {a, b, c, d} , where a, b, c, d  are integers in ascending order (the number  a  may be negative). Therefore, his final grade is determined by a list  [x1, x2, x3, x4]  in which x1 is the number of answers, in each of which he earned  points, x2  - b points  and so on. Should be  0<=xi<=10  and  x1+x2+x3+x4=10 .  Using the command for the number of compositions, we obtain an upper bound for the maximum number of distinct grades in the general case (the total 286) and for specific numbers  a, b, с, d . This method can be easily generalized to any number of questions and any set of possible points for 1 answer.

 > restart; combinat:-composition(14,4): S:=map(t->t-~1,%); # The set of all the conpositions of the number 10 nops(S); ``; N:=map(p->p[1]*a+p[2]*b+p[3]*c+p[4]*d, S): # The set of grades # Examples of use eval(N,[a=0,b=1,c=2,d=3]); nops(%); ``; eval(N,[a=-1,b=1,c=2,d=3]); nops(%); ``; eval(N,[a=0,b=3,c=4,d=5]); nops(%);
 (1)

We see that in the second example the correct answer is 40 and not 41 (as in Carl's answer). The grade  -9  is not possible.