nm

11413 Reputation

20 Badges

13 years, 70 days

MaplePrimes Activity


These are questions asked by nm

The series to ode using 'series' option (if it exists) should always be series(...), i.e. with big O at end. but sometimes Maple forgets to add this. Here is an example

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1862 and is the same as the version installed in this computer, created 2025, April 25, 10:33 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 15 and is the same as the version installed in this computer, created April 27, 2025, 23:18 hours Eastern Time.`

restart;

ode:=diff(y(x),x)+y(x)=1+x;
IC:=y(0)=0;
sol:=dsolve([ode,IC],y(x),'series')

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

y(0) = 0

y(x) = x

lprint(sol); # notice solution is not series, it should be

y(x) = x

#above solution should be
y(x) = series(x+O(x^6),x,6)

y(x) = series(x+O(x^6),x,6)

#this example below is correct
ode:=diff(y(x),x)+y(x)=1+x;
IC:=y(0)=1;
sol:=dsolve([ode,IC],y(x),'series')

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

y(0) = 1

y(x) = series(1+(1/2)*x^2-(1/6)*x^3+(1/24)*x^4-(1/120)*x^5+O(x^6),x,6)

lprint(sol); #solution is series

y(x) = series(1+1/2*x^2-1/6*x^3+1/24*x^4-1/120*x^5+O(x^6),x,6)

 

 

Download bug_report_dsolve_series_april_28_2025.mw

These two expressions are the same, just pulled minus sign out

But look what happens when integrating them. the anti derivative of one is much more complicated than the other and contains complex numbers and logs. And no matter what I tried, I could not convert the complicated one to look same as the simpler result. Also could not verify the complicated one by back differentiating.

integrand_1:=x^2*(-arctan(x) + x)*exp(-arctan(x) + x)/(x^2 + 1);

x^2*(-arctan(x)+x)*exp(-arctan(x)+x)/(x^2+1)

integrand_2:=evala(integrand_1);

-x^2*(arctan(x)-x)*exp(-arctan(x)+x)/(x^2+1)

simplify(integrand_1 - integrand_2)

0

anti_1:=int(integrand_1,x);

(-arctan(x)+x)*exp(-arctan(x)+x)-exp(-arctan(x)+x)

anti_2:=int(integrand_2,x);

-(1-x+((1/2)*I)*ln(1-I*x)-((1/2)*I)*ln(1+x*I))*(1-I*x)^(-(1/2)*I)*(1+x*I)^((1/2)*I)*exp(x)

simplify(diff(anti_1,x)-integrand_1);

0

simplify(diff(anti_2,x)-integrand_2);

Error, (in simpl/simpl/ReIm/sum) too many levels of recursion

simplify(anti_1 - anti_2)

Error, (in simpl/simpl/ReIm/sum) too many levels of recursion

simplify(anti_2);

(1/2)*(I*ln(1+x*I)-I*ln(1-I*x)+2*x-2)*(1-I*x)^(-(1/2)*I)*(1+x*I)^((1/2)*I)*exp(x)

simplify(anti_2,ln);

(1/2)*(I*ln(1+x*I)-I*ln(1-I*x)+2*x-2)*(1-I*x)^(-(1/2)*I)*(1+x*I)^((1/2)*I)*exp(x)

 

 

Download int_strange_result_april_27_2025.mw

I would have expected same anti derivative to show.  To check, I used another software, and that one gave same anti-derivative for both integrands.

The questions I have: Why Maple gives such different result for same integrand? And how could one convert the one with the logs and complex numbers to the first one?

Maple 2025

FYI;

 

You might have to try the command more than one time to see the above crash. Here is the worksheet

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1862 and is the same as the version installed in this computer, created 2025, April 25, 10:33 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 13 and is the same as the version installed in this computer, created April 22, 2025, 15:14 hours Eastern Time.`

restart;

ode:=x^2-2*x*y(x)+5*y(x)^2 = (x^2+2*x*y(x)+y(x)^2)*diff(y(x),x);

x^2-2*x*y(x)+5*y(x)^2 = (x^2+2*x*y(x)+y(x)^2)*(diff(y(x), x))

sol:=y(x) = (-1/2*exp(RootOf(-exp(_Z)^2*ln(x*(exp(_Z)-2))+2*_C7*exp(_Z)^2+_Z*exp(_Z)^2+4*exp(_Z)*ln(x*(exp(_Z)-2))-8*_C7*exp(_Z)-4*exp(_Z)*_Z-2*exp(_Z)-4*ln(x*(exp(_Z)-2))+8*_C7+4*_Z+6))^2+3*exp(RootOf(-exp(_Z)^2*ln(x*(exp(_Z)-2))+2*_C7*exp(_Z)^2+_Z*exp(_Z)^2+4*exp(_Z)*ln(x*(exp(_Z)-2))-8*_C7*exp(_Z)-4*exp(_Z)*_Z-2*exp(_Z)-4*ln(x*(exp(_Z)-2))+8*_C7+4*_Z+6))-6+2*(exp(RootOf(-exp(_Z)^2*ln(x*(exp(_Z)-2))+2*_C7*exp(_Z)^2+_Z*exp(_Z)^2+4*exp(_Z)*ln(x*(exp(_Z)-2))-8*_C7*exp(_Z)-4*exp(_Z)*_Z-2*exp(_Z)-4*ln(x*(exp(_Z)-2))+8*_C7+4*_Z+6))^2-6*exp(RootOf(-exp(_Z)^2*ln(x*(exp(_Z)-2))+2*_C7*exp(_Z)^2+_Z*exp(_Z)^2+4*exp(_Z)*ln(x*(exp(_Z)-2))-8*_C7*exp(_Z)-4*exp(_Z)*_Z-2*exp(_Z)-4*ln(x*(exp(_Z)-2))+8*_C7+4*_Z+6))+9)^(1/2))/(1/2*exp(RootOf(-exp(_Z)^2*ln(x*(exp(_Z)-2))+2*_C7*exp(_Z)^2+_Z*exp(_Z)^2+4*exp(_Z)*ln(x*(exp(_Z)-2))-8*_C7*exp(_Z)-4*exp(_Z)*_Z-2*exp(_Z)-4*ln(x*(exp(_Z)-2))+8*_C7+4*_Z+6))^2-3*exp(RootOf(-exp(_Z)^2*ln(x*(exp(_Z)-2))+2*_C7*exp(_Z)^2+_Z*exp(_Z)^2+4*exp(_Z)*ln(x*(exp(_Z)-2))-8*_C7*exp(_Z)-4*exp(_Z)*_Z-2*exp(_Z)-4*ln(x*(exp(_Z)-2))+8*_C7+4*_Z+6)))*x:

odetest(sol,ode);

 

Download crash_maple_2025_april_27_2025.mw

Hopefully a fix could be found for this.

Just found new regression in Maple 2025. This internal error can not be cought and was not there in Maple 2024.2. This is new from the ones reprted earlier in Collection-Of-Problems-In-Maple-2025 

