aroche

Dr. Austin Roche

765 Reputation

10 Badges

12 years, 229 days
Maplesoft
Waterloo, Ontario, Canada
I am a Software Architect in the Math Group, working mostly on the Maple library. I have been working at Maplesoft since 2007, in various areas including differential equations, integration, mathematical functions, simplification, root finding, and logic. I completed a Master's degree from McGill University with a thesis in Differential Geometry, and a PhD from Simon Fraser University with a thesis on Differential Equations.

MaplePrimes Activity


These are answers submitted by aroche

 

Hi,

Thank you for finding this bug!

The general form of the ODE where this problem occurred is this one:

ode := F(x,y(x))*diff(y(x),x) = 0;

F(x, y(x))*(diff(y(x), x)) = 0

It so happens that Student:-ODEs was relying on odeadvisor to classify the input ODE. Now, while a call to odeadvisor with no extra arguments produces the expected answer,

DEtools:-odeadvisor(ode);

[_quadrature]

Student:-ODEs was actually trying the 'exact' method first, and odeadvisor - for this very specific, trivially solvable class and when provided the extra argument [exact] - was asserting that indeed the ODE is exact.

DEtools:-odeadvisor(ode, [exact]);

[_exact]

This is of course not an exact ODE unless F has no dependence on x.

In any case these bugs are now fixed. The new result from odeadvisor will be [NONE] signifying that the ODE is not exact:

DEtools:-odeadvisor(ode, [exact]);

[NONE]

 and the previously wrong results from Student:-ODEs are now replaced by the expected answer

Student:-ODEs:-Solve(ode);

y(x) = c__1

With regard to the result for y(x)*diff(y(x),x)=0, there was in my opinion no bug - the result (which has not changed after this fix) was correct, although not fully simplified.

Student:-ODEs:-ODESteps(y(x)*diff(y(x),x)=0);

"[[,,"Let's solve"],[,,y(x) ((ⅆ)/(ⅆx) y(x))=0],["•",,"Highest derivative means the order of the ODE is" 1],[,,(ⅆ)/(ⅆx) y(x)],["•",,"Integrate both sides with respect to" x],[,,∫y(x) ((ⅆ)/(ⅆx) y(x)) ⅆx=∫0 ⅆx+`c__1`],["•",,"Evaluate integral"],[,,((y(x))^2)/2=`c__1`],["•",,"Solve for" y(x)],[,,{y(x)=sqrt(2) sqrt(`c__1`),y(x)=-sqrt(2) sqrt(`c__1`)}]]"

The y(x) = 0 is fully contained in the given answer when c__1 is set to 0, so the only issue really is that the two answers could be combined into one simpler answer y(x) = c__1, but this kind of polishing is not really the main goal of the Student package.

Download Answer6.mw

The issue is fixed, and the fix is distributed for everybody using Maple 2024 within the Maplesoft Physics Updates v.1747 or newer. As usual, to install the Updates, open Maple and input Physics:-Version(latest)

Austin Roche
Maplesoft

Apart from being available in the Physics updates as mentioned by @ecterrab, this fix should also appear in the next patch release (2024.1).

This bug was fixed for Maple 2024.0:

expr := -1/7 - (-1/7*7^(5/7)*exp(2/7*Pi*I)*sin(1/7*Pi)*I - 1/7*cos(1/7*Pi)*7^(5/7)*exp(2/7*Pi*I))^(7/2);
simplify(expr);

-1/7-(-((1/7)*I)*7^(5/7)*exp(((2/7)*I)*Pi)*sin((1/7)*Pi)-(1/7)*cos((1/7)*Pi)*7^(5/7)*exp(((2/7)*I)*Pi))^(7/2)

-1/7-(1/7)*(-1)^(2/7)*(-(-1)^(3/7))^(1/2)

Download mp_tmp.mw

This weakness was fixed for Maple2024.0:

expr:=c[2]*sin(sqrt(3)*x/2) + c[3]*cos(sqrt(3)*x/2);
expr:=convert(expr,tan);

simplify(expr);


Hi Réjean
,
Thank you for the report. This bug is now fixed in the development Maple. The new answer is:

Sum(Sum(a[u]*a[v]+2*a[u]*b[v],u = 1 .. n),v = 1 .. n);

                              n   /  n                            \
                            ----- |-----                          |
                             \    | \                             |
                              )   |  )   (a[u] a[v] + 2 a[u] b[v])|
                             /    | /                             |
                            ----- |-----                          |
                            v = 1 \u = 1                          /

Cheers,

   Austin

As Edgardo mentioned in another answer, the bugs you posted in simplify are now fixed, and the fixes are available in the Physics Updates (Maplesoft Physics Updates v.643 or higher) which can be used now if you have Maple 2020. These fixes are also expected to be included in the next dot release for Maple 2020.

I just want to give a bit of explanation about what happened because this bug indeed seemed a bit mysterious. First of all, the factorial functions were being converted to GAMMA using n! = GAMMA(n+1). The simplification that was then being applied was the following:

1/(GAMMA(x)*GAMMA(k - x)) = sin(Pi*x)/(Pi*Product(x - i, i = 1 .. k - 1));


which is generally valid when k is an integer as was the case in your examples. Typically, this is a useful simplification to make as the result only involves elementary functions. Unfortunately, when x is also an integer, the numerator in the rhs is sin(Pi*x) which evaluates to 0. There may also be factors in the denominator which are 0, either explicitly or under assumption. In such cases, it is better to avoid applying this simplification and indeed, Maple has been careful to recognize these cases and avoid this substitution in such cases for the most part. The one exception here is that it didn't recognize that if x is actually a summation index (as the n in your examples is), then it is implicitly assumed to be an integer, even though no such assumption has been explicitly made using the assume facility. The fix was to make the GAMMA simplifier aware that summation indices are also integers and to have it take extra care in those cases as well.

Note that in your last example, simplify(op4), the n in the expression op4 has neither an explicit nor implicit assumption of being an integer, so the above simplification still goes ahead (and is valid in general).

Austin Roche

1 2 3 Page 3 of 3