Simplification not working as hoped.



Thanks for the reply Stavros,  I thought I had given the orignal
expression:

f:(exp(x)+exp(x/2))/(exp(x/2)+1);

I get there using ratsimp or factor on the result of a limit from
something a bit more complicated.  It's the next simplification that
doesn't always work, as I described. Radcan works, but I think that
factor should be able to factor something as simple as my f.

David


On Fri, 2012-04-27 at 17:00 -0400, Stavros Macrakis wrote:
> We might be able to help if you could share your original expression.
> 
> 
> But I don't really understand your question.  You say that radcan puts
> your expression in the form you want.  So use radcan! -- Why would you
> expect ratsimp or trigsimp or default simplification to do the same
> thing as radcan?
> 
> 
> As for representing exponentials as hyperbolic functions, here's an
> approach that will often work:
> 
> 
> (%i1) ex: %e^(a*x) + %e^(x-b)$
> 
> 
> (%i3) subst(%e^(qq*%i*x),%e,ex);
> (%o3) %e^(%i*a*qq*x^2)+%e^(%i*qq*x*(x-b))
> 
> 
> (%i4) rectform(%);
> (%o4) %i*(sin(a*qq*x^2)+sin(qq*x*(x-b)))+cos(a*qq*x^2)+cos(qq*x*(x-b))
> (%i5) subst(-%i,qq,%);
> (%o5) %i*(-%i*sinh(a*x^2)-%i*sinh(x*(x-b)))+cosh(a*x^2)+cosh(x*(x-b))
> (%i6) ratsimp(%);
> (%o6) sinh(x^2-b*x)+cosh(x^2-b*x)+sinh(a*x^2)+cosh(a*x^2)
> 
> 
> or...:
> 
> 
> (%i8) demoivre(%o3);
> (%o8) %i*sin(a*qq*x^2)+cos(a*qq*x^2)+%
> i*sin(qq*x*(x-b))+cos(qq*x*(x-b))
> (%i9) subst(-%i,qq,%);
> (%o9) sinh(a*x^2)+cosh(a*x^2)+sinh(x*(x-b))+cosh(x*(x-b))
> 
> 
> Does this help in your case?
> 
> 
>             -s
> 
> 
> -----------------------------------
> 
> On Fri, Apr 27, 2012 at 15:32, David Ronis <David.Ronis at mcgill.ca>
> wrote:
>         I have an expression that ultimately becomes:
>         
>         f:(exp(x)+exp(x/2))/(exp(x/2)+1);
>         
>         I've tried various simplification routines:
>         
>         
>                                      ratsimp(f);
>                                      trigsimp(f);
>                                       radcan(f);
>         
>         
>         The only one that works is radcan().   Is there a flag that
>         would make the other ones work?  Alternately, is there a
>         function that
>         forces the exponentials to be represented as sums of
>         hyperbolic
>         functions?
>         
>         
>         
>         _______________________________________________
>         Maxima mailing list
>         Maxima at math.utexas.edu
>         http://www.math.utexas.edu/mailman/listinfo/maxima
> 
>