Maple 2022 Questions and Posts

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

To Maple support,. 

fyi,

internal error generated on this ode when trying odetest
 

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;

ode:=x^3*diff(y(x),x$3)+x^2*diff(y(x),x$2)-3*x*diff(y(x),x)+(x-1)*y(x)=0;
sol:=dsolve(ode,y(x),'series',x=0):
odetest(sol,ode,'series','point'=0);

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

Error, (in odetest/series) complex argument to max/min: 1/4800*((-79*I+3*83^(1/2))*3^(1/2)+9*I*83^(1/2)-79)*(316+12*83^(1/2)*3^(1/2))^(2/3)+1/12*I*(316+12*83^(1/2)*3^(1/2))^(1/3)*3^(1/2)-1/12*(316+12*83^(1/2)*3^(1/2))^(1/3)+20/3


 

Download problem_odetest_july_23_2022.mw

 

Update 2 years later

FYI, This error is still not fixed in Maple 2024

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1793 and is the same as the version installed in this computer, created 2024, August 25, 9:6 hours Pacific Time.`

Order:=4;
ode:=x^2*diff(y(x),x$2)+x^2*diff(y(x),x)+y(x)=0;
maple_sol:=dsolve(ode,y(x),'series','point'=0);
odetest(maple_sol,ode,'series','point'=0);

4

x^2*(diff(diff(y(x), x), x))+x^2*(diff(y(x), x))+y(x) = 0

y(x) = c__1*x^(1/2-((1/2)*I)*3^(1/2))*(series(1-((1/2-((1/2)*I)*3^(1/2))/((1/2-((1/2)*I)*3^(1/2))^2+3/2-((1/2)*I)*3^(1/2)))*x+((3/2-((1/2)*I)*3^(1/2))*(1/2-((1/2)*I)*3^(1/2))/(((1/2-((1/2)*I)*3^(1/2))^2+3/2-((1/2)*I)*3^(1/2))*((1/2-((1/2)*I)*3^(1/2))^2+9/2-((3/2)*I)*3^(1/2))))*x^2-((5/2-((1/2)*I)*3^(1/2))*(3/2-((1/2)*I)*3^(1/2))*(1/2-((1/2)*I)*3^(1/2))/(((1/2-((1/2)*I)*3^(1/2))^2+3/2-((1/2)*I)*3^(1/2))*((1/2-((1/2)*I)*3^(1/2))^2+9/2-((3/2)*I)*3^(1/2))*((1/2-((1/2)*I)*3^(1/2))^2+19/2-((5/2)*I)*3^(1/2))))*x^3+O(x^4),x,4))+c__2*x^(1/2+((1/2)*I)*3^(1/2))*(series(1-((1/2+((1/2)*I)*3^(1/2))/((1/2+((1/2)*I)*3^(1/2))^2+3/2+((1/2)*I)*3^(1/2)))*x+((3/2+((1/2)*I)*3^(1/2))*(1/2+((1/2)*I)*3^(1/2))/(((1/2+((1/2)*I)*3^(1/2))^2+3/2+((1/2)*I)*3^(1/2))*((1/2+((1/2)*I)*3^(1/2))^2+9/2+((3/2)*I)*3^(1/2))))*x^2-((5/2+((1/2)*I)*3^(1/2))*(3/2+((1/2)*I)*3^(1/2))*(1/2+((1/2)*I)*3^(1/2))/(((1/2+((1/2)*I)*3^(1/2))^2+3/2+((1/2)*I)*3^(1/2))*((1/2+((1/2)*I)*3^(1/2))^2+9/2+((3/2)*I)*3^(1/2))*((1/2+((1/2)*I)*3^(1/2))^2+19/2+((5/2)*I)*3^(1/2))))*x^3+O(x^4),x,4))

Error, (in odetest/series) complex argument to max/min: 9/2-1/2*I*3^(1/2)

 


 

Download odetest_error_series_august_2024.mw

 

Will check again in 2-3 years and I am sure this bug will still not be fixed.

 

When displaying two tubeplots together, we may specify their colors at will, as long as they are different colors!  For instance, specifying red and green works correctly, but specifying red and red results in red and black!

See the attached worksheet.  Interestingly, when displaying the contents of the worksheet on this website, the colors are rendered correctly!  So don't go with what you see on this web page; look inside the worksheet instead.

restart;

kernelopts(version);

`Maple 2022.1, X86 64 LINUX, May 26 2022, Build ID 1619613`

with(plots):

Two intersecting tori colored red and green -- works as expected:

display(
        tubeplot([cos(t), 0, sin(t)], t=-Pi..Pi, radius=0.2),
        tubeplot([cos(t), sin(t), 0], t=-Pi..Pi, radius=0.2),
style=surface, color=[red,green]);

When we set both colors to red, one of the surfaces is painted black!  Why?

Please note: This website displays the colors corectly as red and red.  But

within the worksheet the colors are read and black.

display(
        tubeplot([cos(t), 0, sin(t)], t=-Pi..Pi, radius=0.2),
        tubeplot([cos(t), sin(t), 0], t=-Pi..Pi, radius=0.2),
style=surface, color=[red,red]);

Specifying colors as red/red within the tubeplots still produces red/black!

display(
        tubeplot([cos(t), 0, sin(t)], t=-Pi..Pi, radius=0.2, color=red),
        tubeplot([cos(t), sin(t), 0], t=-Pi..Pi, radius=0.2, color=red),
style=surface);

Download mw.mw

PS: As a workaround, we may replace the red & red specification with
COLOR(RGB, 1, 0, 0) and
COLOR(RGB, 1, 0, 0.01)
which are different enough to make Maple happy, but produce essentially the same red color.

What is the correct way to write the explicit solution before calling odetest to verify it on an ode? is it

   sol:= y(x)= the RHS  (1)

or

   sol:= y(x) - the RHS = 0 (2)

I am asking because Maple sometimes gives very different result from odetest depending on which form the explicit solution is written. It is very hard to keep trying different forms each time.  Here is an example below.

Maple 2022.1 on windows 10.   Is this a bug? I do not think it should  make a difference, but it does and I have no idea why. Is there an option or way to make sure the same result is obtained each time regardless how the explicit soltion is written?

I have a theory as to why this might happen: When using (1) odetest sees y(x) on the LHS on its own, and then uses odetest  code internally designed for explicit solution testing.

When using (2), it sees y(x) not on its own on the LHS and it assumes this is then an implicit solution and uses odetest code internally meant for implicit solution testing, hence the difference in output.
 

restart;

ode:=sqrt(y(x))+(1+x)*diff(y(x),x)=0:
ic:=y(0) = 1:
mysol:=y(x)=1/4*(ln(1+x)-2)^2:
odetest(mysol,ode);

csgn(ln(1+x)-2)*ln((1+x)^(1/2))-csgn(ln(1+x)-2)+ln((1+x)^(1/2))-1

odetest((lhs-rhs)(mysol) = 0,ode);

y(x)^(1/2)+(1/2)*ln(1+x)-1

 

 


 

Download why_different_result.mw

Hi,

Is there a way to symbolically evaluate this integral?

int(sin(sqrt(-x^2 + 1)), x);

Any one has a trick to show in Maple that  x + sqrt(-2 + 2*sqrt(4*x^2 + 1))*sqrt(2 + 2*sqrt(4*x^2 + 1))/4; is zero for x<=0?

I'd like to get similar simplication as this below but in Maple, But everything I tried so far did not work. I am sure there is a way in Maple, but have not found it yet.

Below is the Maple worksheet

interface(version)

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;

r := x + sqrt(-2 + 2*sqrt(4*x^2 + 1))*sqrt(2 + 2*sqrt(4*x^2 + 1))/4;

x+(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

simplify(r) assuming x<0

x+(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

simplify(r,symbolic) assuming x<0

x+(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

simplify(r,sqrt) assuming x<0

x+(1/4)*(-2+2*(4*x^2+1)^(1/2))^(1/2)*(2+2*(4*x^2+1)^(1/2))^(1/2)

#showing it is zero for x<=0
plot(r,x=-10..1)

 

Download show_it_is_zero.mw

Hi,

I use Maple version 2022.1 on macOS 10.14.6.

I have big problems with the parabolic groups in the "LieAlgebra" package.

First of all in the help for "Query > Parabolic", the link refers to the help page for the commands "CylinderU, CylinderV, CylinderD" which have nothing to do with it. Also, the command "Query(Alg, "Parabolic")" does not work.

Below is a list of commands that give an error for "Query".

restart:with(LinearAlgebra):with(DifferentialGeometry):with(LieAlgebras):

L:=[
Matrix(5, 5, [[0, 0, 1, 1, 1], [0, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 1, 0, 1, 1], [-1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 1, 1, 0, 1], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [-1, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 1, 1, 1, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [-1, 0, 0, 0, 0], [0, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 1, 1], [0, 0, 0, 0, 0], [0, -1, 0, 0, 0], [0, -1, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 1, 0, 1], [0, -1, 0, 0, 0], [0, 0, 0, 0, 0], [0, -1, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 1, 1, 0], [0, -1, 0, 0, 0], [0, -1, 0, 0, 0], [0, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, -1, 0, 0], [0, 1, 0, 0, 1], [0, 0, 0, 0, 0], [0, 0, -1, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, -1, 0, 0], [0, 1, 0, 1, 0], [0, 0, -1, 0, 0], [0, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, -1, 0], [0, 0, 0, -1, 0], [0, 1, 1, 0, 0], [0, 0, 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 1, 1], [0, 0, -1, 0, 0], [0, 0, -1, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, -1, 0], [0, 0, 1, 0, 1], [0, 0, 0, -1, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, -1], [0, 0, 0, 0, -1], [0, 0, 1, 1, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, -1, 0], [0, 0, 0, 0, 0], [0, 1, 0, 0, 1], [0, 0, 0, -1, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, -1], [0, 0, 0, 0, 0], [0, 0, 0, 0, -1], [0, 1, 0, 1, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, -1], [0, 0, 0, 0, -1], [0, 0, 0, 0, 0], [0, 1, 1, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, -1/2*sqrt(2), -1/2*sqrt(2), -1/2*sqrt(2)], [0, 1/2*sqrt(2), 0, 0, 0], [0, 1/2*sqrt(2), 0, 0, 0], [0, 1/2*sqrt(2), 0, 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 1/2*sqrt(6), 1/6*sqrt(6), 1/6*sqrt(6)], [0, -1/2*sqrt(6), 0, -1/3*sqrt(6), -1/3*sqrt(6)], [0, -1/6*sqrt(6), 1/3*sqrt(6), 0, 0], [0, -1/6*sqrt(6), 1/3*sqrt(6), 0, 0]]), 
Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 2/3*sqrt(3), 1/6*sqrt(3)], [0, 0, 0, 2/3*sqrt(3), 1/6*sqrt(3)], [0, -2/3*sqrt(3), -2/3*sqrt(3), 0, -1/2*sqrt(3)], [0, -1/6*sqrt(3), -1/6*sqrt(3), 1/2*sqrt(3), 0]]), Matrix(5, 5, [[0, 0, 0, 0, 0], [0, 0, 0, 0, 1/2*sqrt(5)], [0, 0, 0, 0, 1/2*sqrt(5)], [0, 0, 0, 0, 1/2*sqrt(5)], [0, -1/2*sqrt(5), -1/2*sqrt(5), -1/2*sqrt(5), 0]])];

LieP:=LieAlgebraData(L,Alg):
DGsetup(LieP);
Query(Alg,"Parabolic");

 

I use Int to show some step before evaluating it to become normal int

I'd like to show the following when the integrand is one:

But Int(x) does not work, and Int(,x) gives syntax error. So only choice is to use Int(1,x) which does not look as nice as the above

Is there a trick to use? i.e. when the integrand is one, I want to display it as the first image and not as the second image. This is just to make the Latex look a little nicer only.

I tried few things, but nothing worked so far, as Int needs something there where I want the empty spot to be (There is actually 1 there ofcourse, but I do not want to show the 1).

May be we need a Latex settings for this?  Or interface setting?

Maple 2022.1

I recently got introduced to fractional calculus, I saw this image on the internet and went to verify the 3rd block of image i.e fractional differentiation on Maple 2022. But Maple returned answer which does not match the result claimed in the image i.e x. I want to know what I am missing here. But when used fracdiff() the answer matches.I also wanted to know how its done by using showSolution command but didn't get the answer. Can I get the steps? meme.mw


f := diff(x, [`$`(x, 1/2)])

x

(1)

``

evalb(diff(x, [`$`(x, 1/2)]) = x)

true

(2)

evalb(diff(x, [`$`(x, 1/2)]) = 2*sqrt(x/Pi))

false

(3)

ShowSolution(diff(x, x^(1/2)))

Error, invalid input: diff received x^(1/2), which is not valid for its 2nd argument

 

fracdiff(x, x, 1/2)

2*x^(1/2)/Pi^(1/2)

(4)

ShowSolution(fracdiff(x, x, 1/2))

Error, (in Student:-Calculus1:-ShowSolution) input expression does not have any incomplete calculus operations

 

NULL


Download meme.mw

 

I am curious to know steps of integration for e^(t^3)*(cos(t))^3 as Maple found the answer correctly. So I wanted to know how it got to that solution. I applied the commands shown in document but unable to get steps. I want to know the reason for this and is it possible to get it work.
 

``

exp(t^2)*cos(t)^3

int(exp(t^2)*cos(t)^3, t)

-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t+3/2)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t+1/2)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t-1/2)-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t-3/2)

(1)

Student[Calculus1][IntTutor]()

eval(-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t+3/2)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t+1/2)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t-1/2)-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t-3/2), [t = 1])

-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(3/2+I)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(1/2+I)+((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(1/2-I)+((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(3/2-I)

(2)

evalf[10](-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(3/2+I)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(1/2+I)+((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(1/2-I)+((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(3/2-I))

.8154967124+0.*I

(3)

        
with(Student:-Calculus1):

 

 

Understand(Int, constant, constantmultiple, sum, difference)

ShowSolution(Int(exp(t^2)*cos(t)^3, t), maxsteps = 1000)

Error, (in Student:-Calculus1:-ShowSolution) unable to compute solution steps

 

NULL


 

Download e.mwe.mw

 

Given

restart;
eq:=A=(1/2+x+y)^(3);
the_rhs:=solve(eq,A);

I asked solve to solve the above equation for A, expecting to get back (1/2+x+y)^(3), but it returns instead this

I looked at solve options, and tried number of them, but no change. I was looking for option to tell Maple not to simplify as it solves.

I also tried to see if the solution returned can be put back to the original form, and could not so far find a way, tried simplify and some options. But I did not try every possible method as there are do many.

Compare to Mathematica, which keeps the solution the same, as what one would expect. I see no reason to change it

ClearAll[A,x,y]
eq=A==(1/2+x+y)^3
Solve[eq,A]

The reason I am asking, is that it now makes parsing a little harder as I am looking for something in the form (expression)^power   as the solution.  i.e. the type to be `^`.    Now the type shows up as `*` because Maple for some reason changed it. 

It will easier if Maple did not do that, or if there is a way to change the expression back to the way it was. If all this fails, I have to just make the parsing handle this extra case form if needed.

Any suggestions?

Maple 2022.1

Update

Found a way after lots of trials and errors

simplify(the_rhs,[power,symbolic]);

 

But it would have been better if Maple did not do the simplification in the first place. But I could not find an option to tell it to do that while solving.

 

Maple 2022.1 on windows 10

restart;
w:=y-x/(c-x):
p1:=plots:-implicitplot(eval(w,c=2),x=-6..9,y=-3..3):
p2:=plots:-implicitplot(eval(w,c=2),x=-6..10,y=-3..3):
p3:=plots:-implicitplot(eval(w,c=2),x=-6..11,y=-3..3):
[p1,p2,p3]

Gives

 

Notice p2. The vertical line is gone. This happens when the range x=-6..10 and it shows back again when x=-6..11 or x=-6..9

Why does this happen? It is the same equation.

 

I tried different things but can't figure how to make Maple give a simplified result from int command without these RootOf with sums in them. Here is an example.

restart;
anti:=int(1/(a+x^(1/5)),x);

The strange thing is that doing

eval(anti,a=1)

Keeps these rootsOf and Sums there. But doing

anti:=int(1/(1+x^(1/5)),x);

Gives simplified result without RootOf

I tried DEtools:-remove_RootOf and assumptions and value() but nothing worked. I tried assumptions on a, such as assuming a::integer,a>0 and other things. 

I need similar result as Mathematica:

ClearAll[x, a];
Integrate[1/(a + x^(1/5)), x]

I am sure there is an option in Maple to do that, i.e. give result without these RootOf and Sums. But so far, I could not find it. I looked at options to int() command also. 

Any one know what option to use or how to simplifies it the the above result by Mathematica? 

Maple 2022.1 on windows 10

Is it considered OK to give singular solution to an ode which does not satisfy the ode?

I thought may be because it is singular solution and not general solution, then that is allowed sometimes. But it seems strange to me to give a solution which cleary do not satisfy the ode, even if it is singular.  But may be because it is singular, it is not required to satisfy the ode? Here is an example

restart;
ode_1:=diff(y(x),x)=sqrt(1+x+y(x)) ;
sol_1:=DEtools:-dalembertsol(ode_1);

Gives

But the first given "solution" (singular) does not satisfy the ode. Plugging it into the ode gives  -1=1.  Also odetest(y(x)=-x,ode_1) agrees it does not satisfy the ode. It gives -2 and not zero.

What do others think about this?  

This works

restart;
ode := diff(y(x),x)=a0+a1*y(x)+a2*y(x)^2+a3*y(x)^3;
DEtools:-abelsol(ode);

But this does not

restart;
ode := diff(y(x),x)=a0+a1*y(x)+a2*y(x)^2+a3*y(x)^3;
name_of_solver:=abelsol;
DEtools:-name_of_solver(ode);

Then I found this made it work

eval(DEtools:-name_of_solver)(ode);

So I am guessing what happens is this: doing DEtools:-name_of_solver Maple first searched for a proc called name_of_solver inside DEtools package, and found none. So it does not work.

But adding eval first, then name_of_solver is evaluated and replaced by abelsol and after that the call is made, and it then finds this proc inside the DEtools package.

But my question is, why is eval needed here?

Is it not automatically happens that a variable is replaced by its value? So I expected DEtools:-name_of_solver to automatically become DEtools:-abelsol and only then the call is made.

Why the rule of evaluation is different in this case?

Formatting_exponents_in_typesetting_situations.mw
How do I format express an exponent in standard notation when typesetting a caption?  10^2 displays as 100 when I want it to display as 10^2 but without the caret.

restart

with(plots)

logplot(10^x, x = 0 .. 8, size = [300, 300], legend = [y(x) = 10^x], legendstyle = [location = top], caption = typeset("How do I type,", 10^8, ", and have it show up as 10^8 in the caption?"))

 

NULL

Download Formatting_exponents_in_typesetting_situations.mw

First 34 35 36 37 38 39 40 Page 36 of 42