<s>[INST] Solve Sum of Arccos I am working through a situation with trying to fit an equilateral triangle into a square, and I have boiled it down to the following equation:
$$\arccos\left(\frac{\frac{L}{2}+x}{S}\right) + \arccos\left(\frac{\frac{L}{2}-x}{S}\right) = \frac{2}{3}\pi\;\mathrm{rad}$$
I need to solve this equation for $S$. After researching it for a couple of hours, I am still lost on how to resolve the two $\arccos$ terms. Could someone please show me how to go about solving this equation for $S$?
I would really appreciate it!
 [/INST] Notice that: $\cos(A+B)=\cos A \cos B - \sin A \sin B$
In your example $A=\arccos(\frac{\frac{L}{2}+x}{S})$, and $B=\arccos(\frac{\frac{L}{2}-x}{S})$. 
The solution follows from the fact that $\cos(\arccos(x))=x$
A specific solution: 
$\arccos\left(\frac{\frac{L}{2}+x}{S}\right) + \arccos\left(\frac{\frac{L}{2}-x}{S}\right) = \frac{2}{3}\pi\;\mathrm{rad}$
From here, take the cosine of both sides: 
$\cos(\arccos\left(\frac{\frac{L}{2}+x}{S}\right) + \arccos\left(\frac{\frac{L}
{2}-x}{S}\right))=\cos(\frac{2π}{3})$
Using the addition formula above, we find that: 
$\cos(\arccos\left(\frac{\frac{L}{2}+x}{S}\right))\cdot\cos(\arccos\left(\frac{\frac{L}
{2}-x}{S}\right)))-\sin(\arccos\left(\frac{\frac{L}{2}+x}{S}\right))\cdot\sin(\arccos\left(\frac{\frac{L}
{2}-x}{S}\right)))=-\frac{1}{2}$
Notice that, by the Pythagorean relationship: 
$\sin^2(\arccos(x))+\cos^2(\arccos(x))=1$
Therefore: $\sin(\arccos(x))=\sqrt{1-x^2}$. 
Hence, the above equation can be rewritten as: 
$(\frac{\frac{L}{2}+x}{S})\cdot(\frac{\frac{L}{2}-x}{S})-\sqrt{1-(\frac{\frac{L}{2}+x}{S})^2}\cdot\sqrt{1-(\frac{\frac{L}{2}-x}{S})^2}=-\frac{1}{2}$
Or, equivalently: 
$\frac{L^2-4x^2}{4S^2}-\sqrt{(1-(\frac{\frac{L}{2}+x}{S})^2)(1-(\frac{\frac{L}{2}-x}{S})^2)}=-\frac{1}{2}$
And: 
$L^2-4x^2-\sqrt{(-L^2-4Lx+4S^2-4x^2)(-L^2+4Lx+4S^2-4x^2)}=-2S^2$
WolframAlpha tells me (it's probably solvable, but to save time): 
$x=±\frac{1}{2}\sqrt{3}\sqrt{S^2-L^2}$
</s>