Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Given first order nonlinear ode which is hard to solve using standard methods, the smart dsolve sometimes uses a method where it linearizes the first order ode to a linear second order ode and solves that.

Then with that solution to the linear second order ode, it is able to find the solution of the first order ode (need to resolve the constants of integration to merge them into one, but this part is easy to do).

My question is, how and what method it uses to "linearizes by differentation"? I could not find this in any textbook I have, and not able to see how it does.

Here is an example where it uses this method to solving this first order ode

restart;

Typesetting:-Unsuppress('all'); #always do this.
Typesetting:-Settings(prime=x,'typesetprime'=true); #this says to use y'(x) instead of dy/dx    
Typesetting:-Suppress(y(x)); # this says to use y' and not y'(x)

ode:=diff(y(x),x) = (-y(x)^2+4*a*x)^2/y(x); 
infolevel[dsolve]:=5;
dsolve(ode,y(x), singsol=all);

Tracing says 

So it says, if I understand, that it differentiated the original given first order ode and then linearized the resulting second order ode to the above, which is    y''=-64 a^2 x^2 y - 16 a x y' which is certainly linear second order ode and now can be solved using kovacic algorithm. Now the solution to the first order ode can be obtained.

But when differentiating the first order ode, this is the result

expand(diff(ode,x))

So the question is, did Maple mean it "linearized" the above to y''=-64 a^2 x^2 y - 16 a x y' 

If so, then how? Did it use Taylor series? but if so, where it expanded about? Or did it use some other method?  One thing I noticed is that by multiplying the RHS above by y^2 it becomes

And "removing" the nonlinear terms (say expansion is around y=0, so higher order y terms are very small and can be removed) the RHS above becomes

    y'' y^2 = -16 y' a^2 x^2 + 32 a^2 x y

Which is close to Maple shows, but 32 instead of 64, and what about the y^2 on the left side?  Is this method even valid mathematically to do? Since solution that result will be correct only near y=0?

So far, trying to step in the debugger to find how, I was not able to find where it does that but will keep trying.

Any idea what Maple means by linearization to 2nd order and how it does it?

ps. only case I know about, where nonlinear first order ode can be transformed to linear second order ode is the Riccati ode using transformation y=u'/u. But this  first order ode is not Riccati.

I just installed Maple 2023 on a MacPro running macOS Sequoia 15.7.2. Update to latest .version and activation worked without a hitch.

When I try to run it from the Finder it immediately puts up a dialog saying something like "Java not found". There is a webpage by Maplesoft addressing this, but it is completely uninformative and unhelpful.

I can get Maple to run using the cli (in Terminal) opening the Maple 2023 .app file, at which point Maple (running the standard GUI) works just as one would expect. So it is not a crisis but I'd like to be able to open it through the Finder as well. The Maple .app folder appears to have all the Java stuff in it, and clearly it is somewhere.

Anyone seen and solved this before?

Thanks,

Mac Dude

To enter prime notation in Math-2D I currently do

k^2 + `k'`^2 = 1;
                           2     2    
                          k  + k'  = 1

