Show an identity involving a sum of arctangents of algebraic expressions 
Show that
  $$
2\tan^{-1}\frac{\sqrt{x^2+a^2} - x + b}{\sqrt{a^2-b^2}} + \tan^{-1}\frac{x\sqrt{a^2-b^2}}{b\sqrt{x^2+a^2} + a^2} + \tan^{-1}\frac{\sqrt{a^2-b^2}}{b} = n\pi .
$$

I tried using $$ x= a \tan \theta ,\; b= a \sin\phi,$$
but then calculations are not working out; that is,
I am not able to further simplify.
 A: Since the roots of $\tan x$ are precisely the integer multiples $n \pi$ of $\pi$, applying $\tan$ to be sides gives that the equation is equivalent to
$$\phantom{(ast)} \qquad \tan[2 \arctan A + \arctan B + \arctan C] = 0 \qquad (\ast)$$
for 
$$
A := \frac{\sqrt{x^2 + a^2} - x - b}{\sqrt{a^2 - b^2}} , \qquad
B := \frac{x \sqrt{a^2 - b^2}}{b \sqrt{x^2 + a^2} + a^2} , \qquad
C := \frac{\sqrt{a^2 - b^2}}{b} .
$$
Iterating the tangent sum identity gives a formula for the tangent of the sum of four angles:
$$\tan(\alpha_1 + \alpha_2 + \alpha_3 + \alpha_4)
= \frac{\sum_i \tan \alpha_i - \sum_{i < j < k} \tan \alpha_i \tan \alpha_j \tan \alpha_k}
{1 - \sum_{i < j} \alpha_i \alpha_j + \alpha_1 \alpha_2 \alpha_3 \alpha_4} .$$
So, we can evaluate the left-hand side of $(\ast)$ by setting $\tan \alpha_1 = \tan \alpha_2 = A, \tan \alpha_3 = B, \tan \alpha_4 = C$. Since we only want to check that the sum vanishes, it's show that the numerator is zero, that is, that
$$2 A + B + C - A^2 B - A^2 C - 2 ABC = 0 .$$ Simplifying is a little tedious but straightforward.
A: Hints:


*

*Write the equation as $\tan^{-1}\frac{x\sqrt{a^2-b^2}}{b\sqrt{x^2+a^2} + a^2} + \tan^{-1}\frac{\sqrt{a^2-b^2}}{b} = n\pi - 2\tan^{-1}\frac{\sqrt{x^2+a^2} - x + b}{\sqrt{a^2-b^2}} $

*Apply $\tan$ on both sides and use $\tan (n \pi - 2\alpha) = -\tan 2\alpha$

*Resolve the tangents on the left using $\tan \beta + \tan \gamma =\frac{\tan \beta + \tan \gamma}{1- \tan \beta \tan \gamma}$ and on the right using $\tan(2\alpha) = \frac{2\tan\alpha}{1-\tan^2\alpha}$

*Now you are left with an equation consisting of only algebraic fractions in the variables $a,b,x$
