# Question:how to improve my home made full_simplify() in Maple?

## Question:how to improve my home made full_simplify() in Maple?

Maple 2024

Maple does not have full_simplify() command like with Mathematica.

So I figured why not make one?

Here is a basic implementation. All what it does is blindly tries different simplifications methods I know about and learned from this forum then at the end sorts the result by leaf count and returns to the user the one with smallest leaf count.

I tried it on few inputs.

Advantage of full_simplify() is that user does not have to keep trying themselves. One disadvantage is that this can take longer time. timelimit can be added to this to make it not hang.

Can you see and make more improvement to this function?

May be we all together can make a better full_simplify() in Maple to use. Feel free to edit and change.

```#version 1.0
#increment version number each time when making changes.

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

result:=[simplify(e),
simplify(e,size),
simplify(combine(e)),
simplify(combine(e),size),
simplify(evala( 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:
```

worksheet below

 > #version 1.0   #increment version number each time when making changes. full_simplify:=proc(e::anything)    local result::list;    local f:=proc(a,b)       RETURN(MmaTranslator:-Mma:-LeafCount(a)
 > #test cases T:=[(-192*cos(t)^6 + 288*cos(t)^4 - 912*cos(t)^3 - 108*cos(t)^2 + 684*cos(t) - 54)/(4608*cos(t)^9 - 10368*cos(t)^7 + 6208*cos(t)^6 + 7776*cos(t)^5 - 9312*cos(t)^4 - 2440*cos(t)^3 + 3492*cos(t)^2 + 372*cos(t) - 1169), (10*(5+sqrt(41)))/(sqrt(70+10*sqrt(41))*sqrt(130+10*sqrt(41))), ((6-4*sqrt(2))*ln(3-2*sqrt(2))+(3-2*sqrt(2))*ln(17-12*sqrt(2))+32-24*sqrt(2))/(48*sqrt(2)-72)*(ln(sqrt(2)+1)+sqrt(2))/3, (1/2)*exp((1/2)*x)*(cosh((1/2)*x)-cosh((3/2)*x)+sinh((1/2)*x)+sinh((3/2)*x)) ];

 > full_simplify~(T)

 >