nm

11993 Reputation

20 Badges

13 years, 191 days

MaplePrimes Activity


These are questions asked by nm

Would this be considered a bug or expected?

Everytime I see internal error in red, for me, it tells me it is a bug. But wanted to check first what others think.

restart;

interface(version);

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

ode:=x^2*diff(y(x), x$2) + (cos(x)-1)*diff(y(x), x) + exp(x)*y(x) = 0;
sol:=dsolve(ode,y(x),type='series',x=0):
sol1:=eval(%, _C2=0):
sol2:=eval(%%, _C1=0):

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

Y:= unapply(rhs(sol1), x):
eval(lhs(ode), y=Y):
MultiSeries:-asympt(%, x);

Error, (in simpl/min) non-real argument to max/min: -13/2+1/2*I*3^(1/2)

Y:= unapply(rhs(sol2), x):
eval(lhs(ode), y=Y):
MultiSeries:-asympt(%, x);

Error, (in simpl/min) non-real argument to max/min: -13/2-1/2*I*3^(1/2)

 

 

Download asympt_none_real_argument_jan_17_2026.mw

WHen plotting f(x) and g(x) on same plot, and putting legend at bottom (default), the legends show horizontally. i.e. f(x) then g(x) on same line.

I'd like the legend to be stacked vertically, just like when the legend on the right or left, But keep it at bottom. But want to do all this in code. Not using any UI context tools or mouse.

Here is an example

restart;

f:=x->x^3-x^2+1;
g:=x->6-2*x-x^2;
the_legend:=[typeset("f(x) = ",f(x)),typeset("g(x) = ",g(x))]:
plots[setoptions](font=[TIMES,16], labelfont=[TIMES,18]):
the_title:="Plot of f(x) and g(x)":
plot([f(x),g(x)],x=-5..5,
     'gridlines',
     'color'=['red','blue'],
     'legend'=the_legend,
     'legendstyle'=['location'='bottom'],
     'axes'='normal',
     'title'=the_title,  
     'scaling'='unconstrained');

proc (x) options operator, arrow; x^3-x^2+1 end proc

proc (x) options operator, arrow; 6-2*x-x^2 end proc

#I want the above legend to be stacked vertically like the
#following one, but keep it at bottom

plot([f(x),g(x)],x=-5..5,
     'gridlines',
     'color'=['red','blue'],
     'legend'=the_legend,
     'legendstyle'=['location'='right'],
     'axes'='normal',
     'title'=the_title,  
     'scaling'='unconstrained');

 

 

Download legend_question.mw

Given equation such as 1/A=x/A, at school we are allowed to write this as 1=x by canceling A on both side.

But in Maple, even if I tell it that A is not zero, it still refuses to simplify it and cancel A from both sides.

What could be the reson for this?

eq:= 1/A = x/A;
simplify(eq) assuming A<>0

Using Mathematica it does it:

I am not looking for workaround, I know how to force this if needed, one way could be

numer(normal((lhs-rhs)(eq)))=0

gives 1 - x = 0

My question is why Maple's simplify does not simplify it automatically? Even using simplify with size option did not. Is it just weakness in simplify or is there a subtle mathematical reason behind it which I am missing?

Maple 2025.2

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.

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)

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