Group Abstract Group Abstract

Message Boards Message Boards

0
|
693 Views
|
5 Replies
|
5 Total Likes
View groups...
Share
Share this post:

How do you expand Exp[a+b] to Exp[a] Exp[b] ?

Posted 1 month ago

Hello

To achieve this result all my attemps with Simplify, PowerExpand failed :

PowerExpand[Exp[a+b]]
Simplify[Exp[a+b],Assumptions->{a,b} \[Element] Reals]

Using patterns I cannot get a transformation with

Exp[a + b] /. Power[E, Plus[a_ + b_] ] -> Exp[a] Exp[b]

Thanks

POSTED BY: Jan Potocki
5 Replies

The pattern replacement does work - but the product Exp[a] Exp[b] is immediately simplified back to Exp[a+b], as you can see e.g. like so:

TracePrint[Exp[a + b] /. Power[E, Plus[a_ + b_]] :> Exp[a] Exp[b], Times[__]]

Does instead something like this work for you?

Exp[a + b] /. Power[E, Plus[a_ + b_]] :> Inactivate[Exp[a] Exp[b], Times]
POSTED BY: Henrik Schachner
Posted 1 month ago
POSTED BY: Eric Rimbey

As Henrik has said, Times[] and Power[] automatically combine powers with like bases. The principal reason for fighting against the flow is to format output, I suppose. If it's not and you want to do some algebraic computation with the products of powers separated, it might be good to say what that problem is. It is rather difficult to get Times[] and Power[] to behave differently.

There are two or three approaches to formatting output when another form than the standard Mathematica output is desired, HoldForm[], Defer[], and boxes (with various tools like MakeBoxes[], ToBoxes[], RawBoxes[] and DisplayForm[]). Boxes are the most complicated, and I'll skip that approach. Here are variations on Henrik's approach:

res1 = Exp[a + b] /. Power[E, Plus[a_ + b_]] :> Defer[E^a*E^b]
% // InputForm
(*  E^a E^b  *)
(*  Defer[E^a*E^b]  *)

res2 = Exp[a + b] /. Power[E, Plus[a_ + b_]] :> HoldForm[E^a*E^b]
% // InputForm
(*  E^a E^b  *)
(*  HoldForm[E^a*E^b]  *)

Note that the HoldForm[] is present even if you copy and paste the output. The Defer[] is part of the result res1, but it is stripped if you copy the output, which is convenient for interacting with a notebook. If you use either variable res1 or res2 in further computation, use First[res1] or First[res2] to remove the head. The powers will combine, of course, but look at what you get if you compute res1^2 or res2 / E^a without First[].

POSTED BY: Michael Rogers

This factorizes it, in a way:

In[13]:= E^(a + b) // ExpToTrig // TrigExpand // Factor

Out[13]= (Cosh[a] + Sinh[a]) (Cosh[b] + Sinh[b])
POSTED BY: Gianluca Gorni
Posted 1 month ago

Yes Michael I want to do further calculations with the powers of variables separated. With Defer, HoldForm , Inactivate as suggested and using Part afterwards I can proceed further.

Thanks to Michael and Henryk

POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard