0

I have the following expression:

Exp[a * x + b * y + c * z]

I want to write this expression as:

Exp[a * x] * Exp[b * y] * Exp[c * z]

How can I force Mathematica to apply this change to an exponential expression?

Alex97
  • 410
  • 2
  • 16
  • Thanks a lot. I mostly find my answer there. But may be there should be a better method for doing this manipulation. @Nasser – Alex97 Dec 05 '21 at 06:52

1 Answers1

1

The desired form automatically simplifies to your original expression, i.e.,

expr = Exp[a*x]*Exp[b*y]*Exp[c*z]

(* E^(a x + b y + c z) *)

Consequently, the desired form will need to be either held or inactive.

expr2 = expr /. E^t_ :> Times @@
    (HoldForm[Exp[#]] & /@ t)

enter image description here

expr2 // ReleaseHold

(* E^(a x + b y + c z) *)

expr3 = expr /. E^t_ :> Times @@ (HoldForm[E^#] & /@ t)

enter image description here

expr3 // ReleaseHold

(* E^(a x + b y + c z) *)

expr4 = expr /. E^t_ :> Times @@ (Inactive[Exp][#] & /@ t)

enter image description here

expr4 // Activate

(* E^(a x + b y + c z) *)

expr5 = expr /. E^t_ :> Times @@ (Inactive[Power][E, #] & /@ t)

enter image description here

expr5 // Activate

(* E^(a x + b y + c z) *)

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
  • Thanks but this is not an answer to my question because the initial expression is the unseparated form Exp[a * x + b * y + c * z] and not Exp[a * x] * Exp[b * y] * Exp[c * z].@Bob-Hanlon – Alex97 Dec 05 '21 at 06:41
  • As shown in the first two lines, expr = Exp[a*x]*Exp[b*y]*Exp[c*z] evaluates to E^(a x + b y + c z); that is its stored value. That is exactly why the desired output must be held or inactive to keep the desired form. Each subsequent expression starts with expr which is E^(a x + b y + c z) – Bob Hanlon Dec 05 '21 at 07:12