10
$\begingroup$

Why does TrueQ return False on the following?

TrueQ[Log[2]/Log[8] == 1/3]
(* False *)

Shouldn't that be True? We can clearly see that the math checks out.

Log[2]/Log[8] // N
(* 0.333333 *)

8^(1/3)
(* 2 *)
$\endgroup$
5
  • $\begingroup$ TrueQ[Log[2]/Log[8] == 1/3] returns True with version 10 on Windows 7. $\endgroup$ Jul 26, 2014 at 10:25
  • $\begingroup$ I get False from V9, but True from V10. $\endgroup$
    – m_goldberg
    Jul 26, 2014 at 10:34
  • $\begingroup$ TrueQ[N[Log[2]/Log[8]] == 1/3] returns True.. :) Or TrueQ[Log[2.]/Log[8] == 1/3]. $\endgroup$
    – Öskå
    Jul 26, 2014 at 10:48
  • $\begingroup$ I get False with version 8.0.4 and True with v.10.0.0 under Win7 x64. $\endgroup$ Jul 26, 2014 at 14:23
  • $\begingroup$ I get TrueQ[Log[2.]/Log[8] == 1/3] as True in M9. And False for TrueQ[Log[2]/Log[8] == 1/3] in M9. Both returns True in M10. $\endgroup$
    – m0nhawk
    Jul 28, 2014 at 19:03

2 Answers 2

9
$\begingroup$

TrueQ does not attempt to resolve equivalencies:

TrueQ will return True only if the input is explicitly True

You can use TrueQ to "assume" that a test fails when its outcome is not clear.

Consider:

eq = D[Integrate[1/(x^3 + 1), x], x] == 1/(1 + x^3)
1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(3 (1 + 1/3 (-1 + 2 x)^2)) == 1/(1 + x^3)

This is not explicitly True – it is an equation, and TrueQ will yield False, but you can Simplify:

Simplify[eq]
True
$\endgroup$
3
$\begingroup$

In older versions use Simplify

$Version

"9.0 for Mac OS X x86 (64-bit) (January 24, 2013)"

TrueQ[Log[2]/Log[8] == 1/3]

False

TrueQ[Log[2]/Log[8] == 1/3 // Simplify]

True

$\endgroup$
2
  • $\begingroup$ Using Simplify works with newer versions, too including 10.4. $\endgroup$
    – murray
    Mar 11, 2016 at 23:25
  • $\begingroup$ @murray - Yes. But it is not needed then. This was to address a workaround for earlier version for which TrueQ did not work on its own. $\endgroup$
    – Bob Hanlon
    Mar 11, 2016 at 23:30

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.