Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Dear all,
I am trying to build an animated activity to introduce the concept of a definite integral.
My goal is to animate the graph simultaneously with a three-column table displaying the values of the upper Riemann sum, the lower Riemann sum, and the definite integral.
Any ideas or suggestions on how to implement this?
Many thanks in advance.

Riemann_Anim_table.mw

This is a good example of how Maple result looks different depending on what calls to Maple were made before.

I can't upload worksheet so have to show code and screen shot. Compare the screen shot below. Maple 2025.2. Same exact input., In first example the polynomial terms display in different order compared to the second example, even though the same exact input is used.

Clearly the first example is because Maple remembered this polynomial in its remember table somewhere before due to earlier call, and did not want to make new copy since it is same polynomial?

But I do want to make new polynomial. The old copy/order this polynomial in Maple internal tables is getting in the way.

But do not know how to tell Maple to clear its cache so I get same display as in the second example. I know both answers is the same. But the issue is why it displays different.

How could I get same output from first example as in the second one? What do I need to clear? I tried forget(Student:-Precalculus:-CompleteSquare) but this had no effect. ALso tried forget(all); also forget(all,forgetpermanent = true,reinitialize=true); also forget(Student:-Precalculus:-CompleteSquare,subfunctions=true);

code

restart;

eq := x^2 + y^2 + z^2 - 2*x + 8*y - 6*z - 30 = 0:
eq:=Student:-Precalculus:-CompleteSquare(eq):
e1:=convert(indets(%,`^`),list):
e2:=zip((a,b)->a=b,e1,[X,Y,Z]):
e3:=sort(eval(eq,e2));
e4:=map(X->rhs(X)=lhs(X),e2);
eval(e3,e4);

restart;

e3 := X + Y + Z - 56 = 0;
e4 := [X = (x - 1)^2, Y = (y + 4)^2, Z = (z - 3)^2];
eval(e3,e4);

[moderator: duplicate of this earlier question]

i found the same as author found but is not give me zero when i replace in my pdes can anyone see the problem?

test.mw

When clicking on a pink error message I get this

Can someone explain what is going on? Quite unusual for me all this.

I do not have a server to white list. What can I do about it?

Is that Sucuri thing safe?

What is the current status of SupportTools? Is this something that still brings fixes in Maple before official release?

I am asking because there have not been an update to ST since June 23, 2025. Almost 6 months ago.

Should one still check for current version of SupportTools, is it still being updated or not? If not, then what does SupportTools package actualy do or contain if it is no longer needed/used? 

This is all fussy for me, and some clarification for users will be good to better understand the role of this package.

odetest does not want to verify this maple solution against the IC.  Anyone could find why or a trick to get [0,0] from odetest?

Can not upload worksheet due to firewall at Mapleprime issue. Here the code and screen shot.

ode := diff(y(x),x) +cos(1/exp(2*x))*y(x) = sin(1/exp(x));
IC := a*D(y)(x0)+ c*y(x0) = b*y0;
maple_sol:=dsolve([ode,IC],y(x));
the_residue:=odetest(maple_sol,[ode,IC]);

#not zero, also simplify did not give zero

Hi everyone,

I'm trying to simplify

sqrt(sqrt(12)/(9 + sqrt(108)))

into

1-sqrt(3)/3

using Maple. Could someone please show me the Maple commands or step-by-step procedure that would do the simplification for me?

Thanks in advance for your help!

using regular expression in Maple is little annoying, because one has to escape \ in the regx string itself, which makes it more complicated compared to other languages. For example

StringTools:-RegMatch("^\[.*\]$","[A]")

gives false. But

StringTools:-RegMatch("^\\[.*\\]$","[A]")

gives true.

Other languages have special function to generate the regx itself, which does not require escaping the \ when writing the regx Which makes it easier to see the regx (escaping is done under the cover). like this

Since all places and web sites that show examples of regx., do not have to escape \ before using, it will be good if Maple adds such special new function to StringTools to generate regx like the above so users do not have to remember to escape \.   

