Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

What is the opinion here on the following. If given   A which is linear in x, but not simplified. now type(A,x) gives false.  But type(simplify(A),x) gives true.

Does this mean it is the user responsibility to simplify the expression first before calling type on it? 

Why does not type command do this internally to see if it is linear before deciding? What is the reason for this design choice?

interface(version);

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

restart;

 

A:=(x+y+1)^2-(x+y-1)^2;

(x+y+1)^2-(x+y-1)^2

simplify(A);

4*x+4*y

type(A,linear(y))

false

type(simplify(A),linear(y))

true

type(A,linear(x))

false

type(simplify(A),linear(x))

true

 

 

Download why_simplify_is_needed_feb_9_2026.mw

Hi,

I’m trying to transpose an existing animation that connects the unit circle to the graphs of cos⁡(θ)\ and sin⁡(θ)\ into a complex-numbers visualization, so that students can clearly see the link between

z=eiθ=cos⁡θ+isin⁡θ,arg⁡(z)=θ,∣z∣=1

and the corresponding real/imaginary components.

Goal: a dynamic view where a point z(θ) moves on the unit circle in the complex plane while (simultaneously)

  • the projections show ℜ(z)=cos⁡θ\  and ℑ(z)=sin⁡θ,

  •  the graphs of cos⁡θ and sin⁡θ are traced against θ\,

  • and/or the angle θ\ and argument are displayed in a clean, didactic way.

To better illustrate my objective, here is the link to the target animation I would like to transpose: 

Illustration

Thank you in advance for your insights and feedback.

Animation_Question.mw

I have created three random variables:  r, theta and phi.  That went as I expected.  I then did some math with these random variable.  I calculated the following:  sin(phi), sin(theta), cos(phi) and cos(theta).

When I viewed the PDFs of these above four, I get what I expected with the exception of sin(theta).  I got an error message telling me that I provided three arguments when Maple expected only two arguments.  I am confused as to why this happened.

I wonder if I broke any rules when I named these variables, but I don't know...any suggestions? My work is attached.

with(Statistics)

theta := RandomVariable(Uniform(0, 2*Pi))

_R

(1)

phi := arccos(-1+2*RandomVariable(Uniform(0, 1)))

arccos(-1+2*_R0)

(2)

r := RandomVariable(Uniform(0, 1))^(1/3)

_R1^(1/3)

(3)

SinPhi := sin(phi)

2*(-_R0^2+_R0)^(1/2)

(4)

PDF(SinPhi, t)

piecewise(t <= 0, 0, t < (1/2)*4^(1/2), t/(-t^2+1)^(1/2), (1/2)*4^(1/2) <= t, 0)

(5)

SinTheta := sin(theta)

sin(_R)

(6)

PDF(SinTheta, t)

Error, (in Statistics:-PDF) invalid input: type expects 2 arguments, but received 3

 

CosPhi := cos(phi)

-1+2*_R0

(7)

PDF(CosPhi, t)

(1/2)*piecewise((1/2)*t < -1/2, 0, (1/2)*t < 1/2, 1, 0)

(8)

CosTheta := cos(theta)

cos(_R)

(9)

PDF(CosTheta, t)

piecewise(t <= -1, 0, t < 1, 1/(Pi*(-t^2+1)^(1/2)), 1 <= t, 0)

(10)
 

NULL

Download Basics.mw

Could someone suggest a way to help dsolve be able to obtain this solution to this complicated first order ode? In V 2025.2 it is not able to solve it as is

interface(version);

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

ode:=-x*sqrt((1 - x)/(x + 1))*(x + 1)*arcsech(x)*diff(y(x), x)*exp(y(x)/arcsech(x) + exp(y(x)/arcsech(x))) - y(x)*exp(y(x)/arcsech(x) + exp(y(x)/arcsech(x))) + 2*x*sqrt((1 - x)/(x + 1))*(x + 1)*arcsech(x)^2 = 0;

-x*((1-x)/(x+1))^(1/2)*(x+1)*arcsech(x)*(diff(y(x), x))*exp(y(x)/arcsech(x)+exp(y(x)/arcsech(x)))-y(x)*exp(y(x)/arcsech(x)+exp(y(x)/arcsech(x)))+2*x*((1-x)/(x+1))^(1/2)*(x+1)*arcsech(x)^2 = 0

sol:=dsolve(ode);

expected_sol:=y(x)=arcsech(x)*ln(ln(2*x+_C1));

y(x) = arcsech(x)*ln(ln(2*x+_C1))

odetest(expected_sol,ode) assuming x>0

0

 

 

Download ode_solution_feb_6_2026.mw

Instead of

if not(type(expr,atomic))...

I would like to use something like that for better readabilty

if type(expr,composite)...

where "composite" is a placeholder for beeing not atomic.

Does anyone have any exoerience playing with this topic?

I have the functions dx(t), dt(t), and dz(t).  They are all the same function.  I constructed the dz(t) function as a piecewise function, then copied it to dx(t) and dy(t).  The area under the function curves sum to one as I would expect.

How can I convert these functions into a PDF form so that I can perform mathematical operations on the PDFs, such as add the PDFs to create another PDF?

SphereFinal.mw

Noticed something strange.  When I type

restart;
F:=x-> (x^4+3*x^3-3*x^2-2*x-24)/(x^4-4*x^3-13*x^2+62*x-56);
u:=x->piecewise(x=-4,limit(F(x),x=-4),true,F(x));
u(-4);

Gives Error, (in F) numeric exception: division by zero which means it did not hit the first condition x=-4

But when I write this

