Message Boards Message Boards

0
|
6966 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Converting sum of logarithms to the logarithm of a product?

Posted 8 years ago

I know there is some sort of external function to convert

Log[x]+Log[y] 

into

Log[x y]

but cannot find it. Any help?

POSTED BY: Robert Curl
3 Replies

Thanks for the help. Both ideas look good. Bob

POSTED BY: Robert Curl

You can do it with Simplify with assumptions

Simplify[Log[x] + Log[y], x > 0 && y > 0]

or with a replacement rule:

logRule = a_. Log[x_] + b_. Log[y_] :> Log[x^a*y^b];
Log[x] + Log[y] - Log[3] //. logRule

Beware that the rule has restrictions on its valididy.

POSTED BY: Gianluca Gorni

Greetings Bob, from Sy Blinder

The rule for sum of logs doesn't appear to be built in to Mathematica. But try the following workaround:

In[13]:= Log[Exp[Log[x] + Log[y]]]

Out[13]= Log[x y]
POSTED BY: S M Blinder
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract