how to simplify



On 13/03/2011 2:26 PM, Michael Carey wrote:
> Dear group, I have an equation:
>
> -(%e^(-log(e)*x-x)*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x)+(-%
> c*log(e)^2+2*%c*log(e)-5*%c)*%e^(log(e)*x)))/((log(e)^2-2*log(e)+5)*x)
>
> I am hoping it is equal to a much smaller equation, how do I simplify
> it? I have already used ratsim() and completeratsimp() (names?)
radcan() may help here.

(%i1) display2d:false;
(%o1) false
(%i2) 
ex:-(%e^(-log(e)*x-x)*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x)+(-%c*log(e)^+2*%c*log(e)-5*%c)*%e^(log(e)*x)))/((log(e)^2-2*log(e)+5)*x);
(%o2) -%e^(-log(e)*x-x)*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x)
                                                  +(-%c*log(e)^(2*%c*log(e))
                                                   -5*%c)
                                                   *%e^(log(e)*x))
        /((log(e)^2-2*log(e)+5)*x)
(%i3) radcan(ex);
(%o3) -%e^-x*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x)
                                       +e^x*(-%c*e^(2*%c*log(log(e)))-5*%c))
        /(e^x*(log(e)^2-2*log(e)+5)*x)

You may also want to pull this result apart and work on the pieces.

(%i4) num(%);
(%o4) -%e^-x*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x)
                                       +e^x*(-%c*e^(2*%c*log(log(e)))-5*%c))
(%i5) expand(%);
(%o5) -log(e)*sin(2*x)+sin(2*x)-2*cos(2*x)+%c*e^(x+2*%c*log(log(e)))*%e^-x
                       +5*%c*e^x*%e^-x

I would rename variable e, as e and %e are easily confused.  You might 
also consider substituting for log(e) rather than e.