restart;
F:=x-> (x^4+3*x^3-3*x^2-2*x-24)/(x^4-4*x^3-13*x^2+62*x-56);
A:=limit(F(x),x=-4);
u:=x->piecewise(x=-4,A,true,F(x));
u(-4)

Now it gives expected result 15/47

To avoid defining many variables, like A above, I'd like to just write the  limit inside.

Is there a way to make Maple accept the limit inside piecewise as written above? i.e. have it evaluate to 15/47?

Help says "The piecewise function evaluates its arguments on an as-needed basis."

Not sure what this means.

I tried adding eval, as in 

u:=x->piecewise(x=-4,eval(limit(F(x),x=-4)),true,F(x));

But this did nothing

Maple 2025.2

 

Should not the following two commands produce same solution?

f:=x->(x^2+3*x-4)*cos(x^2+3*x-5);
PDEtools:-Solve({f(x)=0,0<x,x<2},x);
solve({f(x)=0,0<x,x<2},x);

This is what the result looks like

Why Solve gives one solution and solve gives 2? Is this expected or a bug?

btw, the solution from solve is also not complete. There are 5 roots not 2.

Student:-Calculus1:-Roots(f(x),x=0..2);

 

Many problems in mathematics are easy to define and conceptualize, but take a bit of deeper thinking to actually solve. Check out the Olympiad-style question (from this link) below:

 

Former Maplesoft co-op student Callum Laverance decided to make a document in Maple Learn to de-bunk this innocent-looking problem and used the powerful tools within Maple Learn to show step-by-step how to think of this problem. The first step, I recommend, would be to play around with possible values of a and b for inspiration. See how I did this below:


Based on the snippet above, we might guess that a = 0.5 and b = 1.9. The next step is to think of some equations that may be useful to help us actually solve for these values. Since the square has a side length of 4, we know its area must be 42 = 16. Therefore, the Yellow, Green and Red areas must add exactly to 16. That is,


With a bit of calculus and Maple Learn's context panel, we can integrate the function f(x) = ax2 from x = -2 to x = 2 and set it equal to this value of 8/3. This allows us to solve for the value of a.


We see that a = 1/2. Since the area of the Red section must be three times that of the Yellow (which we determined above to be 8/3), we get Red = (8/3)*3 = 8.

The last step is to find the value of b. In the figure below, we know that the line y = 4 and the curve y = bx2 intersect when bx2 = 4 (i.e. when x = ± 2/sqrt(b)).

 

Since we know the area of the red section is 8 square units, that must be the difference between the entire area underneath the horiztonal line at y = 4 and the curve y = bx2 on the interval [-2/sqrt(b), 2/sqrt(b)]. We can then write the area of the Red section as an integral in terms of b, then solve for the value of b, since we know the Red area is equal to 8.

Voila! Setting a = 1/2 and b = 16/9 ≈ 1.8 guarantees that the ratio of Yellow to Green to Red area within the square is 1:2:3, respectively. Note this is quite close to our original guess of a = 0.5 and b = 1.9. With a bit of algebra and solving a couple of integrals, we were able to solve a mathematics Olympiad problem!

Just for my understanding:

I have read ?procedure and noticed that the term variable is used as a synonym for the term name.

Otherwise Maple uses the term variable more in a mathematical sense and the term name to refer to an expression.

Is this to make the help page easier to read or to use jargon familiar from other programming languages?

This use of vocabulary must be intentional. However I do not fully understand this subtle difference.

I would like to express the decision variables Pn_W,w_W,Ce_W,i1_W,Pn_D,w_D,Ce_D...other variables...​ in a compact form. Since their analytical expressions are lengthy, I want to identify terms and define appropriate composite parameters to simplify their representation.

Q_shorten_1.mw

For example ,  Suppose the original expression is: q := ((Cn - a)^2 + (P - d - b)*x^2 + Cn - a - b)/y(Cn - a)^2

Lets say Cn - a =X , P - d - b =S

Then the expression can be rewritten as: q = (X^2 + S*x^2 + X - b)/yX^2

Hello everyone
Dear experienced and expert friends
As a beginner, I would like to ask if any of my friends can guide me.
The following commands are related to Mathematica:

plots = Table[n = sValues[[i]];
   ParametricPlot[{1 - 2/n - 1.5/n^2 + (1.33 - 2/n) \[Gamma] - 
      0.0740741 (15 + 4*n) \[Gamma]^2, 
     12/n^2 + (16 \[Gamma])/n + (80 \[Gamma]^2)/9}, {\[Gamma], 0, 
     0.06}, PlotStyle -> colors[[i]], 
    PlotRange -> {{-10, 10}, {-10, 10}}], {i, Length[sValues]}];

Show[plots, Frame -> True, FrameLabel -> {"\!\(\*
StyleBox[SubscriptBox[\"n\", \"s\"],\nFontSize->16,\n\
FontColor->GrayLevel[0]]\)", "\!\(\*
StyleBox[\"r\",\nFontSize->16,\nFontColor->GrayLevel[0]]\)"}, 
 GridLinesStyle -> Black, PlotRange -> {{0.94, 1}, {0, 0.06}}, 
 PlotLegends -> 
  Placed[LineLegend[sValues, LegendLabel -> "s,w"], {0.5, 0.5}], 
 ImageSize -> 400]

I want to rewrite this process in Maple for my own functions.
I would be grateful if it is possible or if these commands are rewritten in a complete and executable form in Maple for me so that I can understand the working pattern. Or at least an equivalent command that can do this in Maple is introduced
Thank you all

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