acer

32757 Reputation

29 Badges

20 years, 114 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

Maple uses a extension mechanism for some kernel builtin commands like expand. This recognizes procedures with a name in a pattern like `expand/f` to be the thing to use when asked to expand a call to f.

There is a default Library procedure assigned to `expand/Sum`. That is a somewhat complicated procedure that tries a bit to respect the notion that expanding (splitting) a Sum is not always mathematically valid.

When you load a command from the old student package (using with, like you've done) Maple does some initialization of the package and redefines some things. In particular, it redefines `expand/Sum`.

It actually redefines it as a call to readlib of the new, replacement procedure. That's not key. What's key is that the initialization assigns another, simpler procedure to `expand/Sum`. That new procedure turns a Sum call of an addition of terms into an addition of Sum calls, regardless of the fact that is not always right. I suspect that the rationale was the students would find the functionality useful, and were less likely to be working with divergent sums (infinite series), etc, or that the benefit of the functionality outweighed the danger.

You can compare these:

restart;
interface(verboseproc=3):
with(student,changevar);
showstat(eval(`expand/Sum`));

restart;
interface(verboseproc=3):
showstat(`expand/Sum`);

Here are various corrections and adjustments, including:

- Utilize the nolines option to plots:-inequal, to get rid of dotted line demarking part of one strict inequality.
- Utilize InertForm:-Display for (right tick) unevaluation-quoted expressions used in the plots. Otherwise, subsequent re-use or evaluation of the created plots will cause those nicely formatted names in inequalities to evaluate to lengthy expressions. NB. the typeset option does not(!) prevent that. You can test this worked by just assigning the plot to a name, and then printing that after the fact; it's working properly if the inlined math in the plot survives.
- Get rid of some unnecessary quotes.
- Pass gridrefine=4 on to implicitplot, called from plots:-inequal, to get smoother edges of polygon regions.

restart

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

DATA := [delta = .9, a = 0.1e-1, g = .25, c = 0.5e-1, sigma = 0.8e-1, Cn = .4, Crm = .1, Cr = 0.1e-1, Pr = .35, t = 0.5e-1, alpha = .95, s = 0.1e-1, upsilon = .95, rho0 = .4, b = .5]

`π_WD` := (((alpha*((-g*i2 + a)*Cr + 2*Crm + 2*c - 2*Pr)*Cr*b + ((g*i2 - a)*Cr - 2*Crm - 2*c + 2*Pr)*alpha - (-g*i2 + a)*Cr)*d + alpha*((-g*i2 + a)*Cr + 2*Crm + 2*c - 2*Pr)*b + 2*g*i2 - 2*a)*rho0 + 2*((Cr*b - 1)*d + b)*(delta + Cn - Pr - 1))^2*b*d/(8*(Cr*b*d + b - d)^2*(((Cr*alpha*b - alpha + 1)*d + alpha*b)*rho0^2 - 2*b*d*(delta - 1))):

`π_D` := b*(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*d/(8*((Cr*b-1)*d+b)^2*(((Cr*alpha*b-alpha+1)*rho0^2-2*b*(delta-1))*d+alpha*b*rho0^2))

`πR` := subs(DATA, `π_WD`)

`πD` := subs(DATA, `π_D`)

Di := `πR`-`πD`

# Step 1: try to figure out the scales of the domain where to use plots:-inequal
(*
simplify(`πR`-`πD`);
S := solve(%=0, Ce):

eval([S], i2=0.01);
eval(`πR`-`πD`, {i2=0.01, d=0.8});
eval(`πR`-`πD`, {i2=0.01, d=0.3});

eval([S], i2=0.09);
eval(`πR`-`πD`, {i2=0.09, d=0.8});
eval(`πR`-`πD`, {i2=0.09, d=0.3});
*)

LX := 0.09: LY := 0.8:

# Plot region where πR > πD
p := plots:-display(
  plots:-inequal(`πR` > `πD`, i2 = 0 .. LX,
                 d = 0 .. LY, ':-color' = "Chartreuse",
                 ':-nolines', ':-optionsimplicit'=[':-gridrefine'=4]),
  axes=boxed):

display(p,plot(x, x=0..0.06, color="Chartreuse", thickness=10,
               legend=InertForm:-Display('`πR`' > '`πD`'),
        view = [0 .. LX, 0 .. LY],labels = ['i2', 'd']));

eps  := 0.001:

OneHatch := display(plottools:-polygon(
                [[-2*LX, -2*LX-eps], [2*LX, 2*LX-eps], [2*LX, 2*LX+eps],
                 [-2*LX, -2*LX-eps], [-2*LX, -2*LX-eps]],
                color=gray, style=line)):

Tr := plottools:-transform((x, y) -> [x, y*LY/LX]):

back := display(seq(plottools:-translate(Tr(OneHatch), 0, h),
                    h=-2*LY..2*LY, LY/10),
                view=[-LX..LX, -LY..LY], axes=framed):

display(p
  , back
  , plot(x, x = -LX .. -(1/2)*LX, color = "Chartreuse", thickness = 10,
         legend = InertForm:-Display('`πR` > `πD`'))
  , title=typeset("Hatched region =   ", InertForm:-Display('`&pi;R`' < '`&pi;D`'))
  , view = [0 .. LX, 0.3 .. LY]);

display(plottools:-rectangle([0.01, 0.65], [0.03, 0.7], color=white)
  , textplot([0.02, 0.675, Pi[m]^WD > Pi[m]^:-D], font=[Times, bold, 10])
  , p
  , back
  , plottools:-rectangle([0.01, 0.4], [0.03, 0.45], color=white),
    textplot([0.02, 0.435, InertForm:-Display('`&pi;WD` < `&pi;D`')]
  , font=[Times, bold, 10])
  , view = [0 .. LX, 0.3 .. LY]);

 

 

Download Question_1_regional_ac.mw

Here is a further revision of Carl's revision of Kitonum's procedure.

The main point of this revision is to allow the same kinds of color functionality (for the curves and the text contour labels) as contourplot has for its curves.

(Aside: If you have an old version which does not support the colorbar option -- on densityplot or contourplot -- then you could just remove those from the code. The code below references it just to disable it.)

restart;

kernelopts(version);

`Maple 2024.2, X86 64 LINUX, Oct 29 2024, Build ID 1872373`

ContoursWithLabels := proc(
     Expr::algebraic,
     Range1::(name=range(realcons)), Range2::(name=range(realcons)),
     {contours::{posint, {list}(realcons)}:=8},
     {GraphicOptions::{list,set}({name, name= anything}):= NULL},
     {ImplicitplotOptions::{list,set}({name, name=anything}):=NULL},
     {TextOptions::{list,set}({name, name=anything}):=NULL},
     {ContourOptions::{list,set}({name, name=anything}):=NULL},
     {DensityOptions::{list,set}({name, name=anything}):=NULL} )
   local r1,r2,f,L1,h,S1,P,r,M,C,T,p,p1,m,n,i,G,GL,mm,PO,
         x:=lhs(Range1),y:=lhs(Range2);
     f := unapply(Expr,(x,y));
     if contours::posint then
          r1 := rand(convert(rhs(Range1), float));
          r2 := rand(convert(rhs(Range2), float));
          L1 := select(type,(f@op)~({seq([r1,r2](),i=1..205)}),realcons);
          h := (L1[-6]-L1[1])/contours;
          S1 := [seq(L1[1]+h/2+h*(n-1), n=1..contours)]
     else #contours::{set,list}(realcons)
          S1 := [contours[]]
     end if;
     userinfo(1, ContoursWithLabels, print('Contours' = evalf[2](S1)), `\n`);
     r := k-> rand(20..k-20);
     G := plots:-contourplot(Expr,Range1,Range2,':-contours'=contours,':-grid'=[5,5],
                             ':-contourlabels'=false,':-colorbar'=false,ContourOptions[]);
     GL := ListTools:-Reverse(select(u->type(u,specfunc(CURVES)) and nops(u)>0,[op(G)]));
     for C from 1 to nops(S1) do
          P := plots:-implicitplot(Expr = S1[C], Range1, Range2,
                                   gridrefine=3, ImplicitplotOptions[]);
          PO := select(type,[op(GL[C])],specfunc({COLOR,COLOUR}))[-1];
          for p in [plottools:-getdata(P)] do
               p1 := convert(p[3], listlist); n := nops(p1);
               if n < 500 then
                    m := `if`(40 < n, r(n)(), round(n/2));
                    M[`if`(40 < n, [p1[1..m-11], p1[m+11..n]], [p1])[]] := PO;
                    T[[p1[m][], evalf[2](S1[C])]] := PO;
               else
                    h := trunc(n/2); m := r(h)();
                    M[p1[1..m-11], p1[m+11..m+h-11], p1[m+h+11..n]] := PO;
                    T[[p1[m][], evalf[2](S1[C])], [p1[m+h][], evalf[2](S1[C])]] := PO;
               end if;
          end do;
     end do;
     plots:-display([
          `if`(DensityOptions = NULL,NULL,
               plots:-densityplot(Expr, Range1, Range2, ':-colorbar'=false,
                                  ':-style'=':-surface', DensityOptions[])),
           seq(plot(mm,':-color'=M[mm[]], GraphicOptions[]),mm=[indices(M)]),
           seq(plots:-textplot(mm,':-color'=T[mm[]], TextOptions[]),mm=[indices(T)])
                    ], 'axes'=':-box', 'gridlines'=false, _rest);
end proc:

 

ff := (11-x-y)^2+(1+x+10*y-x*y)^2;

(11-x-y)^2+(-x*y+x+10*y+1)^2

 

ContoursWithLabels(
     ff, x=0..20, y=0..15, contours=11,
     TextOptions = [font=[HELVETICA,BOLD,8], color="DarkBlue"],
     ContourOptions = [colorscheme="DivergeRainbow"],
     ImplicitplotOptions = [gridrefine=4],
     size = [900,500], labels=[x,y]);

P := ContoursWithLabels(
     ff, x=0..20, y=0..15, contours=[seq(50+i*50,i=0..10),seq(1000+i*1100,i=0..8)],
     TextOptions = [font=[HELVETICA,BOLD,8]],
     ContourOptions = [colorscheme="DivergeRainbow"],
     ImplicitplotOptions = [gridrefine=3],
     size = [900,500], labels=[x,y]):
P;

PP := 0.3800179925e-3*exp(-0.6065722618e-3*(x-29.51704536)^2
      +(0.6650093594e-3*(x-29.51704536))*(a-12.94061928)-0.1106850312e-2*(a-12.94061928)^2);

0.3800179925e-3*exp(-0.6065722618e-3*(x-29.51704536)^2+0.6650093594e-3*(x-29.51704536)*(a-12.94061928)-0.1106850312e-2*(a-12.94061928)^2)

ContoursWithLabels(
     PP, x=-20..20, a=-20..20, contours=[seq(1e-4..4e-4,5e-5)],
     TextOptions = [font=[HELVETICA,BOLD,8]],
     ContourOptions = [colorscheme="DivergeRainbow"],
     labelfont = [TIMES,BOLDITALIC,12], axesfont = [HELVETICA,10],
     size = [500,500]);

ContoursWithLabels(
     PP, x=-20..20, a=-20..20, contours=[seq(1e-4..4e-4,5e-5)],
     TextOptions = [font=[HELVETICA,8]],
     ContourOptions = [color=black],
     GraphicOptions = [thickness=0.5],
     labelfont = [TIMES,BOLDITALIC,12], axesfont = [HELVETICA,10],
     size = [500,500]);

ContoursWithLabels(
     PP, x=-20..20, a=-20..20, contours=[seq(1e-4..4e-4,5e-5)]);

ContoursWithLabels(
     PP, x=-20..20, a=-20..20, contours=[seq(1e-4..4e-4,5e-5)],
     DensityOptions = [colorscheme="DivergeRainbow", style=surface],
     TextOptions = [font=[HELVETICA,BOLD,8]],
     ImplicitplotOptions = [gridrefine=2],
     ContourOptions = [color=black],
     labelfont = [TIMES,BOLDITALIC,12], axesfont = [HELVETICA,10],
     size = [500,500]);

ContoursWithLabels(
     PP, x=-20..20, a=-20..20, contours=[seq(1e-4..4e-4,5e-5)],
     DensityOptions = [colorscheme=["zgradient",["Purple","LightBlue","Orange"]],colorbar=true],
     TextOptions = [font=[HELVETICA,BOLD,9],color="#303030"],
     ContourOptions = [color="#303030"],
     labelfont = [TIMES,BOLDITALIC,12], axesfont = [HELVETICA,10],
     size = [700,400]);

ContoursWithLabels(
     PP, x=-20..20, a=-20..20, contours=[seq(1e-4..4e-4,5e-5)],
     DensityOptions = [colorscheme=[black,white]],
     TextOptions = [font=[HELVETICA,BOLD,10]],
     ContourOptions = [colorscheme=[white,"LightGray",black]],
     GraphicOptions = [thickness=0.5],
     labelfont = [TIMES,BOLDITALIC,12], axesfont = [HELVETICA,10],
     size = [700,400]);

 

 

Download CPL03.mw

And your other example,

ContoursWithLabels(
     y^2+x-1, x=-10..10, y=-10..10, contours=[$-1 .. 5],
     TextOptions = [font=[HELVETICA,BOLD,7], color="DarkBlue"],
     ContourOptions = [colorscheme="DivergeRainbow"]);

ContoursWithLabels(
     y^2+x-1, x=-10..10, y=-10..10, contours=[$-1 .. 5],
     TextOptions = [font=[HELVETICA,BOLD,10]],
     ContourOptions = [colorscheme="DivergeRainbow"]);


ps. I notice that my M2024.2 has trouble rendering the minus sign in a textplot numeral/float, when the font size is 8 or 9. Not central to this code, but I'll report it.

I'm not suggesting that this is a good choice of template function. It's merely an illustration, a bit like you had.

Not also that NonlinearFit might do local optimization, so quality of the fit can depend on the choice of initialvalues. See also the DirectSearch v.2 package on the Application Center, which can do similar kinds of fitting but doing global optimization over supplied parameter ranges.

notes:
- The randomize() call makes it get a different L after each restart.
- The float range -5.0..5.0 makes it produce floats in the range. A range -5..5 would just produce integer values in the range.

restart;

randomize():

with(plots):

setoptions(size=[500,200]);

N := 10:

L:=LinearAlgebra:-RandomVector(N,generator=-5.0..5.0):

listplot(L);

F1 := Statistics:-NonlinearFit( a*cos(e*x+d)+b*x+c, <$1..N>, L, x
                                , parameterranges=[a=-5..5, d=-Pi..Pi]
                                , initialvalues=[e=ceil(1/2*N/Pi)]
                              );

HFloat(2.946500373957529)*cos(HFloat(1.660098536783793)*x+HFloat(1.972035777846103))+HFloat(0.03533616937042544)*x-HFloat(0.4678613378149076)

display(listplot(L), plot(F1,x=1..N));

Download Mma_trans_01.mw

Your original example can be handled like so:

f:=x^2 - y^2+Pi;

               2    2     
         f := x  - y  + Pi

indets(f,And(name,Not(constant)));

              {x, y}

A variant, to disregard "dummy" variables (or integration, summation, say),

f := int(h(s),s=1..t) + x^2 - y^2 + Pi + gamma + Catalan;

int(h(s), s = 1 .. t)+x^2-y^2+Pi+gamma+Catalan

indets(f,name);

{Catalan, Pi, gamma, s, t, x, y}

indets(f,And(name,Not(constant)));

{s, t, x, y}

indets(f,And(name,Not(constant),
             satisfies(u->depends(f,u))));

{t, x, y}

Download indets_name_1.mw

The DEplot command is solving the ode numerically. That incurs small numeric error, which is not unexpected.

But if the approximated solution of y(t) goes even slightly outside of your forced restricted range y=-1..1 then the numeric solving (and, here, DEplot which calls it) halts.

Try it without the enforced range on y.

ode := diff(y(t), t$2) + y(t)=0;
DEtools:-DEplot(ode, y(t), t=0 .. 3*Pi,
                [[y(0)=1,D(y)(0)=0]],linecolor=blue);

Or, you could use the option obsrange=false.

DEtools:-DEplot(ode, y(t), t=0 .. 3*Pi,
                y=-1..1,
                obsrange=false,
                [[y(0)=1,D(y)(0)=0]],linecolor=blue);

This is the same underlying issue as in your Question of Dec 14, 2025.

ps. In this later example, the fact that it happens to work with t=0..round(3*Pi) is somewhat of a fluke -- the sampled points just happen to not stray just outside your supplied strict y-range.
pps. I am not sure why your previous example didn't motivate you to use obsrange=false if you are going to supply a forced, tight y-range.

Another possibility for programatically stacking items/lines that appear at the bottom is to use the caption option.

IIRC stacked items can also be justified or aligned (by the colored lines, or even the equal-signs), possibly using an html-ish mtable, but I'd have to search old notes for how I did that programatically.
 

restart;

Mf := proc(e::uneval,c) uses Typesetting;
  mrow(mn(cat(" "," "$42," "),':-mathbackground'=c,':-size'=3),
       mn("  "), eval('Typeset'('e'=eval(e)))); end proc:

 

plots:-setoptions(captionfont=[TIMES,4], font=[TIMES,16], labelfont=[TIMES,18]):

 

f := x -> x^3-x^2+1:
g := x -> 6-2*x-x^2:

 

plot([f(x),g(x)],x=-5..5,
     'gridlines', 'color'=['red','blue'],
     'caption'=typeset("\n", Mf(f(x),red), "\n", Mf(g(x),blue) ),
     'captionfont'=[TIMES,13],
     'title'="\nPlot of f(x) and g(x)\n", 'scaling'='unconstrained');


Download caption_for_legend.mw


ps. This comes out of old idea to use caption for getting legend effects
on 3D plots.
pps. On a side note, does captionfont work with setoptions? I'll check, and submit an scr if needed. 

The left-quotes are not necessary.

The 2D Input can be done just be using a single right-quote (apostrophe) for the prime.

One can even change a setting so that the derivatives appear in prime-notation in 2D Output.

restart


Prime notation can be used directly in 2D Input mode, without
needing any single left-ticks (aka name-quotes).

It parses this as containing derivatves, by default.

diff(y(x), x, x) = diff(y(x), x)+y(x)+sin(x)

diff(diff(y(x), x), x) = diff(y(x), x)+y(x)+sin(x)


The independent variable is presumed on the y-prime.

But, see above, we can also write the application to "x"
explicitly, without getting an unwanted double application.

diff(f(x), x, x)+diff(g(x), x)

diff(diff(f(x), x), x)+diff(g(x), x)

Typesetting:-Settings(prime)

x

Typesetting:-Settings(prime = s)

diff(f(x), x, x)+diff(g(x), x)

diff(diff(f(s), s), s)+diff(g(s), s)

restart


We can also change a setting so that the prime notation gets
used for pretty-printing, ie. 2D Output.

Typesetting:-Settings(typesetprime = true)

diff(y(x), x, x) = diff(y(x), x)+sin(x)

diff(diff(y(x), x), x) = diff(y(x), x)+sin(x)

lprint(%)

diff(diff(y(x),x),x) = diff(y(x),x)+sin(x)

dsolve([%, y(0) = 0, (D(y))(0) = 0])

y(x) = (1/2)*exp(x)-(1/2)*sin(x)+(1/2)*cos(x)-1

restart


The reason it works by default for input is because of this default setting.

If we turn it off then it doesn't parse this as derivatives.

Typesetting:-Settings(useprime)

true

Typesetting:-Settings(useprime = false)

diff(y(x), x, x) = diff(y(x), x)+y(x)+sin(x)

`y''`(x) = `y'`(x)+y(x)+sin(x)

lprint(%)

`y''`(x) = `y'`(x)+y(x)+sin(x)


Download typeset_prime_2D.mw

Yes, when simplify manipulates an active (non-inert) limit call then transformations it makes produce new active limit calls -- which evaluate as usual.

That's not unusual. It happens (sometimes very productively) for active int calls as well.

Here limit might not be able to handle an expression with, say, tan&sec forms. That's a limit weakness more than it is a dsolve weakness. Your phrase, "...since dsolve could not find limit..." suggests that you're blaming dsolve for limit's weakness -- which would be a mistake.

If you convert this sol result to sincos, and then evaluate that, then limit can compute that the limit is undefined. Eg,
     eval(convert(sol,sincos))
There's no completely general reason for simplify not to attempt that kind of transformation, and in doing so allow limit to attain an explicit result that it couldn't get for the original form.

Ideally, limit itself could have found that result (including when dsolve calls it to do that task).

The following code may illustrate limit's failure (under dsolve) and then later its success when simplify forces transformations (which limit itself might ideally have tried originally, etc):

ode:=4*x*diff(y(x),x$2)+2*diff(y(x),x)+y(x)=(6+x)/x^2;
IC:=y(infinity)=0;

trace(limit);

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

simplify(sol);

Now, it can happen that MultiSeries:-limit can find an explicit undefined result directly from the expression containing the tan form. If a limit call would return that then dsolve could return NULL. (Again, this is about weakness in what :-limit may FAIL on, more than what dsolve's doing here.)

restart;
ode:=4*x*diff(y(x),x$2)+2*diff(y(x),x)+y(x)=(6+x)/x^2;
IC:=y(infinity)=0;

unprotect(limit):
limit:=MultiSeries:-limit:
protect(limit):
trace(limit):

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

That seems weird. I think you could submit a bug report on that.

ps. consider y(x) = exp(-x)  (which I got by looking at it...)

ode:=diff(y(x),x$2)-2*diff(y(x),x)+y(x)=4*exp(-x);

diff(diff(y(x), x), x)-2*(diff(y(x), x))+y(x) = 4*exp(-x)

IC:=y(infinity)=0;

y(infinity) = 0

odetest( y(x)=exp(-x), [ode,IC] );

[0, 0]

Download de_inf_ex.mw

Do you mean this one?

proc(f,x,y,ndata,nvars)
   local G,init,nparams,k;
   nparams := nops(f);
   init := `if`(type(x, 'Vector'), (i,j)->evalf(f[j](x[i])),
                  (i,j)->evalf(f[j](seq(x[i,k], k=1..nvars))));
   G := Matrix(ndata, nparams, 'datatype'=float, init);
   LinearFitting:-LinearLS(y, G, ndata, nparams, args[6..-1]);
end proc;

I think that it might be a local of an unnamed(?) module which also contains an overloaded LinearFit (to which the export LinearFit of Statistics:-Regression somehow refers...).

You can enter it, in a debugger run of a LinearFit call, and list its contents.

You can use items from the Palette menus for this, which appear in the left panel of the Maple GUI.

In the special case that it is an arrow that you want on top then you can find a dedicated entry for it on the Accents palette.

You could also first enter the appropriate stacked item (template) from the Layout palette. Replace the lower portion by u, and the upper portion by your choice from the Arrows palette.

You can use the Tab key (or mouse pointer) to move focus around the entered item.

You can manage which of the many available palettes appear in the left panel, using GUI's main menu/ribbon.

The odetest result can be further manipulated and simplified to zero under assumptions.

In my Maple 2024.2 it can get it, assuming x::real

In my Maple 2022.2 it can get it, assuming x::posint, though that raises an error like yours in 2024.2.

In that Maple 2022.2 it gets it around 4 out of 5 times (after restart) for x::real, but always gets it for x>0.

restart;

kernelopts(version);

`Maple 2024.2, X86 64 LINUX, Oct 29 2024, Build ID 1872373`

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

foo := simplify(evala(odetest(sol,[ode,IC]))) assuming x::real;

[(1/3)*(x+1)*x*(x-1)*((-2+2*I)*(x+1)^(1/4)*2^(1/2)*(x-1)^(1/4)-x^2+((4-4*I)*(x+1)^(5/4)*2^(1/2)*(x-1)^(5/4)+x^4-(16*I)*(x+1)^(1/2)*(x-1)^(1/2)-2*x^2+1)^(1/2)+1), 0]

G := foo[1]/(1/3*(x+1)*(x-1)*x):

G1 := op(3,G):

G2 := G - G1:

new := 1/3*(x+1)*(x-1)*x*(G2^2-G1^2)/(G2-G1):

# Compare the two expressions
normal( foo[1] - new );

0

simplify(expand( new )) assuming x::real;

0

Download nm_odetest_ex3.mw

Ideally simplify or odetest itself would be able to get the zero directly, either under assumption x::real, or under assumption x::posint.

You can insert a reference to an Equation Label using Ctrl-l , or Command-l on Mac OS X. (That's Ctrl and the "L" key.)

No, not all versions have a dedicated "What's New" page just for differential equations.

The general layout and naming of these pages changes, and is not fixed.

Some releases have a specific section for DEs in the "Advanced Math" What's New page. It depends on how much was new in that functionality.

The areas of focus for development change over time.

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