4
$\begingroup$

Is there a function similar to PowerExpand which expand exponentials? This would, for example, take

Exp[5(a + b)] 

and return

Exp[5a]*Exp[5b].
$\endgroup$
2
  • $\begingroup$ Exp[5 a + 6 b] /. Exp[Plus[a_, b_]] :> CenterDot @@ {Exp[a], Exp[b]}, which outputs $e^{5 a}\cdot e^{6 b}$, is one simple way to go. Making it correctly work in all cases might take some tinkering, but it's a step in the right direction. $\endgroup$ Commented Sep 27, 2014 at 3:15
  • 1
    $\begingroup$ Besides given answers take a look at What's the correct method to simplify exponentials? $\endgroup$
    – Artes
    Commented Sep 27, 2014 at 4:14

3 Answers 3

5
$\begingroup$

The desired representation will automatically simplify when evaluated

Exp[5 a]*Exp[5 b]

enter image description here

To get and maintain the desired factored form requires any of several methods of holding the evaluation. As suggested by DumpsterDoofus, one approach is to use an unassigned operator. A slightly modified version of this approach:

expr = Exp[5 (a + b)];

f = CenterDot @@ (Exp /@ List @@
       (Log[#] // PowerExpand // Expand)) &;

invf = # /. CenterDot -> Times &;

expr2 = expr // f

enter image description here

Using the inverse

expr2 // invf

enter image description here

% // Simplify

enter image description here

$\endgroup$
4
$\begingroup$

This could also be a case where the version-10 command Inactive may be useful. Before inserting an inactive version of Exp, I also split up exponents consisting of sums by temporarily replacing powers of E with a function exp that only implements the desired multiplicative property. To cast these replacements in the form of a function expExpand, we have to make sure the expression expr provided as its argument is not touched in any way. That's what the HoldAllComplete attribute is for:

ClearAll[expExpand, exp];
exp[x_Plus] := Times @@ exp /@ x

SetAttributes[expExpand, HoldAllComplete];

expExpand[expr_] := 
 ReleaseHold[Hold[expr] /. E^x_ :> exp[x]] /. exp -> Inactive[Exp]

expExpand[1/2 (E^(5 a) E^(7 b + 8 c + z)) + 1/(1 + E^(4 a))]

inactive

The expression is now displayed in the desired form, with the inactive Exp in a different color. You can then do Activate to get the expression to be returned to its canonical form if desired.

$\endgroup$
1
  • $\begingroup$ It works for my project. Thanks. $\endgroup$
    – hlren
    Commented Jul 21, 2020 at 16:42
1
$\begingroup$

Times is converted internally to power because Times is not a canonical form. I would also suggest the following:

r=Dot @@ Exp /@ Level[(Exp[5 (a + b + c)] // ExpandAll), {2}]
(*E^(5 a).E^(5 b).E^(5 c)*)

if you want to bring back the result,then:

Times @@ r
(*E^(5 a + 5 b + 5 c)*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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