# Auto simplifications of power products

Mathematica automatically simplifies Exp[a]Exp[b] to Exp[a+b]. The problem is now that I can't do this Exp[a]Exp[b]/.Exp[a]->c for example. How to solve this kind of problem?

In particular I want something like this to work Exp[x_+y_]//.Exp[x]Exp[y]/.Exp[some_pattern]->c.

-

You may use HoldForm and HoldPattern for your purpose. Suppose you want to replace Exp[i_Integer] by c, then you can do the following:

replace[e_] := e /. Exp[x_ + y_] :> HoldForm[Exp[x] Exp[y]] /. HoldPattern@Exp[a_Integer] -> c

replace[Exp[1 + b] + Exp[2 + d]]
(* c exp(b) + c exp(d) *)

-
That's it. The only thing left is // FixedPoint[ReleaseHold, #] & at the end. – swish Mar 1 '13 at 7:16

Perhaps you want something like

E^a E^b /. E^(a + b_.) :> c E^b
(* c E^b *)


which can be generalized to

E^(a A) E^b /. E^(a _ + b_.) :> c E^b
(* c E^b *)

-

This answer is only applicable to easy examples!

You could try to find the inverse function and give the corresponding replacement rule:

Exp[a]Exp[b]/.a->Log[c]


But you have to be sure, that you don't miss special cases, when using the inverse function.

-
What if I got some pattern instead of a? Exp[A a]Exp[b]/.Exp[A _]->c – swish Feb 28 '13 at 14:59
As I noted, this is only for easy examples. Maybe this could be interesting for you. Though it didn't work for me... – Stefan Feb 28 '13 at 15:22