Here it is , using latest SupportTools

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1862 and is the same as the version installed in this computer, created 2025, April 25, 10:33 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 13 and is the same as the version installed in this computer, created April 22, 2025, 15:14 hours Eastern Time.`

restart;

#17593
eq:=2*A[6]*exp(-2*t)*cos(t)+2*A[3]*exp(-2*t)*sin(t)-2*A[4]*exp(-2*t)*cos(t)-4*A[7]*exp(-t)*sin(2*t)+4*A[8]*exp(-t)*cos(2*t)-2*A[5]*exp(-2*t)*sin(t)+4*A[2]*exp(-t)+4*A[1]*t*exp(-t)+4*A[3]*exp(-2*t)*cos(t)+4*A[4]*exp(-2*t)*sin(t)+2*A[9]*exp(-t)*cos(2*t)-8*A[9]*t*exp(-t)*sin(2*t)+2*A[10]*exp(-t)*sin(2*t)+8*A[10]*t*exp(-t)*cos(2*t)-2*A[5]*exp(-2*t)*cos(t)+2*A[5]*t*exp(-2*t)*sin(t)-2*A[6]*exp(-2*t)*sin(t)-2*A[6]*t*exp(-2*t)*cos(t)+4*A[5]*t*exp(-2*t)*cos(t)+4*A[6]*t*exp(-2*t)*sin(t) = 3*t*exp(-t)*cos(2*t)-2*t*exp(-2*t)*cos(t):


trial_solution_constants:=[A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8], A[9], A[10]]:

try
     timelimit(30,[solve(identity(eq,t),trial_solution_constants) ]);
catch:
     print("OK cought error");
end try;

Error, (in type/trig) too many levels of recursion

 

 

Download regression_maple_2025_april_26_2025.mw

Here is the same code in Maple 2024.2 but using windows. No internal error and timeout was cought as expected.

restart;
interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1862. The version installed in this computer is 1849 created 2025, March 12, 12:37 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

#17593
eq:=2*A[6]*exp(-2*t)*cos(t)+2*A[3]*exp(-2*t)*sin(t)-2*A[4]*exp(-2*t)*cos(t)-4*A[7]*exp(-t)*sin(2*t)+4*A[8]*exp(-t)*cos(2*t)-2*A[5]*exp(-2*t)*sin(t)+4*A[2]*exp(-t)+4*A[1]*t*exp(-t)+4*A[3]*exp(-2*t)*cos(t)+4*A[4]*exp(-2*t)*sin(t)+2*A[9]*exp(-t)*cos(2*t)-8*A[9]*t*exp(-t)*sin(2*t)+2*A[10]*exp(-t)*sin(2*t)+8*A[10]*t*exp(-t)*cos(2*t)-2*A[5]*exp(-2*t)*cos(t)+2*A[5]*t*exp(-2*t)*sin(t)-2*A[6]*exp(-2*t)*sin(t)-2*A[6]*t*exp(-2*t)*cos(t)+4*A[5]*t*exp(-2*t)*cos(t)+4*A[6]*t*exp(-2*t)*sin(t) = 3*t*exp(-t)*cos(2*t)-2*t*exp(-2*t)*cos(t):


trial_solution_constants:=[A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8], A[9], A[10]]:

 

try
     timelimit(30,[solve(identity(eq,t),trial_solution_constants) ]);
catch:
     print("OK cought error");
end try;


Download no_problem_in_maple_2024_april_26_2025.mw

everytime I run mint I get hundreds of messages coming from child modules, saying

           These names were used as global names but were not declared:  A

Where A above is the name of the top level module.

This only shows from commnd line mint, and not from maplemint used in the GUI.

The set I have is 

A:=module()
    export module foo_type()
       option object;
       ....
    end module;

     export B := module()  #child module
       .....
     end module;
end module;

  In the child module B above, whever I do 

                 o:=Object(A:-foo_type);

mint gives the above warning.

It is clear the name A should not be declared, as the module B is child to it so it can see it.

The workaround is to add  global A inside each child module to remove this warning. 

But why is this needed?

Here is a worksheet showing maplemint does not show this warning, and below example using command line mint on same exact code, which does

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

A:=module()

    export module foo_type()
       option object;
       export name::string:="";
    end module;

    export B := module()
       export step := proc()::A:-foo_type;                 
       local o::A:-foo_type;   
          o:=Object(A:-foo_type);
          o:-name:="x";
          return o;
       end proc;

    end module;

end module;

_m128759219362528

maplemint(A)

Nested Module foo_type() on lines 1 to 2
  These exported variables were never used:  name::string

 

 

Download mint_isse_april_25_2025.mw

Here is A.mpl 

A:=module()

    export module foo_type()
       option object;
       export name::string:="";
    end module;

    export B := module()    
       #global A;     why is this needed for mint??
       export step := proc()::A:-foo_type;                 
       local o::A:-foo_type;   
          o:=Object(A:-foo_type);
          o:-name:="x";
          return o;
       end proc;

    end module;
end module;

And now the command

>/home/me/maple2025/bin.X86_64_LINUX/mint A.mpl
    |\^/|      Maple 2025 Diagnostic Program
._|\|   |/|_.  Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2025
 \  MINT   /   All rights reserved. Maple is a trademark of
 <____ ____>   Waterloo Maple Inc.
      |        
Nested Procedure step() on lines 10 to 15
  These names were used as global names but were not declared:  A
Module A() on lines 1 to 18
  These exported variables were never used:  foo_type
>

You see the difference. mint complains that A is not declared.

Is this a bug in mint?

5 6 7 8 9 10 11 Last Page 7 of 201