<s>[INST] Solve the equation $\cos^{-1}\frac{x^2-1}{x^2+1}+\tan^{-1}\frac{2x}{x^2-1}=\frac{2\pi}{3}$ $\cos^{-1}\dfrac{x^2-1}{x^2+1}+\tan^{-1}\dfrac{2x}{x^2-1}=\dfrac{2\pi}{3}$
Let's first find the domain
$$-1<=\dfrac{x^2-1}{x^2+1}<=1$$
$$\dfrac{x^2-1}{x^2+1}>=-1 \text { and } \dfrac{x^2-1}{x^2+1}<=1$$
$$\dfrac{x^2-1+x^2+1}{x^2+1}>=0 \text { and } \dfrac{x^2-1-x^2-1}{x^2+1}<=0$$
$$\dfrac{2x^2}{x^2+1}>=0 \text { and } \dfrac{-2}{1+x^2}<=0$$
$$x\in R$$
$$x^2-1\ne0$$
$$x\ne\pm1$$
$$\cos^{-1}\dfrac{x^2-1}{x^2+1}+\tan^{-1}\dfrac{2x}{x^2-1}=\dfrac{2\pi}{3}$$
$$\pi-\cos^{-1}\dfrac{1-x^2}{1+x^2}-\tan^{-1}\dfrac{2x}{1-x^2}=\dfrac{2\pi}{3}$$
$$\dfrac{\pi}{3}=\cos^{-1}\dfrac{1-x^2}{1+x^2}+\tan^{-1}\dfrac{2x}{1-x^2}$$
Substituting $x$ by $\tan\theta$
$$x=\tan\theta$$
$$\tan^{-1}x=\theta$$
$$\theta\in \left(-\dfrac{\pi}{2},\dfrac{\pi}{2}\right)-\{-\dfrac{\pi}{4},\dfrac{\pi}{4}\}$$
$$\dfrac{\pi}{3}=\cos^{-1}\dfrac{1-\tan^2\theta}{1+\tan^2\theta}+\tan^{-1}\dfrac{2\tan\theta}{1-\tan^2\theta}$$
$$\dfrac{\pi}{3}=\cos^{-1}(\cos2\theta)+\tan^{-1}(\tan2\theta)$$
$$2\theta\in(-\pi,\pi)-\{-\dfrac{\pi}{2},\dfrac{\pi}{2}\}$$
Now we break the range of $2\theta$ into various parts:-
Case $1$: $2\theta\in\left(-\pi,-\dfrac{\pi}{2}\right)$,$\theta\in\left(-\dfrac{\pi}{2},-\dfrac{\pi}{4}\right)$
$$\dfrac{\pi}{3}=2\pi+2\theta+\pi+2\theta$$
$$-\dfrac{8\pi}{3}=4\theta$$
$$-\dfrac{2\pi}{3}=\theta$$
But it is not the range of $\theta$ we assumed
Case $2$: $2\theta\in\left(-\dfrac{\pi}{2},0\right]$,$\theta\in\left(-\dfrac{\pi}{4},0\right]$
$$\dfrac{\pi}{3}=-2\theta+2\theta$$
$$\dfrac{\pi}{3}=0 \text { not possible }$$
Case $3$: $2\theta\in\left(0,\dfrac{\pi}{2}\right)$,$\theta\in\left(0,\dfrac{\pi}{4}\right)$
$$\dfrac{\pi}{3}=2\theta+2\theta$$
$$\dfrac{\pi}{12}=\theta$$
It is coming in the range of $\theta$, so its a valid solution.
$$\tan^{-1}x=\dfrac{\pi}{12}$$
$$x=\tan\dfrac{\pi}{12}$$
$$x=2-\sqrt{3}$$
Case $4$: $2\theta\in\left(\dfrac{\pi}{2},\pi\right)$, $\theta\in\left(\dfrac{\pi}{4},\dfrac{\pi}{2}\right)$
$$\dfrac{\pi}{3}=2\pi-2\theta+2\theta-\pi$$
$$\dfrac{\pi}{3}=\pi \text { not possible }$$
So only solution is $2-\sqrt{3}$, but actual answer is $2-\sqrt{3}, \sqrt{3}$
 [/INST] Following your approach, you are letting $x=\tan(\theta)$ for some $\theta \in (-\pi/2,\pi/2)$, and arriving at $\frac{\pi}{3}=\arccos(\cos(2\theta))+\arctan(\tan(2\theta))$. The important thing is that $\arccos$ maps to $[0,\pi]$ while $\arctan$ maps to $(-\pi/2,\pi/2)$. Thus:


*

*if $2 \theta \not \in [0,\pi]$, then $\arccos(\cos(2\theta)) \neq 2\theta$. In this situation that occurs when $2\theta \in (-\pi,0)$, in which case the arccosine is $-2\theta$ (which geometrically is the corresponding point in the upper half plane).

*if $2\theta \not \in (-\pi/2,\pi/2)$ then $\arctan(\tan(2\theta)) \neq 2\theta$. This occurs here when $2\theta \in (-\pi,-\pi/2)$ and when $2\theta \in (\pi/2,\pi)$. In the first case you have a positive value of tangent in the third quadrant, so you need the corresponding point in the first quadrant, which is $2\theta+\pi$ (represented in $(-\pi/2,\pi/2)$). In the second case, you have a negative value of tangent in the second quadrant, so you need the corresponding point in the fourth quadrant (represented in $(-\pi/2,\pi/2)$). This is $2\theta-\pi$.


Thus you have two cases for the arccosine: $2\theta \in [0,\pi)$ in which case $\arccos(\cos(2\theta))=2\theta$ and $2\theta \in (-\pi,0]$ in which case $\arccos(\cos(2\theta))=-2\theta$. You have three cases for the arctangent: $2 \theta \in (-\pi/2,\pi/2)$ gives $\arctan(\tan(2\theta))=2\theta$, $2 \theta \in (-\pi,-\pi/2)$ gives $\arctan(\tan(2\theta))=2\theta+\pi$, and $2\theta \in (\pi/2,\pi)$ which gives $\arctan(\tan(2\theta))=2\theta-\pi$. Overall this results in four cases:


*

*$2\theta \in (-\pi,-\pi/2] \Rightarrow \arccos(\cos(2\theta))+\arctan(\tan(2\theta))=\pi$

*$2\theta \in (-\pi/2,0] \Rightarrow \arccos(\cos(2\theta))+\arctan(\tan(2\theta))=0$

*$2\theta \in [0,\pi/2) \Rightarrow \arccos(\cos(2\theta))+\arctan(\tan(2\theta))=4\theta$

*$2\theta \in [\pi/2,\pi) \Rightarrow \arccos(\cos(2\theta))+\arctan(\tan(2\theta))=4\theta-\pi$.


Case 3 gives $\theta=\pi/12$; case 4 gives $\theta=\pi/3$.
</s>