Question: To simplify or not to simplify. Why sometimes simplify makes things worst?

I noticed today only 2 cases where calling simplify, with no options, made things worst.

Just trying to understand why.

Here is one example. Solved an ode. when calling odetest on this solution, it gives zero. But if the solution is simplified first, then odetest no longer gives zero. And it is actually hard to find a trick to make it become zero so far.

But the question is: Is this to be expected sometimes? I use simplify sporadically, but like to get smaller  expression at one point. But now I am not sure if I should even do that.

Could this be a problem in simplify itself somehow?

Here is an example.

interface(version);

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

restart;

ode:=diff(y(x), x) = y(x)*(-1 - x^(2/(ln(x) + 1))*exp(2*ln(x)^2/(ln(x) + 1))*x^2 - x^(2/(ln(x) + 1))*exp(2*ln(x)^2/(ln(x) + 1))*x^2*ln(x) + x^(2/(ln(x) + 1))*exp(2*ln(x)^2/(ln(x) + 1))*x^2*y(x) + 2*x^(2/(ln(x) + 1))*exp(2*ln(x)^2/(ln(x) + 1))*x^2*y(x)*ln(x) + x^(2/(ln(x) + 1))*exp(2*ln(x)^2/(ln(x) + 1))*x^2*y(x)*ln(x)^2)/((ln(x) + 1)*x);

diff(y(x), x) = y(x)*(-1-x^(2/(ln(x)+1))*exp(2*ln(x)^2/(ln(x)+1))*x^2-x^(2/(ln(x)+1))*exp(2*ln(x)^2/(ln(x)+1))*x^2*ln(x)+x^(2/(ln(x)+1))*exp(2*ln(x)^2/(ln(x)+1))*x^2*y(x)+2*x^(2/(ln(x)+1))*exp(2*ln(x)^2/(ln(x)+1))*x^2*y(x)*ln(x)+x^(2/(ln(x)+1))*exp(2*ln(x)^2/(ln(x)+1))*x^2*y(x)*ln(x)^2)/((ln(x)+1)*x)

sol_1:=dsolve(ode);

y(x) = exp(-(1/4)*x^4)/(x^(-2*ln(x)/(ln(x)+1))*exp(-(1/4)*(x^4*ln(x)+x^4+4*ln(ln(x)+1)*ln(x)-8*ln(x)^2+4*ln(ln(x)+1))/(ln(x)+1))*ln(x)^2+2*x^(-2*ln(x)/(ln(x)+1))*exp(-(1/4)*(x^4*ln(x)+x^4+4*ln(ln(x)+1)*ln(x)-8*ln(x)^2+4*ln(ln(x)+1))/(ln(x)+1))*ln(x)+x^(-2*ln(x)/(ln(x)+1))*exp(-(1/4)*(x^4*ln(x)+x^4+4*ln(ln(x)+1)*ln(x)-8*ln(x)^2+4*ln(ln(x)+1))/(ln(x)+1))+ln(x)*c__1+c__1)

odetest(sol_1,ode)

0

sol_2:=simplify(sol_1);

y(x) = 1/((ln(x)+1)*(exp((1/4)*x^4)*c__1+1))

odetest(sol_2,ode);

c__1*x^(ln(x)/(ln(x)+1)+3/(ln(x)+1))*exp(2*ln(x)^2/(ln(x)+1)+(1/4)*x^4)/((ln(x)+1)*(exp((1/4)*x^4)*c__1+1)^2)-c__1*x^3*exp((1/4)*x^4)/((ln(x)+1)*(exp((1/4)*x^4)*c__1+1)^2)

 

 

Download why_simplify_changes_things_at_dec_27_2025.mw

Notice how much simpler the solution becomes after calling simplify. I'd like to use that. But for some reason, odetest now fails to verify the simpler version. Which tells me simplify did something which made the solution not valid.

Here is second example, where calling simplify in betwen did not give zero as expected.

restart:

f := sqrt(1 + sin(x)^2);
F := int(f, x):
df := diff(F, x):
simplify(df - f);

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

0

restart;

f := sqrt(1 + sin(x)^2);
F := int(f, x):
F := simplify(F):
df := diff(F, x):
simplify(df - f);

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

-csgn(1, cos(x))*sin(x)*EllipticE(sin(x), I)

 

 

Download why_simplify_changes_things_at_dec_27_2025_V2.mw

Just trying to understand why this happens and if this is something that could happen sometimes? May be one should avoid calling simplify in middle of computation and let the user decide if they want to simplify the final result or not?

Please Wait...