<s>[INST] Advanced Functions, How to simplify $\tan \frac{5\pi}{12}$? I was asked to find the exact value of $\,\tan \left(\frac{5\pi}{12}\right)$, so I did up until this point where I got completely stuck.
I split the ratio into two, so $\;\dfrac{5\pi}{12} = \dfrac{\pi}4 + \dfrac{\pi}6\,.$
using the formula, $\tan(x+y) = \dfrac{\tan x+\tan y}{1-\tan x\tan y}$:
$$\tan(\pi/4 + \pi/6) = \frac{1+1/\sqrt 3 }{1-(1)(1/\sqrt 3)
}$$
...
$$\tan(\pi/4 + \pi/6) = \frac{3+\sqrt3}{ 3-\sqrt3 }$$
I'm stuck here, I looked up the answer online, and apparently, you have to times numerator and denominator both by $\,3+\sqrt3\,,\,$ but it's cheating, I don't understand why you have to do that.
 [/INST] So, you've remembered (or re-derived) that $\tan(\frac{\pi}{4}) = 1$ and $\tan(\frac{\pi}{6}) = \frac{1}{\sqrt{3}}$, and plugging this into your sum-of-angles formula gives:
$$\tan(\frac{5\pi}{12}) = \frac{\tan(\frac{\pi}{4}) + \tan(\frac{\pi}{6})}{1 - \tan(\frac{\pi}{4})\tan(\frac{\pi}{6})} = \frac{1 + \frac{1}{\sqrt{3}}}{1 - (1)(\frac{1}{\sqrt{3}})}$$
But fractions within fractions are just ugly, so let's multiply numerator and denominator by $\sqrt{3}$.
$$\tan(\frac{5\pi}{12}) = \frac{\sqrt{3} + 1}{\sqrt{3} - 1}$$
And this is a perfectly valid way of expressing the value (which numerically is approximately 3.732051).  But it's often considered good style to “rationalize the denominator”, i.e., have √ signs only on top and never on bottom.
Recall the FOIL method for multiplying two binomials, and that $$(a - b)(a + b) = a^2 + ab - ab - b^2 = a^2 - b^2$$
So, if you multiply a binomial by the same thing but with the opposite sign, then only squared terms occur in the product, so any √ signs go away.  So let's multiply the denominator by $\sqrt{3} + 1$.  Of course, we need to multiply the numerator by $\sqrt{3} + 1$ too so that the value of the expression doesn't change
$$\frac{\sqrt{3} + 1}{\sqrt{3} - 1} \times \frac{\sqrt{3} + 1}{\sqrt{3} + 1}$$
$$= \frac{3 + 2\sqrt{3} + 1}{3 - 1}$$
$$= \frac{4 + 2\sqrt{3}}{2}$$
$$= 2 + \sqrt{3}$$
</s>