To enter a back tick (left single quote symbol) this requires with my keyboard shift+(key for `) followed by hitting the space bar.

The output looks nice

However to enter k' in a new input line, dragging and dropping k' (which normally works for other expressions) from a former output does not work. The result is

Instead of changing default typesetting rules, I made k' atomic and dragged it to the favourite palette. This is an acceptable solution to avoid keyboard acrobatics. The only drawback is that the favourite palette gets crowded after a while.

I was wondering whether there are other ways to enter prime notation in a less complicated way as I have described above?

This is a question on semantics I suppose.

Maple dsolve returns a solution with a limit in it, because the limit do not exist or Maple could not find the limit. Which is fine.

Then why does simplify() applied to the solution returns undefined?  Now it appears that Maple solution is y(x)=undefined, which does not make much sense.

Should it not have left the solution with the limit in place as is? i.e. since dsolve could not find limit, how did simplify managed to replace the limit by undefined?

Is this considered an expected behavior by simplify?

Firewall changed its mind again today and will not let me upload worksheet. Here is code

ode:=4*x*diff(y(x),x$2)+2*diff(y(x),x)+y(x)=(6+x)/x^2;
IC:=y(infinity)=0;
sol:=dsolve([ode,IC],y(x)); #OK, maple can't find limit. No problem
simplify(sol)

I have to ask my school teacher on this when school starts. But is it OK to have infinity in the ode solution itself?

Maple 2025.2 gives

ode:=diff(y(x),x$2)-2*diff(y(x),x)+y(x)=4*exp(-x);
IC:=y(infinity)=0;
sol:=dsolve([ode,IC])

And according to odetest, this does not verify the ode nor the IC

odetest(sol,[ode,IC])

Just asking what others think of this solution and if it should be consider a bug or not?

Maple 2025.2 on windows 10

in here i want to apply this method for finding my parameter but is a special kind of substituion and i don't know how hundle this kind  and find the parameters i did some part but i didn't reach the target 

f-p-second.mw

Solving this ode, Maple says 

But notice, the xi and eta tangent vectors order is reversed. Maple says pattern is [0,F*G], but shows [F*G,0].

Also, when later using DEtools:-symgen with HINT option, it does not return the above result. Tried both patterns with 0 on left and 0 on right. In both cases symgen does not return what shows above. 

Why is that? Am I doing something wrong? Notice also it says   "way=HINT"  but I am not using way option. Only HINT option, Why is it saying way=HINT? it seems argument passing I  am using is wrong, but do not see why it could be wrong.  This is what help says

Worksheet below

interface(version);

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

restart;

ode:=diff(y(x),x)*cos(y(x))-cos(x)*sin(y(x))^2-sin(y(x)) = 0;
infolevel[dsolve]:=5;
infolevel[symgen]:=5;

(diff(y(x), x))*cos(y(x))-cos(x)*sin(y(x))^2-sin(y(x)) = 0

5

5

dsolve(ode);

Methods for first order ODEs:

--- Trying classification methods ---

trying a quadrature

trying 1st order linear

trying Bernoulli

trying separable

trying inverse linear

trying homogeneous types:

trying Chini

differential order: 1; looking for linear symmetries

trying exact

Looking for potential symmetries

trying inverse_Riccati

trying an equivalence to an Abel ODE

differential order: 1; trying a linearization to 2nd order

--- trying a change of variables {x -> y(x), y(x) -> x}

differential order: 1; trying a linearization to 2nd order

trying 1st order ODE linearizable_by_differentiation

--- Trying Lie symmetry methods, 1st order ---

 -> Computing symmetries using: way = 3

 -> Computing symmetries using: way = 4

 -> Computing symmetries using: way = 5

trying symmetry patterns for 1st order ODEs

 -> Computing symmetries using: way = patterns

-> trying a symmetry pattern of the form [F(x)*G(y), 0]

-> trying a symmetry pattern of the form [0, F(x)*G(y)]

-> The symmetry found is [0 exp(-x)*(2*sin(y)^2+cos(y)^2-1)/cos(y)]

<- symmetry pattern of the form [0, F(x)*G(y)] successful

[exp(-x)*(2*sin(y)^2+cos(y)^2-1)/cos(y), 0]

 <- successful computation of symmetries.

y(x) = arctan(-2*exp(x)/(exp(x)*cos(x)+exp(x)*sin(x)+2*c__1), ((2*cos(x)*sin(x)*(exp(x))^2+4*c__1*sin(x)*exp(x)+4*cos(x)*c__1*exp(x)+4*c__1^2+(exp(x))^2)*(2*cos(x)*sin(x)*(exp(x))^2+4*c__1*sin(x)*exp(x)+4*cos(x)*c__1*exp(x)-3*(exp(x))^2+4*c__1^2))^(1/2)/(2*cos(x)*sin(x)*(exp(x))^2+4*c__1*sin(x)*exp(x)+4*cos(x)*c__1*exp(x)+4*c__1^2+(exp(x))^2)), y(x) = arctan(-2*exp(x)/(exp(x)*cos(x)+exp(x)*sin(x)+2*c__1), -((2*cos(x)*sin(x)*(exp(x))^2+4*c__1*sin(x)*exp(x)+4*cos(x)*c__1*exp(x)+4*c__1^2+(exp(x))^2)*(2*cos(x)*sin(x)*(exp(x))^2+4*c__1*sin(x)*exp(x)+4*cos(x)*c__1*exp(x)-3*(exp(x))^2+4*c__1^2))^(1/2)/(2*cos(x)*sin(x)*(exp(x))^2+4*c__1*sin(x)*exp(x)+4*cos(x)*c__1*exp(x)+4*c__1^2+(exp(x))^2))

infolevel[dsolve]:=0;

0

DEtools:-symgen(ode,y(x),HINT = [ 0,F(x)*G(y)]); #why this does not return the symmetries found by dsolve above?

 -> Computing symmetries using: way = HINT

DEtools:-symgen(ode,y(x),HINT = [ F(x)*G(y),0]); #why this does not return the symmetries found by dsolve above?

 -> Computing symmetries using: way = HINT

DEtools:-symgen(ode)

 -> Computing symmetries using: way = 2

 -> Computing symmetries using: way = 3

 -> Computing symmetries using: way = 4

 -> Computing symmetries using: way = abaco1

[0, exp(-x)*(-1+cos(2*y))/cos(y)]

 <- successful computation of symmetries.

[_xi = 0, _eta = exp(-x)*(-1+cos(2*y))/cos(y)]

 

 

Download symgen_confusion_jan_9_2026.mw

Has anybody seen the unit palette beeing empty? 

This is new to me. I normally use the unit entry in the favourites but this time wanted to try Maple presets.

I have written about unit problems before. I thought an update would solve the problems, but no.

I have a very simple example here where the unit can't be changed:

In the first example I am using capital M for mass; now I can change unit on density.

I know this is a "silly" question but just recently my Tool Ribbon disapears or "retracts" into thin air and I have to first click on it to get it to "deploy" downward and then when I click on it to "Insert, View, Edit..." it then retracts and is gone once I do the click.  I am forced to do 2 clicks when before I had only to do one click.  This is not efficient.  I like the Ribbon concept for Maple 2025 but this is an irritating annoyance.  If some one knowlegeable could please take a few seconds to reply to this, I would greatly appreciate it.  BTW, this just started.  In an other machine I have where Maple 2025 is located, it doesn't do this.   I am sure it is a simple setting somewhere.  I just can't find that setting.  Thank you in advance 

Hello,

The title is misleading.

I can't remember how to enter a vector ( I mean the symbol 'arrow' ) for a vector , say u.

I have a normal French/France kb , so please no Klingon reply :)

So CTRL+SHIFT+ALT+F6 is no answer.

Thank you,

Jean-Michel

I am not desperatly seeking Susan but the code of the DoFit procedure (for what this early-year joke is worth)

showstat(Statistics:-LinearFit)  reveals LinearFit uses the procedure Statistics:-Regression:-LinearFit (lines 4 & 9).

Next
kernelopts(opaquemodules=false):
showstat(Statistics:-Regression:-LinearFit):

indicates the Maple procedure which really does the LinearFit has name DoFit (lines 6 & 16).

I spent some time using the Library assistant to try and find this procedure, in vain.
Where can I get the source of DoFit?

Thanks in advance.

almost i did all the case but some case i determined in red color are not satisfy what is problem of them and how i can apply the case 47-52, beside this i changed the ode in eq(15) i didn't write rho parameter  is make any problem?

ode-17.mw

Hello Ladies and Genlemen,

What is the command to display a list of *all* the packages in Maple ?

How do you insert an output for exemple (2.1.1) in a worksheet?

CTRL+K is inactive for me...it just adds a CRLF.

Thank you very much and kind regards,

Jean-Michel

The inscribed square problem, also known as the Toeplitz conjecture, is an unsolved quastion in geometry: Does every plane simple closed curve (Jordan curve) contain all four vertices of some square? This is true if the curve is convex or piecewise smooth and in other special cases. The problem was proposed by Otto Toeplitz in 1911. For detailes see  https://en.wikipedia.org/wiki/Inscribed_square_problem

The Inscribed_Square procedure finds numerically one or more solutions for a curve defined by parametric equations of its boundary or by the equation F(x,y)=0. The required parameter of procedure  L  is the list of equations of the boundary links or the equation  F(x,y)=0 . Optional parameters:  N  and  R . By default  N='onesolution' (the procedure finds one solution), if  N  is any symbol (for example  N='s'), then more solutions.  R  is the range for the length of the side of the square (by defalt  R=0.1..100 ).

The second procedure  Pic  visualizes the results obtained.

The codes of the procedures:

restart;
Inscribed_Square:=proc(L::{list(list),`=`},N::symbol:='onesolution',R::range:=0.1..100)
local D, n, c, L1, L2, L3, f, L0, i, j, k, m, A, B, C, P, M, eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, sol, Sol;
uses LinearAlgebra;
if L::list then
L0:=map(p->`if`(type(p,listlist),[[p[1,1]+t*(p[2]-p[1])[1],p[1,2]+t*(p[2]-p[1])[2]],t=0..1],p), L);
c:=0;
n:=nops(L);
for i from 1 to n do
for j from i to n do
for k from j to n do
for m from k to n do
A:=convert(subs(t=t1,L0[i,1]),Vector): 
B:=convert(subs(t=t2,L0[j,1]),Vector):
C:=convert(subs(t=t3,L0[k,1]),Vector): 
D:=convert(subs(t=t4,L0[m,1]),Vector):
M:=<0,-1;1,0>;
eq1:=eval(C[1])=eval((B+M.(B-A))[1]);
eq2:=eval(C[2])=eval((B+M.(B-A))[2]);
eq3:=eval(D[1])=eval((C+M.(C-B))[1]);
eq4:=eval(D[2])=eval((C+M.(C-B))[2]);
eq5:=eval(DotProduct(B-A,B-A, conjugate=false))=d^2;
sol:=fsolve([eq1,eq2,eq3,eq4,eq5],{t1=op([2,2,1],L0[i])..op([2,2,2],L0[i]),t2=op([2,2,1],L0[j])..op([2,2,2],L0[j]),t3=op([2,2,1],L0[k])..op([2,2,2],L0[k]),t4=op([2,2,1],L0[m])..op([2,2,2],L0[m]),d=R});
if type(sol,set(`=`)) then if N='onesolution' then return convert~(eval([A,B,C,D],sol),list) else c:=c+1; Sol[c]:=convert~(eval([A,B,C,D],sol),list) fi;
 fi; 
od: od: od: od:
Sol:=fnormal(convert(Sol,list),7);
print(Sol);
ListTools:-Categorize((X,Y)->`and`(seq(is(convert(X,set)[i]=convert(Y,set)[i]),i=1..4)) , Sol);
return map(t->t[1],[%]);
else
A,B,C,D:=<x1,y1>,<x2,y2>,<x3,y3>,<x4,y4>:
M:=<0,-1;1,0>:
eq1:=eval(C[1])=eval((B+M.(B-A))[1]):
eq2:=eval(C[2])=eval((B+M.(B-A))[2]):
eq3:=eval(D[1])=eval((C+M.(C-B))[1]):
eq4:=eval(D[2])=eval((C+M.(C-B))[2]):
eq5:=eval(LinearAlgebra:-DotProduct((B-A,B-A), conjugate=false))=d^2:
eq6:=eval(L,[x=x1,y=y1]):
eq7:=eval(L,[x=x2,y=y2]):
eq8:=eval(L,[x=x3,y=y3]):
eq9:=eval(L,[x=x4,y=y4]):
sol:=fsolve({eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9},{seq([x||i=-2..2,y||i=-2..2][],i=1..4),d=R});
eval([[x1,y1],[x2,y2],[x3,y3],[x4,y4]], sol):
fi;
end proc:

Pic:=proc(L,Sol,R::range:=-20..20)
local P1, P2, P3, T;
uses plots, plottools;
P1:=`if`(L::list,seq(`if`(type(s,listlist),line(s[],color=blue, thickness=2),plot([s[1][],s[2]],color=blue, thickness=2)),s=L), implicitplot(L, x=R,y=R, color=blue, thickness=2, gridrefine=3));
P2:=polygon(Sol,color=yellow,thickness=0);
P3:=curve([Sol[],Sol[1]],color=red,thickness=3):
T:=textplot([[Sol[1][],"A"],[Sol[2][],"B"],[Sol[3][],"C"],[Sol[4][],"D"]], font=[times,18], align=[left,above]);
display(P1,P2,P3,T, scaling=constrained, size=[800,500], axes=none);
end proc:

Examples of use:

The curve consists of a semicircle, a segment and a semi-ellipse (find 1 solution):

L:=[[[cos(t),sin(t)],t=0..Pi],[[t,0],t=-1..0],[[0.5+0.5*cos(t),0.8*sin(t)],t=Pi..2*Pi]]:
Sol:=Inscribed_Square(L);
Pic(L,Sol);

       


The procedure finds 6 solutions for a non-convex pentagon:

 L:=[[[0,0],[9,0]],[[9,0],[8,5]],[[8,5],[5,3]],[[5,3],[0,4]],[[0,4],[0,0]]]:
Sol:=Inscribed_Square(L,'s');
plots:-display(Matrix(3,2,[seq(Pic(L,Sol[i]),i=1..6)]),size=[300,200]);

             


For an implicitly defined curve, only one solution can be found:

L:=abs(x)+2*abs(y)-sin((2*x-y))-cos(x+y)^2=3:
Sol:=Inscribed_Square(L);
Pic(L,Sol);

               
See more examples in the attached file.

Inscribed_Square.mw

 

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