It is hard enough to use regx without having to also remember to escape things.

I could not find such a function in Maple. Does one exist?

Maple 2025.2

 

As I have stated "a few times" here on Maple Primes, I've written a new book with Nic Fillion on perturbation methods.  The book will be published by SIAM early next year.  To help market the book, I sent several images to my editor who asked her team to make a desk calendar out of them.  The PDF for that is

here at this link to my web page at github

I had fun making the images, in Maple, and the QR code on the calendar links to a Maple Transactions paper that describes each of the images.  To save you struggling with your QR code reader, here is a link to that paper.

 

Best wishes for the season and for 2026.

 

 

I use plot(sol,...) to plot solution of ode. I do not give x or y ranges and let Maple figure the best values. Then use the command 

T:=rhs~(indets(p, identical("originalview")=anything))[];    

To extract the x and y ranges used and then use these in the command DEtools:-DEplot(....)

The plot() command shows the solution plot fully (in this example below, the left and right sides).

But the  DEtools:-DEplot(....) only shows part of the solution on top of the slope field arrows.  Even though the same x and y ranges is used.

I found that if I increase the y range for the DEtools:-DEplot(....) by a little bit, now the full solution shows, which is same as plot command generated.

Since I am doing all this in code, without looking, I am first plotting the solution using plot() and then use the ranges generated for DEtools:-DEplot(....).

If I do not use the y range in DEtools:-DEplot(....) but only use the x range, sometimes it works and sometimes Maple gives warnings. (depending on the solution). So I am  back to using the ranges generated by plot() command to be safe.

Here is an example to show this problem

ode:=diff(y(x),x) = x*(x^2+9)^(1/2);
IC:=y(-4) = 0;
sol:=dsolve([ode,IC]);
p:=plot(rhs(sol),'axes'='boxed','labels'=[x,y(x)],'axis'=['gridlines'=['color'='lightblue']],'color' = 'red');

Now the x and y ranges used above is extraced

T:=rhs~(indets(p, identical("originalview")=anything))[];      
from_x := op(1,T[1]);
to_x   := op(2,T[1]);
from_y := op(1,T[2]);        
to_y   := op(2,T[2]);  

#gives

      T := [-9.94999999999999929 .. 9.94999999999999929, 
        -32.6629164062620561 .. 332.469298224442980]


                 from_x := -9.94999999999999929
                  to_x := 9.94999999999999929
                 from_y := -32.6629164062620561
                  to_y := 332.469298224442980

These are used in the DEplot

DEtools:-DEplot(ode,[y(x)],x=from_x..to_x,y=from_y ..to_y ,[IC],
                'dirfield'=[15,15],
                'labels'=[x,y(x)],
                'axes' = 'boxed',                
                'arrows'='smalltwo', #'curve', 
                'color' = 'blue',#color of arrows
                'linecolor'='red'#color of solution
                );

Notice how the solution (red line) is truncated.  It turns out in this case adding say 10% to the y range, it now shows the solution like this

DEtools:-DEplot(ode,[y(x)],x=from_x..to_x,y=from_y-(0.1*abs(from_y)) ..to_y ,[IC],
                'dirfield'=[15,15],
                'labels'=[x,y(x)],
                'axes' = 'boxed',                
                'arrows'='smalltwo', #'curve', 
                'color' = 'blue',#color of arrows
                'linecolor'='red'#color of solution
                );

But I do not know if this trick will work for each example. 

As I said, I can not give the y range to DEplot, then in this example, it will now show the full solution. But I have examples where this can cause warnings.

The question is, why giving same y range used by plot to DEplot cause the solution (red line) to truncate? Why one has to increase the y range to make it show the full solution?

Is there a better method that the above to make DEplot show full solution same as plot() does? 

Maple 2025.2

ps. I just tried upload the worksheet and now it works! it looks like mapleprimes web site is fixed.
 

interface(version);

`Standard Worksheet Interface, Maple 2025.2, Windows 10, November 11 2025 Build ID 1971053`

