Maple 2023 Questions and Posts

These are Posts and Questions associated with the product, Maple 2023

In the system below, I need to solve the solution algebraically (it is known in advance that from "V3" that a0=1,just open the V3 command).

V := exp(lambda*S) = S^4*a4 + S^3*a3 + S^2*a2 + S*a1 + a0;
V1 := subs(S = 2, V);
V2 := subs(S = 1, V);
V3 := subs(S = 0, V);
V4 := subs(S = -1, V);
V5 := subs(S = -2, V);
fsolve(subs(a0 = 1, {V1, V2, V4, V5}), {a1, a2, a3, a4});

I already know the answers, but I need maple to provide me with the command in the form

a1:=(1/6)*[8*sinh(lambda)-sinh(2*lambda)] and

a2:=(1/12)*[16*cosh(lambda)-cosh(2*lambda)-15],

a3:= ... etc.

What is the best way to do this?

I have this equation:

and I need to do some manipulation to obtain this:

I manage to get it but my manipulation is too long for my liking. Can someone show me a shorter version. I have linked the Maple document.

Manipulating_polynomial.mw

Thank you in advance for your help.

Mario

Why does _EnvLinalg95 only affect  (and ) and not and ? 
 

restart;

m := <3 , 4 | 4 , 3>;

m := Matrix(2, 2, {(1, 1) = 3, (1, 2) = 4, (2, 1) = 4, (2, 2) = 3})

(1)

LinearAlgebra:-Eigenvalues(m);

Vector(2, {(1) = 7, (2) = -1})

(2)

LinearAlgebra:-Eigenvectors(m);

Vector(2, {(1) = -1, (2) = 7}), Matrix(2, 2, {(1, 1) = -1, (1, 2) = 1, (2, 1) = 1, (2, 2) = 1})

(3)

LinearAlgebra:-EigenConditionNumbers(m);

Vector(2, {(1) = 1.00000000000000, (2) = 1.00000000000000}), Vector(2, {(1) = 8., (2) = 8.})

(4)

_EnvLinalg95 := true:

whattype(m);

Matrix

(5)

LinearAlgebra:-Eigenvalues(m);

Vector(2, {(1) = 7, (2) = -1})

(6)

LinearAlgebra:-Eigenvectors(m):

Error, (in Matrix) invalid input: `Matrix/MakeInit` expects its 1st argument, initializer, to be of type list(list), but received [proc (i, j) options operator, arrow; `if`(j = 1 and i <= 2, (Vector(2, {(1) = 1, (2) = 1}))[i], rhs(fill_opt)) end proc]

 

LinearAlgebra:-EigenConditionNumbers(m);

Vector(2, {(1) = 1.00000000000000, (2) = 1.00000000000000}), Vector(2, {(1) = 8., (2) = 8.})

(7)

_EnvLinalg95 := false:

LinearAlgebra:-Eigenvectors(m);

Vector(2, {(1) = -1, (2) = 7}), Matrix(2, 2, {(1, 1) = -1, (1, 2) = 1, (2, 1) = 1, (2, 2) = 1})

(8)


 

Download _EnvLinalg95.mw

I have read the help page of Eigenvectors but couldn't find anything related.

This looks like a bug I have not seen before. Any one seen this before?

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

Can others reproduce it? I am using Maple 2023.2 on windows 10

