Question: Factoring expressions with exponentials

I am trying to figure out how to factor expressions like:

1+2*exp(x)+exp(2*x)

Simply trying factor does not work.

factor(1+2*exp(x)+exp(2*x)) => 1+2*exp(x)+exp(2*x)

Of course, I can force a substitution and make it work:

factor(subs(exp(2*x)=exp(x)^2,1+2*exp(x)+exp(2*x))) => (exp(x)+1)^2

In general however, I would like to not have to specify a substitution or even what is in the exponent!

Any help would be appreciated.

Thanks.

Please Wait...