How do I find $\arctan\left(\tan\left(\frac{2\pi}{3}\right)\right)$ Question

How do I find $\arctan\left(\tan\left(\frac{2\pi}{3}\right)\right)$?

My thought process
So I first drew a right triangle on the 2nd quadrant as $\frac{\sqrt{3}}{2}$ and $-\frac{1}{2}$ as the legs of the triangles but then I get the answer as $-\sqrt{3}$ for tangent of the angle in the triangle that i drew and I dont know how to evaluate the arctan.
 A: Points to remember:
$(1) $ The range of $\arctan $ is from $(-\frac {\pi}{2 },\frac {\pi}{2}) $.
$(2)$ We have $\tan \frac {2\pi}{3} =\tan (\pi-\frac {\pi}{3}) =-\tan\frac {\pi}{3} =\tan (-\frac {\pi}{3})$.
Hope you can take it from here. 
A: For a straightforward solution to this specific question, you have a good start: since indeed $\displaystyle \tan\frac{2\pi}{3}=-\sqrt{3}$, the expression at hand now takes the form $\displaystyle \arctan\left(\tan\frac{2\pi}{3}\right)=\arctan\left(-\sqrt{3}\right)$. Now you need to recall the (standard) definition of the arctangent function:

$\arctan a=\varphi$ means that $\tan\varphi=a$ and $\displaystyle \varphi\in\left(-\frac{\pi}{2},\frac{\pi}{2}\right)$.

That's why $\displaystyle \frac{2\pi}{3}$ itself cannot be the answer: it's outside the range of the arctangent function. You need to find an angle within this range whose tangent is also $-\sqrt{3}$. Since $\displaystyle \tan\left(-\frac{\pi}{3}\right)=-\sqrt{3}$ and $\displaystyle -\frac{\pi}{3}\in\left(-\frac{\pi}{2},\frac{\pi}{2}\right)$, the final answer is
$$\arctan\left(\tan\frac{2\pi}{3}\right)=\arctan\left(-\sqrt{3}\right)=-\frac{\pi}{3}.$$
For an arbitrary angle $\theta$, for the same reason $\arctan(\tan\theta)\neq\theta$ in general; this is only true if $\displaystyle \theta\in\left(-\frac{\pi}{2},\frac{\pi}{2}\right)$. To find the value of $\arctan(\tan\theta)$ for any other $\theta$ you'll need to do something similar to find an appropriate angle within the range of arctangent. The concept of reference angles can help with that.
A: Let $\theta = \tan^{−1}(\tan (\frac{2π}{3}))$
$\tan \theta =\tan (\frac{2π}{3})$
$\tan \theta = \tan ( π - \frac{π}{3})$
[as tan is in the 2nd quadrant]
$\tan \theta = - \sqrt3$ ......(1)
As $\tan \frac{π}{3} = \sqrt3$
So $\tan (- \frac{π}{3}) = -\sqrt3$
From equation (1),
$\tan \theta = \tan (- \frac{π}{3})$
$\theta = -\frac{π}{3}$
