Question: why can't Maple simplify this?

according to what is new in Maple 2025, it says

  • Maple 2025 introduces several important improvements to simplify regarding expressions containing exponential, trigonometric, hyperbolic, and/or inverse trigonometric functions, resulting in more compact results. Other commands in the math library also provide simpler results due to these improvements.

But I still see weakness in simplify. (see also recent question).

Here is an example, A and B below are equivalent mathematically. But A is almost twice as big. So one would expect simplify(A) to return B. right? But it does not. Also using size option has no effect.  

Does one need more tricks in Maple to make it simplify this? Is this not something that a powerful CAS software like Maple should have been able to do?

interface(version);

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


A:=(-8*x - 16)*exp(x/2) + x^2 + 4*x + 16*exp(x) + 4;
B:=(4*exp(x/2)-x-2)^2;

(-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4

(4*exp((1/2)*x)-x-2)^2

#check leaf size
MmaTranslator:-Mma:-LeafCount(A);

22

MmaTranslator:-Mma:-LeafCount(B);

13

#check they are the same
simplify(A-B);

0

#then why Maple can not simplify A to B ??
simplify(A);
simplify(A,size);
simplify(A,size,exp);
simplify(A) assuming real;

(-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4

(-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4

(-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4

(-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4

Student:-Precalculus:-CompleteSquare(A)

(-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4

 

 

Download why_can_not_simplify_may_4_2025.mw

Using another software, all what is needed is call to Simpify to do it:

I also tried my most power full_simplify() function in Maple, and it had no effect

full_simplify:=proc(e::anything)
   local result::list;
   local f:=proc(a,b)
      RETURN(MmaTranslator:-Mma:-LeafCount(a)<MmaTranslator:-Mma:-LeafCount(b))
   end proc;

   #add more methods as needed

   result:=[simplify(e),
            simplify(e,size),
            simplify(combine(e)),
            simplify(combine(e),size),
            radnormal(evala( combine(e) )),
            simplify(evala( combine(e) )),
            evala(radnormal( combine(e) )),
            simplify(radnormal( combine(e) )),
            evala(factor(e)),
            simplify(e,ln),
            simplify(e,power),
            simplify(e,RootOf),
            simplify(e,sqrt),
            simplify(e,trig),
            simplify(convert(e,trig)),
            simplify(convert(e,exp)),
            combine(e)
   ];   
   RETURN( sort(result,f)[1]);   

end proc:

Calling full_simplify(A) did not simplify it.

Please Wait...