ode:=diff(y(x),x) = x*(x^2+9)^(1/2);
IC:=y(-4) = 0;

diff(y(x), x) = x*(x^2+9)^(1/2)

y(-4) = 0

sol:=dsolve([ode,IC]);

y(x) = (1/3)*(x^2+9)^(3/2)-125/3

p:=plot(rhs(sol),'axes'='boxed','labels'=[x,y(x)],'axis'=['gridlines'=['color'='lightblue']],'color' = 'red');

 

T:=rhs~(indets(p, identical("originalview")=anything))[];      
from_x := op(1,T[1]);
to_x   := op(2,T[1]);
from_y := op(1,T[2]);        
to_y   := op(2,T[2]);  

[-9.94999999999999929 .. 9.94999999999999929, -32.6629164062620561 .. 332.469298224442980]

-9.94999999999999929

9.94999999999999929

-32.6629164062620561

332.469298224442980

DEtools:-DEplot(ode,[y(x)],x=from_x..to_x,y=from_y ..to_y ,[IC],
                'dirfield'=[15,15],
                'labels'=[x,y(x)],
                'axes' = 'boxed',                
                'arrows'='smalltwo', #'curve',
                'color' = 'blue',#color of arrows
                'linecolor'='red'#color of solution
                );

DEtools:-DEplot(ode,[y(x)],x=from_x..to_x,y=from_y-(0.1*abs(from_y)) ..to_y ,[IC],
                'dirfield'=[15,15],
                'labels'=[x,y(x)],
                'axes' = 'boxed',                
                'arrows'='smalltwo', #'curve',
                'color' = 'blue',#color of arrows
                'linecolor'='red'#color of solution
                );

 


 

Download example_phase_plot.mw

How to explain this strange behavior?   odetest(sol,ode) does not give zero. But odetest(sol,[ode,IC]) gives [0,0]

Same solution and same ode. Why adding IC, now odetest says solution verifies the ode, but without adding IC, it does not give zero right away. I know I can simplify the result to zero. But the point is that it should have given zero right away, because that is what it did when adding IC.

Should it not have given zero in first case also?

Can't upload worksheet due to security. Here is code and screen shot

ode := diff(y(x),x) + cos(1/exp(2*x))*y(x) = sin(1/exp(x));
IC := a*D(y)(x0)+c*y(x0) = b*y0;
sol:=y(x) = ((-cos(exp(-2*x0))*a + c)*Int(sin(exp(-tau))*exp(-1/2*Ci(exp(-2*tau))), tau = 0 .. x0) + Int(sin(exp(-tau))*exp(-1/2*Ci(exp(-2*tau))), tau = 0 .. x)*(cos(exp(-2*x0))*a - c) + exp(-1/2*Ci(exp(-2*x0)))*(a*sin(exp(-x0)) - b*y0))*exp(1/2*Ci(exp(-2*x)))/(cos(exp(-2*x0))*a - c);

odetest(sol,ode);

#not zero

#now

odetest(sol,[ode,IC]);

#gives [0,0]

 

By symbolic regression I mean an algorithm that determines a model (fit function) that fits best to a data set.

Are there any commands, packages, libraries or MaplesPrime post that are helpful in this regrad?

Edit: For the data set below a symbolic regression could ideally algortihm return "simple" models (formulas)  that use a "minimal" number of terms.

