# Are these expressions not equal? Mathematica output is ambiguous

The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:

Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]


An attempt to simplify indicates the expressions are not equal:

FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]


That gives the following answer:

(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]


• Add the option Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts. – Sjoerd Smit Mar 22 at 10:29
• In addition to what Sjoerd said: Evaluating FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0. – Henrik Schumacher Mar 22 at 10:41
• Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell FullSimplify[] what you know about P, so of course you get a general result. – J. M. is away Mar 22 at 11:48

Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]

FullSimplify will confirm that result.
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]