Question: Simplification with complex values

I'd like to get the simplest possible expression when using simplify. The problem is that this is all done in a program, without having the benifit of looking at the expression on the screen and trying things. So I need a method that works for large set of input all the time.

I noticed in this example that simplify did not do what I think it should have.

Given the expression -2*(x^3 + 2)/(x*(x + 1)*(sqrt(3)*I + 2*x - 1)*(sqrt(3)*I - 2*x + 1)) it can be simplified to (x^3 + 2)/(2*x^4 + 2*x) but  I had to go into many tries in order to get this final result.

Is there a better way to do this? I end up now   doing simplify(expand(numer(expr))/expand(denom(expr))) in the hope to get better simplification.  Here is an example

interface(version);

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

restart;

w:=-2*(x^3+2)/x/(x+1)/(I*3^(1/2)+2*x-1)/(I*3^(1/2)-2*x+1);

-2*(x^3+2)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(w)

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(evalc(w))

(1/2)*(x^3+2)/((x^2-x+1)*(x+1)*x)

simplify(w) assuming x::real

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(w,size)

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(w,symbolic)

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(w,sqrt)

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(expand(numer(w))/expand(denom(w)))

(x^3+2)/(2*x^4+2*x)


It would be nice if Maple simplify would just do it directly as follows in Mathematica. May be there is a an  option I am overlooking

 

Download simplify.mw

Please Wait...