Maple 2022 Questions and Posts

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

Download a.mw

The question is in the picture.

y(x) is the result of the last calculation. How do I apply diff to the last result?

Thanks!

Given two terms in expression of type  `+` where the first is rational and the second is not, I wanted to combine both under on common denominator to obtain one term (not `+` any more).

I expected that combine will do that.

restart;
expr:=A/B+C;
combine(expr);

But the above leaves the original expression as is. Ofcourse I can just do

numer(expr)/denom(expr);

Here is screen shot

My question is why combine does not do that automatically? For reference, Mathematica command Together is the equivalent to Maple combine and this is what it does

Which is what one would expect to happen. 

I am just trying to understand the logic why Maple's combine did not work as one would expect. That is all. I looked at help and tried different option to combine, but non worked.

Is there  a specific type name for vectors in Physics[Vectors]?  Specifically, Let's say we want to write a proc whose argument is expected to be a (Physics) Vector, as in  these (trivial) demos:

with(Physics[Vectors]);

f := proc(a_::???)
    return a_ . a_;
end proc:

g := proc(a_::???, b_::???)
    return a_ &x b_;
end proc:

What do we put in place of "???".

Maple knows how to obtain differntials using D.

So typing  D(x*y) it gives   D(x)*y+x*D(y)

But what I want is given as input  D(x)*y+x*D(y) have Maple return back D(x*y)

Nothing I tried work. I tried simplify and convert(...,D) 

I am looking for a function that takes an expression with differentials like the above output, and return, if possible ONE differnetial in the form  D(  f(x,y) )

What I mean, given as INPUT any of these expressions on the RHS in the image below

To return back  the  D(...)  in the LHS above. I know Maple can do it going from the LHS to the RHS. But I want the other way around.

Does Maple support such operations?

Maple 2022.1

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.

 

First 31 32 33 34 35 36 37 Page 33 of 39