data_set := [[0, 0.], [.1, -0.192545973e-2], [.2, -0.57548536e-2], [.3, -0.93691571e-2], [.4, -0.116497299e-1], [.5, -0.122768958e-1], [.6, -0.114535757e-1], [.7, -0.96377097e-2], [.8, -0.73398894e-2], [.9, -0.50026258e-2], [1.0, -0.29489933e-2], [1.1, -0.13773796e-2], [1.2, -0.3802267e-3], [1.3, 0.288809e-4], [1.4, -0.1112403e-3], [1.5, -0.7312233e-3], [1.6, -0.1747389e-2], [1.7, -0.3072868e-2], [1.8, -0.4624615e-2], [1.9, -0.6327418e-2], [2.0, -0.8115810e-2], [2.1, -0.9934627e-2], [2.2, -0.11738712e-1], [2.3, -0.13492153e-1], [2.4, -0.15167275e-1], [2.5, -0.16743558e-1], [2.6, -0.18206567e-1], [2.7, -0.19546942e-1], [2.8, -0.20759491e-1], [2.9, -0.21842382e-1], [3.0, -0.22796451e-1], [3.1, -0.23624612e-1], [3.2, -0.24331323e-1], [3.3, -0.24922213e-1], [3.4, -0.25403690e-1], [3.5, -0.25782692e-1], [3.6, -0.26066441e-1], [3.7, -0.26262258e-1], [3.8, -0.26377439e-1], [3.9, -0.26419110e-1], [4.0, -0.26394196e-1], [4.1, -0.26309316e-1], [4.2, -0.26170744e-1], [4.3, -0.25984403e-1], [4.4, -0.25755853e-1], [4.5, -0.25490243e-1], [4.6, -0.25192364e-1], [4.7, -0.24866612e-1], [4.8, -0.24517040e-1], [4.9, -0.24147342e-1], [5.0, -0.23760880e-1], [5.1, -0.23360701e-1], [5.2, -0.22949566e-1], [5.3, -0.22529948e-1], [5.4, -0.22104070e-1], [5.5, -0.21673916e-1], [5.6, -0.21241260e-1], [5.7, -0.20807663e-1], [5.8, -0.20374513e-1], [5.9, -0.19943032e-1], [6.0, -0.19514256e-1], [6.1, -0.19089134e-1], [6.2, -0.18668453e-1], [6.3, -0.18252883e-1], [6.4, -0.17843021e-1], [6.5, -0.17439353e-1], [6.6, -0.17042293e-1], [6.7, -0.16652162e-1], [6.8, -0.16269229e-1], [6.9, -0.15893717e-1], [7.0, -0.15525760e-1], [7.1, -0.15165506e-1], [7.2, -0.14812994e-1], [7.3, -0.14468255e-1], [7.4, -0.14131340e-1], [7.5, -0.13802188e-1], [7.6, -0.13480766e-1], [7.7, -0.13167023e-1], [7.8, -0.12860860e-1], [7.9, -0.12562203e-1], [8.0, -0.12270906e-1], [8.1, -0.11986869e-1], [8.2, -0.11709977e-1], [8.3, -0.11440094e-1], [8.4, -0.11177068e-1], [8.5, -0.10920752e-1], [8.6, -0.10671030e-1], [8.7, -0.10427731e-1], [8.8, -0.10190686e-1], [8.9, -0.9959797e-2], [9.0, -0.9734839e-2], [9.1, -0.9515736e-2], [9.2, -0.9302291e-2], [9.3, -0.9094362e-2], [9.4, -0.8891836e-2], [9.5, -0.8694538e-2], [9.6, -0.8502346e-2], [9.7, -0.8315094e-2], [9.8, -0.8132637e-2], [9.9, -0.7954917e-2], [10.0, -0.7781747e-2]]

