1
$\begingroup$

Grandson and I are working on integrating trigonometric functions and he asked if Mathematica could be used to "prove" a trigonometic identity. We looked over various functions and it looked like "Equal" would be our best bet.

However, while "Equal", represented by two == signs, works when faced with simple identities such as:

 Tan[alpha] == 1 / Cot[alpha]

 True

it seems to "fail" when given more complex identities such as

 Sec[alpha]^4 - Sec[alpha]^2 == Tan[alpha]^4 + Tan[alpha]^2.

In those cases, it simply repeats the input as the output with no other other indication as to why, etc.

We've tried this with several other known identities with the same result.

Is there a better function for this? Or, are we asking too much of Mathematica, etc.

$\endgroup$
  • $\begingroup$ Try Simplify[Sec[alpha]^4 - Sec[alpha]^2 == Tan[alpha]^4 + Tan[alpha]^2] Sometimes that might not be enough and you might need to tell Simplify that alpha is Real or positive or an integer or ... $\endgroup$ – Bill Jul 9 '18 at 4:43
  • $\begingroup$ I would not say "prove". I would say "check". As in "How do I Use Mathematica to Check a Trigonometric Identity?" $\endgroup$ – Lotus Jul 9 '18 at 10:28
  • $\begingroup$ == is not exactly for testing equality. It will only returns True if the LHS and RHS are literally identical. Otherwise, it simply stands to represent an equality which may be true for all, some or no values of the variables. What happened here is that 1 / Cot[x] immediately evaluated to Tan[x], making the two sides not only mathematically but also literally identical. $\endgroup$ – Szabolcs Jul 9 '18 at 11:40
1
$\begingroup$

Just add "//Simplify" at the end

Sec[alpha]^4 - Sec[alpha]^2 == Tan[alpha]^4 + Tan[alpha]^2 // Simplify
$\endgroup$
  • $\begingroup$ That definitely worked for that identity that we knew is true. However, if we give it an identity that we know is false, such as Sin[x] == 1 / Cos[x] //Simplify, then it simply outputs the original input with no answer as to why. Does this indicate "False"? It looks like from the documentation that it is setting up the "relation" to be subsequently processed by another command such as Solve: Solve[%,x]. Is there a command that will tell us definitively if the identity is false? $\endgroup$ – OilerMan Jul 9 '18 at 5:04
  • $\begingroup$ Yes, you can use "PossibleZeroQ", for example "PossibleZeroQ[Sin[x] - (1/Cos[x])]" would return False. Please Note that the Syntax is crucial here. If you do Something like "Tan[x]==1/Cot[x] //PossibleZeroQ", this would return "False" (which is not true), instead the right thing to do is "PossibleZeroQ[Tan[x]-1/Cot[x]]" or "Tan[x]-1/Cot[x] //PossibleZeroQ", which now returns True (as it should). For more info, there is an older post on this (mathematica.stackexchange.com/a/7474) $\endgroup$ – nick Jul 9 '18 at 5:56
  • $\begingroup$ The PossibleZeroQ option has worked very well and the alternate methods described in the older post you referenced are appreciated. $\endgroup$ – OilerMan Jul 9 '18 at 22:50
4
$\begingroup$
Reduce[ForAll[x, Sin[x] == 1/Cos[x]], Reals]

(*   False   *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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