# FullSimplify not yielding True for Log[a/b] == Log[a] - Log[b]? [duplicate]

I am not receiving True for Log[a/b]==Log[a]-Log[b]. Is there a way around this problem?

• Is this statement true always? What happens when b is complex, or b == 0? Commented May 29, 2022 at 23:25
• @DrMrstheMonarch Oh good point! Is there a way to add conditions to FullSimplify? Commented May 29, 2022 at 23:26
• Look up assumptions in the docs :) Commented May 29, 2022 at 23:26
• It is sufficient to use Simplify, e.g. Simplify[Log[a/b] == Log[a] - Log[b], a != 0 && b > 0] Commented May 29, 2022 at 23:32
• Log[a/b] == Log[a] - Log[b] // PowerExpand
– Alan
Commented May 29, 2022 at 23:34

1. One can use a standard Mma approach of working with logarithms. It is PowerExpand.

PowerExpand treats its expressions assuming all variables are positive. Normally

Log[ab] == Log[a] + Log[b]


is not always true, e.g.

0 = Log[(-1) (-1)] != Log[-1] + Log[-1] == 2 Pi*I

1. One can use Simplify together with the declaration of the variables as positive (if it is true):

 Simplify[Log[a] + Log[b], Assumptions -> a > 0 && b > 0]

(* Log[a b]  *)


PowerExpand[Log[a*b], Assumptions -> a > 0 < b]

 (* Log[a] + Log[b]  *)


In general

PowerExpand[Log[a b], Assumptions -> Element[{a, b}, Complexes]]

(*  2 I \[Pi] Floor[1/2 - Arg[a]/(2 \[Pi]) - Arg[b]/(2 \[Pi])] + Log[a] + Log[b]  *)

1. If I know that the variables are positive, and want to transform logarithms I use the following functions:

expandLog[expr_] := Module[{rule1, rule2, a, b, x, g}, rule1 = Log[a_b_] -> Log[a] + Log[b]; rule2 = Log[a_^x_] -> xLog[a]; g[x_] := (x /. rule1) /. rule2; FixedPoint[g, expr] ];

and

collectLog[expr_] := Module[{rule1a, rule1b, rule2, g, a, b, x},
rule1a = Log[a_] + Log[b_] -> Log[a*b];
rule1b = Log[a_] - Log[b_] -> Log[a/b];
rule2 = x_*Log[a_] -> Log[a^x];
g[x_] := x /. rule1a /. rule1b /. rule2;
FixedPoint[g, expr]
];


They enable me to transform logarithms according to my wish. Try them.

Have fun!