[[0, 0.], [.1, -0.192545973e-2], [.2, -0.57548536e-2], [.3, -0.93691571e-2], [.4, -0.116497299e-1], [.5, -0.122768958e-1], [.6, -0.114535757e-1], [.7, -0.96377097e-2], [.8, -0.73398894e-2], [.9, -0.50026258e-2], [1.0, -0.29489933e-2], [1.1, -0.13773796e-2], [1.2, -0.3802267e-3], [1.3, 0.288809e-4], [1.4, -0.1112403e-3], [1.5, -0.7312233e-3], [1.6, -0.1747389e-2], [1.7, -0.3072868e-2], [1.8, -0.4624615e-2], [1.9, -0.6327418e-2], [2.0, -0.8115810e-2], [2.1, -0.9934627e-2], [2.2, -0.11738712e-1], [2.3, -0.13492153e-1], [2.4, -0.15167275e-1], [2.5, -0.16743558e-1], [2.6, -0.18206567e-1], [2.7, -0.19546942e-1], [2.8, -0.20759491e-1], [2.9, -0.21842382e-1], [3.0, -0.22796451e-1], [3.1, -0.23624612e-1], [3.2, -0.24331323e-1], [3.3, -0.24922213e-1], [3.4, -0.25403690e-1], [3.5, -0.25782692e-1], [3.6, -0.26066441e-1], [3.7, -0.26262258e-1], [3.8, -0.26377439e-1], [3.9, -0.26419110e-1], [4.0, -0.26394196e-1], [4.1, -0.26309316e-1], [4.2, -0.26170744e-1], [4.3, -0.25984403e-1], [4.4, -0.25755853e-1], [4.5, -0.25490243e-1], [4.6, -0.25192364e-1], [4.7, -0.24866612e-1], [4.8, -0.24517040e-1], [4.9, -0.24147342e-1], [5.0, -0.23760880e-1], [5.1, -0.23360701e-1], [5.2, -0.22949566e-1], [5.3, -0.22529948e-1], [5.4, -0.22104070e-1], [5.5, -0.21673916e-1], [5.6, -0.21241260e-1], [5.7, -0.20807663e-1], [5.8, -0.20374513e-1], [5.9, -0.19943032e-1], [6.0, -0.19514256e-1], [6.1, -0.19089134e-1], [6.2, -0.18668453e-1], [6.3, -0.18252883e-1], [6.4, -0.17843021e-1], [6.5, -0.17439353e-1], [6.6, -0.17042293e-1], [6.7, -0.16652162e-1], [6.8, -0.16269229e-1], [6.9, -0.15893717e-1], [7.0, -0.15525760e-1], [7.1, -0.15165506e-1], [7.2, -0.14812994e-1], [7.3, -0.14468255e-1], [7.4, -0.14131340e-1], [7.5, -0.13802188e-1], [7.6, -0.13480766e-1], [7.7, -0.13167023e-1], [7.8, -0.12860860e-1], [7.9, -0.12562203e-1], [8.0, -0.12270906e-1], [8.1, -0.11986869e-1], [8.2, -0.11709977e-1], [8.3, -0.11440094e-1], [8.4, -0.11177068e-1], [8.5, -0.10920752e-1], [8.6, -0.10671030e-1], [8.7, -0.10427731e-1], [8.8, -0.10190686e-1], [8.9, -0.9959797e-2], [9.0, -0.9734839e-2], [9.1, -0.9515736e-2], [9.2, -0.9302291e-2], [9.3, -0.9094362e-2], [9.4, -0.8891836e-2], [9.5, -0.8694538e-2], [9.6, -0.8502346e-2], [9.7, -0.8315094e-2], [9.8, -0.8132637e-2], [9.9, -0.7954917e-2], [10.0, -0.7781747e-2]]

(1)

