I have a Mathematica program that outputs a piecewise function, and some parts of the expression are not being recognised as specific numbers when using FullSimplify. For example, in the output there is

ArcCos[3/5] + 2 ArcSec[Sqrt[5]]

which is actually equal to $\pi$, and there is also

ArcCos[3/5] - 2 ArcCos[2/Sqrt[5]]

which is actually equal to $0$.

I was wondering if there was a way to have Mathematica recognise these sort of outputs in their more simplified form. I know that I can use numerical approximation, but was wondering if it was possible to do so while keeping the output in exact/closed form.

  • $\begingroup$ @Kuba Perhaps I worded my question poorly; I am saying that the two expressions are equal to $\pi$ and $0$ respectively, and would like the output to have $\pi$ and $0$ as opposed to the trigonometric expressions above. $\endgroup$
    – Ross Pure
    Apr 16 '14 at 7:57
  • $\begingroup$ @Kuba $\cos^{-1}(x)$ is not $1/\cos(x)$: N[ArcCos[3/5] - 2 ArcCos[2/Sqrt[5]]] (how do I format code in answers/comments?) $\endgroup$
    – Ross Pure
    Apr 16 '14 at 8:03
  • $\begingroup$ @Kuba I know it does, that's why I used it in my question. $\endgroup$
    – Ross Pure
    Apr 16 '14 at 8:05
  • $\begingroup$ @kuba Sorry read your comment wrong, just thought it was standard notation. $\endgroup$
    – Ross Pure
    Apr 16 '14 at 8:06
  • 1
    $\begingroup$ Closely related: mathematica.stackexchange.com/q/40080/121 $\endgroup$
    – Mr.Wizard
    Apr 16 '14 at 9:12

It seems that Mathematica can handle this when you switch to Exp form of expressions:

ArcCos[3/5] + 2 ArcSec[Sqrt[5]] // TrigToExp // FullSimplify
ArcCos[3/5] - 2 ArcCos[2/Sqrt[5]] // TrigToExp // FullSimplify
  • $\begingroup$ Accepting this answer because it looks like it will solve any potential problem of this type. However, the two examples given are the only ones I know of, so I can't test further. Thanks. $\endgroup$
    – Ross Pure
    Apr 16 '14 at 8:17

I don't think this will work in every possible case but for your examples you could write a function doing :

expr1 = ArcCos[3/5] + 2 ArcSec[Sqrt[5]];
expr2 = ArcCos[3/5] - 2 ArcCos[2/Sqrt[5]];

Solve[{Sin[x] == (Sin[expr1] // TrigExpand), 
       Cos[x] == (Cos[expr1] // TrigExpand), -π < x <= π}, x, Reals]
(* {{x -> π}} *)

Solve[{Sin[x] == (Sin[expr2] // TrigExpand), 
       Cos[x] == (Cos[expr2] // TrigExpand), -π < x <= π}, x, Reals]
(* {{x -> 0}} *)

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.