Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
@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. – Ross Pure Apr 16 '14 at 7:57
@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?) – Ross Pure Apr 16 '14 at 8:03
@Kuba I know it does, that's why I used it in my question. – Ross Pure Apr 16 '14 at 8:05
@kuba Sorry read your comment wrong, just thought it was standard notation. – Ross Pure Apr 16 '14 at 8:06
Closely related: – Mr.Wizard Apr 16 '14 at 9:12
up vote 3 down vote accepted

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
share|improve this answer
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. – 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}} *)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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