5
$\begingroup$

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]

enter image description here

$\endgroup$
3
  • 3
    $\begingroup$ 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. $\endgroup$ Commented Mar 22, 2019 at 10:29
  • 1
    $\begingroup$ 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. $\endgroup$ Commented Mar 22, 2019 at 10:41
  • 1
    $\begingroup$ 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. $\endgroup$ Commented Mar 22, 2019 at 11:48

1 Answer 1

11
$\begingroup$

You can ask Mathematica when this expression is zero, assuming we work on the reals:

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

FullSimplify will confirm that result.

FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
(* 0 *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.