Question: Strange simplification of sqrt with sin(x)

it took me hrs to find this as my solution was failing verification and I did not know why.

What logic do you think Maple used to simplify this:

expr:=sqrt(1 + sin(x))/x;
simplify(expr)

To this

How could the above be simpler than

?

Compare to Mathematica

And this is what I expected. I am now scared to use simplify in Maple as I do not know what I will get back.

Is there a way to tell Maple not to do such strange "simplification"? I am doing this in code, and the code does not know what the expression is.

To see an example of the side effect of this, here is one, where if solution to an ode is simplified first, it no longer verifies by odetest without adding extra assumptions:


 

155324

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

restart;

155324

ode:=diff(y(x),x)=(cos(x)-2*x*y(x)^2)/(2*x^2*y(x));
sol:=dsolve([ode,y(Pi)=1/Pi]);
odetest(sol,ode);

diff(y(x), x) = (1/2)*(cos(x)-2*x*y(x)^2)/(x^2*y(x))

y(x) = (sin(x)+1)^(1/2)/x

0

odetest(simplify(sol),ode);

(1/4)*cos(x)*2^(1/2)*csgn(cos((1/2)*x)+sin((1/2)*x))^2*csgn(1, (1/2)*2^(1/2)*(cos((1/2)*x)+sin((1/2)*x)))/x

One does not expect that simplified solution no longer verfiies the ode.

Sure, I can do

          odetest(simplify(sol),ode) assuming real;

and now it gives 0. But the point is that the first one did not need assumptions.

Download simplify_with_odetest.mw

Maple 2024 on windows 10.

Please Wait...