plots:-pointplot([[0, 0.], [.1, -0.192545973e-2], [.2, -0.57548536e-2], [.3, -0.93691571e-2], [.4, -0.116497299e-1], [.5, -0.122768958e-1], [.6, -0.114535757e-1], [.7, -0.96377097e-2], [.8, -0.73398894e-2], [.9, -0.50026258e-2], [1.0, -0.29489933e-2], [1.1, -0.13773796e-2], [1.2, -0.3802267e-3], [1.3, 0.288809e-4], [1.4, -0.1112403e-3], [1.5, -0.7312233e-3], [1.6, -0.1747389e-2], [1.7, -0.3072868e-2], [1.8, -0.4624615e-2], [1.9, -0.6327418e-2], [2.0, -0.8115810e-2], [2.1, -0.9934627e-2], [2.2, -0.11738712e-1], [2.3, -0.13492153e-1], [2.4, -0.15167275e-1], [2.5, -0.16743558e-1], [2.6, -0.18206567e-1], [2.7, -0.19546942e-1], [2.8, -0.20759491e-1], [2.9, -0.21842382e-1], [3.0, -0.22796451e-1], [3.1, -0.23624612e-1], [3.2, -0.24331323e-1], [3.3, -0.24922213e-1], [3.4, -0.25403690e-1], [3.5, -0.25782692e-1], [3.6, -0.26066441e-1], [3.7, -0.26262258e-1], [3.8, -0.26377439e-1], [3.9, -0.26419110e-1], [4.0, -0.26394196e-1], [4.1, -0.26309316e-1], [4.2, -0.26170744e-1], [4.3, -0.25984403e-1], [4.4, -0.25755853e-1], [4.5, -0.25490243e-1], [4.6, -0.25192364e-1], [4.7, -0.24866612e-1], [4.8, -0.24517040e-1], [4.9, -0.24147342e-1], [5.0, -0.23760880e-1], [5.1, -0.23360701e-1], [5.2, -0.22949566e-1], [5.3, -0.22529948e-1], [5.4, -0.22104070e-1], [5.5, -0.21673916e-1], [5.6, -0.21241260e-1], [5.7, -0.20807663e-1], [5.8, -0.20374513e-1], [5.9, -0.19943032e-1], [6.0, -0.19514256e-1], [6.1, -0.19089134e-1], [6.2, -0.18668453e-1], [6.3, -0.18252883e-1], [6.4, -0.17843021e-1], [6.5, -0.17439353e-1], [6.6, -0.17042293e-1], [6.7, -0.16652162e-1], [6.8, -0.16269229e-1], [6.9, -0.15893717e-1], [7.0, -0.15525760e-1], [7.1, -0.15165506e-1], [7.2, -0.14812994e-1], [7.3, -0.14468255e-1], [7.4, -0.14131340e-1], [7.5, -0.13802188e-1], [7.6, -0.13480766e-1], [7.7, -0.13167023e-1], [7.8, -0.12860860e-1], [7.9, -0.12562203e-1], [8.0, -0.12270906e-1], [8.1, -0.11986869e-1], [8.2, -0.11709977e-1], [8.3, -0.11440094e-1], [8.4, -0.11177068e-1], [8.5, -0.10920752e-1], [8.6, -0.10671030e-1], [8.7, -0.10427731e-1], [8.8, -0.10190686e-1], [8.9, -0.9959797e-2], [9.0, -0.9734839e-2], [9.1, -0.9515736e-2], [9.2, -0.9302291e-2], [9.3, -0.9094362e-2], [9.4, -0.8891836e-2], [9.5, -0.8694538e-2], [9.6, -0.8502346e-2], [9.7, -0.8315094e-2], [9.8, -0.8132637e-2], [9.9, -0.7954917e-2], [10.0, -0.7781747e-2]])

 

CurveFitting:-Interactive(data_set)

NULL

Download regression_dataset.mw

I do not understand the following typesetting example from this helpage.

with(Typesetting)

interface(typesetting = extended)

Typeset(BesselJ(v, x))

BesselJ(v, x)

(1)

NULL

Same output without Typeset

BesselJ(v, x)

BesselJ(v, x)

(2)

NULL

Download Typeset.mw

Why the Typeset call when the output does not change. Is the helppage maybe broken? It says Examples but lists only one.

If MapleSoft read this: Some more typesetting examples would be helpfull.

I recently read something in another forum about solving a simple ordinary differential equation as an initial value problem (file attached). An unexpected solution behavior was interpreted there as a weakness of the software. However, upon closer inspection, the cause is different, and as a software novice, I cannot determine it myself.

Therefore, my question is:

Is there a way, using Maple, to check the Lipschitz condition in the neighborhood of the initial value before starting the solution of an explicit first-order system of differential equations as an initial value problem?

DGL_test.mw

i try to find the parameter in this equation but some issues show up which i am not sure i can fix that or not? there is any way for finding thus parameters?

test-F-p.mw

1 2 3 4 5 6 7 Last Page 2 of 2235