btw, I found that by doing int(evala(integrand),t) instead of int(integrand,t) then the error goes away but not all the time. Below are two examples. The first where evala() fixes it, but the second it does not fix it. 

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1585 and is the same as the version installed in this computer, created 2023, October 29, 6:31 hours Pacific Time.`

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

restart;

15332

integrand:=-(((sqrt(3)*sqrt(27983)*I + 276)*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) + 15*I*sqrt(3)*sqrt(27983) + (25*(-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))/2 + 2265)*(-150 + (-150 + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))*sqrt(3)*I - (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) + 24*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3))*(150 + (-150 + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))*sqrt(3)*I + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) - 24*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3))*((sqrt(3)*sqrt(27983)*I + 276)*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) - 15*I*sqrt(3)*sqrt(27983) - 2265)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))*(-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3)*((-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) + 12*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) + 150)*sin(t)*cos(t))/(10101630528*(sqrt(3)*sqrt(27983)*I - 99)^2*(sqrt(3)*sqrt(27983)*I + 27983/33)*exp(t)) - ((-594 + 6*I*sqrt(83949))^(2/3) + 12*(-594 + 6*I*sqrt(83949))^(1/3) + 150)*(2*I*sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3) + 30*I*sqrt(83949) + 25*(-594 + 6*I*sqrt(83949))^(2/3) + 552*(-594 + 6*I*sqrt(83949))^(1/3) + 4530)*(-594 + 6*I*sqrt(83949))^(1/3)*(sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3)*I - 15*I*sqrt(83949) + 276*(-594 + 6*I*sqrt(83949))^(1/3) - 2265)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))*(8*cos(t)^2/exp(t) - 4/exp(t))/(5196312*(sqrt(83949)*I + 27983/33)*(sqrt(83949)*I - 99)) + ((-594 + 6*I*sqrt(83949))^(2/3) + 12*(-594 + 6*I*sqrt(83949))^(1/3) + 150)*(2*I*sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3) + 30*I*sqrt(83949) + 25*(-594 + 6*I*sqrt(83949))^(2/3) + 552*(-594 + 6*I*sqrt(83949))^(1/3) + 4530)*(-150 + (-594 + 6*I*sqrt(83949))^(2/3))*(-594 + 6*I*sqrt(83949))^(2/3)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))/(1154736*(sqrt(83949)*I + 27983/33)*(sqrt(83949)*I - 99)*exp(t)):

int(integrand,t)

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

 

Download handler_trig_exp_only_nov_18_2023.mw

But the trick of using evala() to avoid this error does not always work. Here is an example below. So need to find another workaround for this.

restart;

18704

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

integrand2:=1/40406522112*I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*exp(t*(5/3*3^(1/2)*2^(1/2)
*sin(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)-5*cos(1/3*arctan(1/99*83949^(1/2))+1/
6*Pi)*2^(1/2)-1))*(150+I*(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)+(-\
594+6*I*3^(1/2)*27983^(1/2))^(2/3)-24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3))*(
2265+(276+I*(27983^(1/2)+92)*3^(1/2)-27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2)
)^(1/3)+5*I*(-151+3*27983^(1/2))*3^(1/2)+15*27983^(1/2))*(2265-25*(-594+6*I*3^(
1/2)*27983^(1/2))^(2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+
6*I*3^(1/2)*27983^(1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*(
(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)+12*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+
150)*3^(1/2)*(-150+I*(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)-(-594+
6*I*3^(1/2)*27983^(1/2))^(2/3)+24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3))/(I*3^(1
/2)*27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)^2/exp(t)*sin(t)*cos(t)-1/
20785248*I*(I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*3^(1/2)+(-594+6*I*3^(1/2)*
27983^(1/2))^(2/3)-150*I*3^(1/2)-24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+150)*
exp(5/3*3^(1/2)*sin(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)*t-5*cos(1/3*
arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)*t-t)*(2265-25*(-594+6*I*3^(1/2)*27983^
(1/2))^(2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+6*I*3^(1/2)
*27983^(1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*(2265+(276+I
*(27983^(1/2)+92)*3^(1/2)-27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+5*I
*(-151+3*27983^(1/2))*3^(1/2)+15*27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2))^(1
/3)*3^(1/2)/(I*3^(1/2)*27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)*(8/exp(
t)*cos(t)^2-4/exp(t))+1/13856832*I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*(-450+I
*(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)-3*(-594+6*I*3^(1/2)*27983^
(1/2))^(2/3))*exp(t*(5/3*3^(1/2)*2^(1/2)*sin(1/3*arctan(1/99*83949^(1/2))+1/6*
Pi)-5*cos(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)-1))*(150+I*(-150+(-594+6
*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)-24*
(-594+6*I*3^(1/2)*27983^(1/2))^(1/3))*(2265-25*(-594+6*I*3^(1/2)*27983^(1/2))^(
2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+6*I*3^(1/2)*27983^(
1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*3^(1/2)/(I*3^(1/2)*
27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)/exp(t):

int(integrand2,t);

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

int(evala(integrand2),t);

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

 

Download handler_trig_exp_version_2.mw

ps. send to Maplesoft support.

MmaTranslator:-Mma:-Chop  does not seem to work as advertised.. It is supposed to work like Mathematica's Chop, but it does not. Is this by design or is it a bug?

restart;

MmaTranslator:-Mma:-Chop(((1.378834798932344*10^(-15))*I)*t) ;

returns the same input (1.378834799*10^(-15))*I*t but

MmaTranslator:-Mma:-Chop(((1.378834798932344*10^(-15))*I));

now returns 0.

But compare to Mathematica:

This makes it not very useful to use if one has to remove all symbols from an expression first, Any workaround? Here is an actual example where I wanted to use it

ode:=[diff(x(t), t) = -3*x(t) + 4*y(t), diff(y(t), t) = 5*x(t) + 9*z(t), diff(z(t), t) = y(t) + 6*z(t)];
sol:=dsolve(ode):
evalf[16](sol);

gives

Gives

{x(t) = (0.8172764110864494 - (7.853170607134887*10^(-16))*I)*c__1*exp((1.894304969211800 - (1.378834798932344*10^(-15))*I)*t) - (1.150854759654687 + (3.398186702482929*10^(-16))*I)*c__2*exp((-6.475677505300665 + (3.730232887526917*10^(-17))*I)*t) + (0.3780227930126823 + (9.268277369231981*10^(-16))*I)*c__3*exp((7.581372536088866 + (1.198480681985453*10^(-15))*I)*t), y(t) = c__1*exp((1.894304969211800 - (1.378834798932344*10^(-15))*I)*t) + c__2*exp((-6.475677505300665 + (3.730232887526917*10^(-17))*I)*t) + c__3*exp((7.581372536088866 + (1.198480681985453*10^(-15))*I)*t), z(t) = (-0.2435641206911610 + (1.431838044809606*10^(-16))*I)*c__1*exp((1.894304969211800 - (1.378834798932344*10^(-15))*I)*t) + (-0.08015596744746927 + (4.286632781083632*10^(-16))*I)*c__2*exp((-6.475677505300665 + (3.730232887526917*10^(-17))*I)*t) + (0.6323620634472722 - (5.261170533293161*10^(-16))*I)*c__3*exp((7.581372536088866 + (1.198480681985453*10^(-15))*I)*t)}

But Chop does not work on this. 

Maple 2023.2

There seems to be a consensus about using ListTools:-SearchAll to locate an item in a list. However, this subroutine does not work on other expressions; A simple instance is that “ListTools:-SearchAll(1, [[1], 1]);” only outputs  while what I need is  (because both “op([1, 1], [[1], 1])” and “op([2], [[1], 1])” are ). And actually, I hope that there is a more general version in Maple.
For example, I intend to do something like 

restart;
expr, elem := ToInert(eval(`print/Diff`)), '_Inert_NAME'("_syslib"):
SearchAll(elem, expr);

and 

List:=[[[[cS,[[[cS,cS],cS],[[[cS,cS],[[cK,cK],cS]],cS]]],cS],cS],[[[cS,[[cK,cS],cK]],cK],cS]]: 
items:=Or([[[identical(cS),anything],anything],anything],[[identical(cK),anything],anything]): 
SearchAll(items,List); 

In other words, I need all positions of an operand of an expression (cf. op).

It may be manually checked that the "indices" of  in  include [5,1,1,2,1,1,1,2,1,2,1,2], [5,1,2,2,1,1,1,1,2,1,2], and [5,2,2,1,1,3,1,2], since 

patmatch(op([5, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2], expr), elem);
 = 
                              true

patmatch(op([5, 1, 2, 2, 1, 1, 1, 1, 2, 1, 2], expr), elem);
 = 
                              true

patmatch(op([5, 2, 2, 1, 1, 3, 1, 2], expr), elem);
 = 
                              true

Similarly, after some manual searchs, 

[[1], [1, 1, 1, 2], [1, 1, 1, 2, 2], [1, 1, 1, 2, 2, 1, 2], [2], [2, 1, 1, 2]]:
convert(typematch~(map2(`?[]`, List, `%`), items), `and`);
 = 
                              true

It turns out that all "indices" in  of  are [1][1,1,1,2][1,1,1,2,2][1,1,1,2,2,1,2][2], and [2,1,1,2].
But isn't there such a  command that can eliminate the need to manually retrieve them?

Would Any one be able to give some explanation as to why calling a proc, which does not change anything globally but only acts on the input given, returns different answer the second time it is called with the same exact input? I am not able to understand this result at all. 

Maple 2023.2 on windows 10.

restart;

27260

W:=Matrix(3, 3, [[x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*cos(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x)),-x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*sin(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x)),x^(-1/6*(44+12*69^(1/2))^(1/3)+10/3/(44+12*69^(1/2))^(1/3)+2/3)],[x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)/x*cos(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))-1/2*x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))/x*sin(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x)),-x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)/x*sin(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))-1/2*x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))/x*cos(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x)),x^(-1/6*(44+12*69^(1/2))^(1/3)+10/3/(44+12*69^(1/2))^(1/3)+2/3)*(-1/6*(44+12*69^(1/2))^(1/3)+10/3/(44+12*69^(1/2))^(1/3)+2/3)/x],[x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)^2/x^2*cos(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))-x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)/x^2*cos(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))-x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)/x^2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*sin(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))+1/2*x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))/x^2*sin(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))-3/4*x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))^2/x^2*cos(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x)),-x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)^2/x^2*sin(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))+x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)/x^2*sin(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))-x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)/x^2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*cos(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))+1/2*x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))/x^2*cos(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x))+3/4*x^(1/12*(44+12*69^(1/2))^(1/3)-5/3/(44+12*69^(1/2))^(1/3)+2/3)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))^2/x^2*sin(1/2*3^(1/2)*(-1/6*(44+12*69^(1/2))^(1/3)-10/3/(44+12*69^(1/2))^(1/3))*ln(x)),x^(-1/6*(44+12*69^(1/2))^(1/3)+10/3/(44+12*69^(1/2))^(1/3)+2/3)*(-1/6*(44+12*69^(1/2))^(1/3)+10/3/(44+12*69^(1/2))^(1/3)+2/3)^2/x^2-x^(-1/6*(44+12*69^(1/2))^(1/3)+10/3/(44+12*69^(1/2))^(1/3)+2/3)*(-1/6*(44+12*69^(1/2))^(1/3)+10/3/(44+12*69^(1/2))^(1/3)+2/3)/x^2]]):
 

foo:=proc(W::Matrix,x::symbol)
   local W1:=W,W_det,W1_det;
   local F:=2*x^3-ln(x):

   W_det := LinearAlgebra:-Determinant(W);

   #change the first column
   W1[1..3,1] := Vector['column']([0,0,F/x^3]):

   W1_det := simplify(LinearAlgebra:-Determinant(W1)):

   simplify(W1_det/W_det);
end proc:
 

foo(W,x);

-x^(-(1/12)*((44+12*3^(1/2)*23^(1/2))^(2/3)+20*(44+12*3^(1/2)*23^(1/2))^(1/3)-20)/(44+12*3^(1/2)*23^(1/2))^(1/3))*(x^3-(1/2)*ln(x))*(3^(1/2)*((44+12*3^(1/2)*23^(1/2))^(2/3)+20)*cos((1/12)*3^(1/2)*((44+12*3^(1/2)*23^(1/2))^(2/3)+20)*ln(x)/(44+12*3^(1/2)*23^(1/2))^(1/3))+3*sin((1/12)*3^(1/2)*((44+12*3^(1/2)*23^(1/2))^(2/3)+20)*ln(x)/(44+12*3^(1/2)*23^(1/2))^(1/3))*((44+12*3^(1/2)*23^(1/2))^(2/3)-20))*3^(1/2)*(3^(1/2)*23^(1/2)+11/3)/((44+12*3^(1/2)*23^(1/2))^(1/3)*(11*3^(1/2)*23^(1/2)+207))

foo(W,x)

1

 

Download why_different_answer.mw

In an old question, @nm asked how to . While the answer in that question was almost up to the mark, there remains a regret. 

As the instance listed below shows, Maple, by default, draws arrows on a rectangular grid (rather than on a hexagonal mesh): 

  # Example of a three-dimensional vector field: 
vf__2d := VectorCalculus:-VectorField([sin(x)*(cos(x) + cos(y)), 
                                       sin(y)*(cos(x) - cos(y))], 'cartesian'[x, y]):
  # Example of a two-dimensional vector field: 
vf__3d := VectorCalculus:-VectorField([1 - (sin(u - v) + sin(u - w)), 
                                       1 - (sin(v - w) + sin(v - u)), 
                                       1 - (sin(w - u) + sin(w - v))], 'cartesian'[u, v, w]):
  # Phase portrait. 
Student:-VectorCalculus:-PlotVector(vf__2d, (x, y) =~ -Pi .. Pi, 
                                            'grid' = [`$`](25, 2), 
                                          'arrows' = 'THICK', 
                                   'fieldstrength' = log[63], 
                                           'color' = ColorTools:-Color("#0072BD"), 
                                            'axes' = "box"(*, …omitted…*));
= 

Note that I have changed some of the options in order to make the layout of arrows more prominent.
However, according to the help page of Mma's VectorPoints, among the following methods of location generation, Mma by default uses Hexagonal for 2D field vectors and FaceCenteredCubic for 3D field vector: 

Here is a collection of different settings available in Mma:

So if the requirement is to get the Maple's output looking like Mathematica's (see the beginning), the number and placement of vectors to plot should be thought of as well. In Maple, “the number of vectors” can be controlled by the plot (or plot3d) opinion , but how do I specify “the placement of vectors” (e.g., Mma's "Hexagonal" and "Mesh")?

Although there exists an  chapter in the documentation, randomly positioned arrows do not fit the bill. Is there any workaround?

This is linear ode, third order, Euler type and inhomogeneous ode.

If I solve the homogeneous ode only, then ask Maple to give me a particular solution, then add these, I get much much smaller solution which Maple verifies is correct.

Now when asking Maple to solve the original inhomogeneous ode as is, the solution is much more complicated and much longer with unresolved integrals.

Why does not Maple give the simpler solution? Both are verified to be correct.

This is my theory: When asking maple to find only the particular solution, it seems to have used a different and advanced method to find yp. Which is new to me and trying to learn it. It is based on paper "D'Alembertian Solutions of Inhomogeneous Equations (differential, difference, and some other).

Undetermined coefficients method can't really be used on ode's such as this because its coefficients are not constant.

Now, when asking Maple to solve the inhomogeneous ode, it seems to have used variation of parameters method, which results in integrals, which can be hard to solve.

My question is: Why does not Maple give the same much shorter answer when asked to solve the ode as is? Should it not have done so? Any thoughts on why such large difference in answer? Why it did not use the same method to find yp when asked to solve the whole ode as that leads to much smaller and more elegant solution.

ps. debugging this, it uses LinearOperators:-dAsolver:-dAlembertianSolver which is called from ODEtools/particularsol/linear to find yp when calling DETools:-particularsol(ode); but for some reason, it does not do this when asking it to solve the whole ode directly (if it did, then one will expect same answer to result, right?)

Maple 2023.2 on windows 10.
 

restart;

189900

(1)

#the ode
ode:=x^3*diff(y(x), x, x, x) + x^2*diff(y(x), x, x) + 2*x*diff(y(x), x) - y(x) = 2*x^3 - ln(x);

x^3*(diff(diff(diff(y(x), x), x), x))+x^2*(diff(diff(y(x), x), x))+2*x*(diff(y(x), x))-y(x) = 2*x^3-ln(x)

(2)

# find y_h
yh:=dsolve(lhs(ode)=0);

y(x) = c__1*x^(-(1/6)*((44+12*69^(1/2))^(2/3)-4*(44+12*69^(1/2))^(1/3)-20)/(44+12*69^(1/2))^(1/3))+c__2*x^((1/12)*(-20+(44+12*69^(1/2))^(2/3)+8*(44+12*69^(1/2))^(1/3))/(44+12*69^(1/2))^(1/3))*sin((1/12)*(3^(1/2)*(44+12*69^(1/2))^(2/3)+20*3^(1/2))*ln(x)/(44+12*69^(1/2))^(1/3))+c__3*x^((1/12)*(-20+(44+12*69^(1/2))^(2/3)+8*(44+12*69^(1/2))^(1/3))/(44+12*69^(1/2))^(1/3))*cos((1/12)*(3^(1/2)*(44+12*69^(1/2))^(2/3)+20*3^(1/2))*ln(x)/(44+12*69^(1/2))^(1/3))

(3)

#find particular solution
yp:=DETools:-particularsol(ode);

y(x) = (2/17)*x^3+ln(x)+3

(4)

#test particular solution is correct
odetest(yp,ode);

0

(5)

#find general solution = yh+ yp
y_general:=y(x)=rhs(yh)+rhs(yp);

y(x) = c__1*x^(-(1/6)*((44+12*69^(1/2))^(2/3)-4*(44+12*69^(1/2))^(1/3)-20)/(44+12*69^(1/2))^(1/3))+c__2*x^((1/12)*(-20+(44+12*69^(1/2))^(2/3)+8*(44+12*69^(1/2))^(1/3))/(44+12*69^(1/2))^(1/3))*sin((1/12)*(3^(1/2)*(44+12*69^(1/2))^(2/3)+20*3^(1/2))*ln(x)/(44+12*69^(1/2))^(1/3))+c__3*x^((1/12)*(-20+(44+12*69^(1/2))^(2/3)+8*(44+12*69^(1/2))^(1/3))/(44+12*69^(1/2))^(1/3))*cos((1/12)*(3^(1/2)*(44+12*69^(1/2))^(2/3)+20*3^(1/2))*ln(x)/(44+12*69^(1/2))^(1/3))+(2/17)*x^3+ln(x)+3

(6)

#test general solution is correct
odetest(y_general,ode);

0

(7)

#now solve the ode directly using Maple. Why this solution is much more complicated?
y_general_direct_method:=dsolve(ode);

y(x) = -(Int(-(5/2)*(x^(-(1/400)*69^(1/2)*(44+12*69^(1/2))^(2/3)+(11/1200)*(44+12*69^(1/2))^(2/3)+(1/12)*(44+12*69^(1/2))^(1/3)+2/3))^2*(44+12*69^(1/2))^(1/3)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))^2+3*(44+12*69^(1/2))^(1/3)*69^(1/2)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))^2-11*(44+12*69^(1/2))^(1/3)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))^2-11*(44+12*69^(1/2))^(1/3)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))^2+100*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))^2+100*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))^2)*(-2*x^3+ln(x))/(x^3*(3*3^(1/2)*23^(1/2)+11)*(11*3^(1/2)*23^(1/2)-207)), x))*x^((1/200)*69^(1/2)*(44+12*69^(1/2))^(2/3)-(11/600)*(44+12*69^(1/2))^(2/3)-(1/6)*(44+12*69^(1/2))^(1/3)+2/3)+(Int(-(5/6)*x^((1/200)*69^(1/2)*(44+12*69^(1/2))^(2/3)-(11/600)*(44+12*69^(1/2))^(2/3)-(1/6)*(44+12*69^(1/2))^(1/3)+2/3)*x^(-(1/400)*69^(1/2)*(44+12*69^(1/2))^(2/3)+(11/1200)*(44+12*69^(1/2))^(2/3)+(1/12)*(44+12*69^(1/2))^(1/3)+2/3)*(44+12*69^(1/2))^(1/3)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)*3^(1/2)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))-9*(44+12*69^(1/2))^(1/3)*69^(1/2)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))-11*(44+12*69^(1/2))^(1/3)*3^(1/2)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))+33*(44+12*69^(1/2))^(1/3)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))+100*3^(1/2)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))+300*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x)))*(-2*x^3+ln(x))*3^(1/2)/(x^3*(3*3^(1/2)*23^(1/2)+11)*(11*3^(1/2)*23^(1/2)-207)), x))*x^(-(1/400)*69^(1/2)*(44+12*69^(1/2))^(2/3)+(11/1200)*(44+12*69^(1/2))^(2/3)+(1/12)*(44+12*69^(1/2))^(1/3)+2/3)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))+(Int(-(5/6)*x^((1/200)*69^(1/2)*(44+12*69^(1/2))^(2/3)-(11/600)*(44+12*69^(1/2))^(2/3)-(1/6)*(44+12*69^(1/2))^(1/3)+2/3)*x^(-(1/400)*69^(1/2)*(44+12*69^(1/2))^(2/3)+(11/1200)*(44+12*69^(1/2))^(2/3)+(1/12)*(44+12*69^(1/2))^(1/3)+2/3)*(44+12*69^(1/2))^(1/3)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)*3^(1/2)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))+9*(44+12*69^(1/2))^(1/3)*69^(1/2)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))-11*(44+12*69^(1/2))^(1/3)*3^(1/2)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))-33*(44+12*69^(1/2))^(1/3)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))+100*3^(1/2)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))-300*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x)))*(-2*x^3+ln(x))*3^(1/2)/(x^3*(3*3^(1/2)*23^(1/2)+11)*(11*3^(1/2)*23^(1/2)-207)), x))*x^(-(1/400)*69^(1/2)*(44+12*69^(1/2))^(2/3)+(11/1200)*(44+12*69^(1/2))^(2/3)+(1/12)*(44+12*69^(1/2))^(1/3)+2/3)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))+c__1*x^((1/200)*69^(1/2)*(44+12*69^(1/2))^(2/3)-(11/600)*(44+12*69^(1/2))^(2/3)-(1/6)*(44+12*69^(1/2))^(1/3)+2/3)+c__2*x^(-(1/400)*69^(1/2)*(44+12*69^(1/2))^(2/3)+(11/1200)*(44+12*69^(1/2))^(2/3)+(1/12)*(44+12*69^(1/2))^(1/3)+2/3)*cos((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))+c__3*x^(-(1/400)*69^(1/2)*(44+12*69^(1/2))^(2/3)+(11/1200)*(44+12*69^(1/2))^(2/3)+(1/12)*(44+12*69^(1/2))^(1/3)+2/3)*sin((1/1200)*(44+12*69^(1/2))^(1/3)*3^(1/2)*(3*(44+12*69^(1/2))^(1/3)*69^(1/2)-11*(44+12*69^(1/2))^(1/3)+100)*ln(x))

(8)

#test the above
odetest(y_general_direct_method,ode);

0

(9)

 


 

Download why_such_difference_in_dsolve_answer.mw

Hi,

I would like to calculate Laplacian(1/r) in spherical coordinates

Considering that 1/r in spherical coordinates defines a distribution function (understood in Laurent Schwartz meaning) , the result has to be -4πDirac(r)

I tried to establish this result on Maple but that doesn't work. The result given is -Dirac(r)/r²  (see below)

What is the mistake I made?

Thanks

with(Physics[Vectors]);

SetCoordinates(spherical[r, phi, theta]);

F := Laplacian(1/r);
                               Dirac(r)
                        F := - --------
                                    r²  

Perhaps a stupid question but I fail to convert 21/4a1/4/pi1/4 (a result of a calculation performed by maple) into (2a/pi)1/4.

I tried simplify, combine, collect, ... with options. None of them work.

Thank you. 

This question is an expansion of my previous reply. 

There exist sixty kinds of statements in Maple, whose major ​​​​portion can be used as an expression or within an expression (e.g., assignment, loop, and condition). But why is use an exception?

Moreover, since it is reasonable to think of use as a (partial) generalization (see below) of the subs function, shouldn't the behaviour of use be consistent with do/if?

Compare: "seq((…;…;…), x in x__0):" (not allowed) vs. "for x in x__0 do …;…;… od:" (allowed); "subs(x = x__0, (…;…;…)):" (not allowed) vs. "use x = x__0 in …;…;… od:" (Not allowed! Why?).)

Edit. Besides that, is there some workaround to do something like

  # If use can be used as an expression or within an expression, 
use x = 2 + y in 'use y = 4 in x + y end' end;
  # should return “use y~ = 4 in (2 + y) + y~ end use;” and 
(use y = 2 + x in x -> x + y end);
  # should output “x~ -> x~ + (2 + x);”. 
  # Unfortunately, I cannot find a workaround to stimulate them.

 at present? Note that the `subs` function is unable to do so, so in my opinion, only when the use of `use` is no longer limited to statements will it become a sweeping generalization of `subs`.

l*`ℏ`*t*sqrt(4*`ℏ`^2*a^2*t^2 + m^2)/(sqrt(2*I*`ℏ`*t*a + m)*sqrt(-2*I*`ℏ`*t*a + m)*m) can be simplified :l *h*t/m

How can I ask Maple to do this.

Given

expr:=  (x^(-(44 + 12*sqrt(69))^(1/3)/6 + 10/(3*(44 + 12*sqrt(69))^(1/3)) + 2/3)) - (x^(sqrt(69)*2^(1/3)*((11 + 3*sqrt(69))^2)^(1/3)/100 - (11*(44 + 12*sqrt(69))^(2/3))/600 - (44 + 12*sqrt(69))^(1/3)/6 + 2/3))

could someone come with a trick to show this is zero using simplification and other methods? I know I can use is and coulditbe but I do not trust these too much due to false positives I've seen from them in some places.

Here is my attempts

restart;


expr:=  (x^(-(44 + 12*sqrt(69))^(1/3)/6 + 10/(3*(44 + 12*sqrt(69))^(1/3)) + 2/3)) - (x^(sqrt(69)*2^(1/3)*((11 + 3*sqrt(69))^2)^(1/3)/100 - (11*(44 + 12*sqrt(69))^(2/3))/600 - (44 + 12*sqrt(69))^(1/3)/6 + 2/3));
simplify(expr);
simplify(expr,size);
simplify(expr,symbolic);
simplify(normal(expr));
simplify(normal(expr),symbolic);
simplify(expr) assuming real;
simplify(expr) assuming positive;
is(expr=0);
coulditbe(expr=0);
evalb(expr=0);

Gives

This is for reference, the Mathematica attempt

long time ago I asked about automatic spacing to improve latex for sqrt. A nice solution was provided in https://www.mapleprimes.com/questions/231062-Adding-Space-After-Sqrt-To-Improve-The-Latex

The above is activatived using spaceaftersqrt = true option for latex:-Settings

There is a similar issue for inert integration where a space is typically added before the final dx This is done similar to the above fix using \, See for example this Latex web site giving many examples.

But there is no option I could see to tell Maple to do this automatically for integration.

So all my inert integrals now look not too good as the dx is too close to the integrand. Here are 2 examples with the settings I am using

restart;

latex:-Settings(useimaginaryunit=i,
      usecolor = false,
      powersoftrigonometricfunctions= mixed, ## computernotation,
      leavespaceafterfunctionname = true,
      cacheresults = false,
      spaceaftersqrt = true,
      usetypesettingcurrentsettings=true,
      linelength=10000      
);

sol:=sqrt(4*y^3-a*y-b)*a;
Intat( subs(y=a,1/sol),a=y(x));
latex(%);

Int(sol,y);
latex(%);

I copied the latex and compiled it, and this is the result

\documentclass[12pt]{book}
\usepackage{amsmath}
\begin{document}

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}d a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a d y
\]

\end{document}

Which gives

Compare the output when adding \, by hand to the latex

\documentclass[12pt]{book}
\usepackage{amsmath}
\begin{document}

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}\, d a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a \, d y
\]

\end{document}

Which now gives much better result

Actually, what would be nice if the "d" in "dx" was mathrm which becomes

\documentclass[12pt]{book}
\usepackage{amsmath}
\begin{document}

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}\, \mathrm{d} a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a \, \mathrm{d} y
\]

\end{document}

But may be I am asking for too much here. But having an option to add \, only for inert integration will be good to have.

Does there exist an option to do this that may be I overlooked?

Maple 2023.2

 

First 7 8 9 10 11 12 13 Last Page 9 of 26