<s>[INST] Tricky simplification problem $\frac{ \sqrt{x^2+a^2}\,\sqrt{(c-x)^2+b^2}\,\sin(180-\arctan(\frac ax)-\arctan(\frac {b}{c-x}))}2 $ So when solving an optimising the area of a triangle problem (maximising the area), I found a formula for the area listed below:
$$\text{Area}=\frac{\sqrt{x^2+a^2}\,\sqrt{(c-x)^2+b^2}\,\sin\Bigl(180-\arctan\bigl(\frac ax\bigl)-\arctan\bigl(\frac {b}{c-x}\bigl)\Bigl)}{2}$$
As you can see, it is rather ugly and a pain to optimize for $x$ (when $a$, $b$ and $c$ are constant). I later came upon a much better and easier formula for the area, which was very simple and easy to optimize.
Afterwards, it occurred to me out the monster above and the easier formula for area I worked out below, were equivalent - but I have no idea how to simplify the one above into the one below, so explanations and steps are very much appreciated.
For those (crazy) people who want to try simplifying the above without knowing the end result, the answer below is hidden.

 $$\text{Area}=\frac{ac-x(a-b)}{2}$$

 [/INST] let $\tfrac{a}{x}=u$ and $\tfrac{b}{c-x}=v$. In the case of $uv<1:$ $arctg(u)+arctg(v)=arctg\tfrac{u+v}{1-uv}$
$$sin(arctgx)=\tfrac{x}{\sqrt{1+x^2}}$$
$$sin(arctg\tfrac{u+v}{1-uv})=\tfrac{u+v}{1-uv}\cdot\tfrac{1}{\sqrt{1+(\tfrac{u+v}{1-uv})^2}}=\tfrac{u+v}{\sqrt{1+(uv)^2+u^2+v^2}}=\tfrac{u+v}{\sqrt{(u^2+1)(v^2+1)}}$$
using $sin(\pi-\alpha)=sin\alpha$ and back to our substitution:
$$Area=\tfrac{1}{2}\sqrt{x^2+a^2}\cdot\sqrt{(c-x)^2+b^2}\cdot\tfrac{\tfrac{a}{x}+\tfrac{b}{c-x}}{\sqrt{\tfrac{a^2+x^2}{x^2}\cdot\tfrac{b^2+(c-x)^2}{(c-x)^2}}}=$$
$$=\tfrac{1}{2}\cdot(c-x)x(\tfrac{a}{x}+\tfrac{b}{c-x})=\tfrac{ac-x(a-b)}{2}$$
</s>