Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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

I have two random variables:  x and y.  I want to multiply them and get the resulting Probability Density Function, z.  If you look below, Example 1 works as expected.  When I try Example 2, however, I get disappointing results.

Clearly, Example 2 involves nonzero lower boundaries, which is messing me up.  Does anyone have any suggestions for Example 2?

Example 1

with(Statistics)

x := RandomVariable(Uniform(0, 1))

_R

(1)

y := RandomVariable(Uniform(0, 2))

_R0

(2)

z = PDF(x*y, t)

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

(3)

 

 

Example 2

x := RandomVariable(Uniform(1, 2))

_R1

(4)

y := RandomVariable(Uniform(2, 3))

_R2

(5)

z := PDF(x*y, t)

int(piecewise(_t < 1, 0, _t < 2, 1, 2 <= _t, 0)*piecewise(t/_t < 2, 0, t/_t < 3, 1, 0)/abs(_t), _t = -infinity .. infinity)

(6)
 

NULL

Download MultiplyPDFFunctions.mw

Hi,
I am experimenting with Threads:-Task:-Continue in Maple 2020.2 and sometimes it returns different results depending on N, or, how fine the mesh is. I have modified procedures cont and task in a Maple example shown in a worksheet. I can compare the result from Threads with one I can obtain another way and which surely is correct. The result from Threads depends on N: sometimes it is correct, sometimes it is not. The wrong result is returned only when the Threads:-Task:-Continue loop is executed, of course.

Has anyone spotted that problem? Is there a way to trace what actually is being done in each leaf? Does this problem appear in later versions of Maple?

I would appreciate some feedback.

Thanks in advance,

Rafal Anlamowicz
rablamowicz@gmail.com

Hello there,

There are two ways that I know of to define functions in maple:

f(x) :=      (1)

and 

f := x->     (2)

The issue that I'm noticing is that if I only use one method, everything works as I expect it to, but if I use both methods in the same document on a function with the same name eg. (doing f :=x->2x and then later in the document doing f(x) := 5x), (2) seems to completely overrule anything (1) says, even if (1) is used after. 
Can anyone explain why this is? 

I’m having trouble solving this. Any suggestions would be helpful.

NULL

restart

``

with(Optimization); with(plots); with(Student[VectorCalculus]); with(LinearAlgebra)

``

ineq := simplify((Cr*rho0*t*(Cr*alpha*b-alpha-1)*d^2+((alpha*((-g*i2+a)*Cr+2*Crm+2*c+3*t-2*Pr)*Cr*b+((g*i2-a)*Cr-2*Crm-2*c-2*t+2*Pr)*alpha+(g*i2-a)*Cr-2*t)*rho0+(2*(Cr*b-1))*(sigma*t+Cn-Pr+delta-1))*d+(alpha*((-g*i2+a)*Cr+2*Crm+2*c+2*t-2*Pr)*b+2*g*i2-2*a)*rho0+2*b*(sigma*t+Cn-Pr+delta-1))^2 > (((alpha*Cr*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+((g*i2-a)*Cr-2*Crm-2*c+2*Pr)*alpha-(-g*i2+a)*Cr)*rho0+(2*(Cr*b-1))*(delta+Cn-Pr-1))*d+(alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+2*g*i2-2*a)*rho0+2*b*(delta+Cn-Pr-1))^2)

(((alpha*Cr*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+((g*i2-a)*Cr-2*Crm-2*c+2*Pr)*alpha-(-g*i2+a)*Cr)*rho0+2*(Cr*b-1)*(delta+Cn-Pr-1))*d+(alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+2*g*i2-2*a)*rho0+2*b*(delta+Cn-Pr-1))^2 < (Cr*rho0*t*(Cr*alpha*b-alpha-1)*d^2+((alpha*((-g*i2+a)*Cr+2*Crm+2*c+3*t-2*Pr)*Cr*b+((g*i2-a)*Cr-2*Crm-2*c-2*t+2*Pr)*alpha+(g*i2-a)*Cr-2*t)*rho0+2*(Cr*b-1)*(sigma*t+Cn-Pr+delta-1))*d+(alpha*((-g*i2+a)*Cr+2*Crm+2*c+2*t-2*Pr)*b+2*g*i2-2*a)*rho0+2*b*(sigma*t+Cn-Pr+delta-1))^2

(1)

  

``extra := indets(ineq,And(name,Not(constant))) >~ 0;

{0 < Cn, 0 < Cr, 0 < Crm, 0 < Pr, 0 < a, 0 < alpha, 0 < b, 0 < c, 0 < d, 0 < delta, 0 < g, 0 < i2, 0 < rho0, 0 < sigma, 0 < t}

(2)

 

(solve({ineq}, t) assuming extra[]);

 

``

Download Q_solve.mw

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