I have an expression $e^{x-a}(e^{bx}+c)$. I just want it multiplied throughout to get $e^{(b+1)x-a}+ce^{x-a}$. To achieve this I have tried Expand, Simplify, Collect (using pattern Exp[q_*x]). The best output I could get is

(* Exp[-a+x+b*x]+c*Exp[-a+x] *)

I have tried Evaluate after this step to obtain proper exponent, but to no avail. How do I make it come with $e^{(b+1)x-a}$ in the first term?


Make a rule:

Expand[Exp[x - a]*(Exp[b*x] + c)] /. Exp[a_] :> Exp[Collect[a, x]]

enter image description here

See also:


MapAt with specified position:

tmp = Exp[x - a] (Exp[b x] + c) // Expand;
pos = Position[tmp, p_Plus /; ! FreeQ[p, x]];
MapAt[Collect[#, x] &, tmp, pos]    

c E^(-a + x) + E^(-a + (1 + b) x)

  • 1
    $\begingroup$ +1 Thanks a lot. It is nice to be aware of different ways of approaching a problem. $\endgroup$ – Deep Nov 28 '16 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.