Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Log Simplify' topicStudent Support Forum > General > Archives > "Log Simplify"

Help | Reply To Topic
Author Comment/Response
Sinval Santos
10/15/99 11:02pm

I wrote the following rule:

logRule[exp_]:=
exp //. {c_ Log[a_] - c_ Log[b_] :> c Log[a/b],
c_ Log[a_] + c_ Log[b_] :> c Log[a b]}

Using this rule to simplify the expression below:

In[1]: woi = I Log[2 - x^2] - I Log[x - 1];
Out[1]: - I Log[x - 1] + I Log[2 - x^2]

In[2]: logRule[woi]
Out[2]: - I Log[x - 1] + I Log[2 - x^2]

The expression didn't obey the rule. Now substituting the '' I '' to put '' a '' the rule it works. (Where I=Sqrt[-1])

In[3]: woa = a Log[2 - x^2] - a Log[x - 1];
Out[3]: - a Log[x - 1] + a Log[2 - x^2]

In[4]:logRule[woa]
Out[4]:a Log[(2 - x^2)/(-1 + x)]

Because this happens?

Sinval Santos

URL: ,
Help | Reply To Topic