> Show that $$f(x) = \arctan\left(\frac{x}{x+1}\right) + \arctan\left(\frac{x+1}{x}\right) = \frac{\pi}{2} \quad \forall x \in (-\infty, -1)\large\cup (0, \infty)$$
I observed this feature graphically, but am looking for a way to prove it. My attempt is as follows:
> We can show that $$\arctan(A) + \arctan(B) = \arctan\left(\frac{A+B}{1 - AB}\right)$$
> It follows that <p>$$\displaylines{f(x) = \arctan\left(\frac{x}{x+1}\right) + \arctan\left(\frac{x+1}{x}\right) = \arctan\left(\frac{\frac{x}{x+1} + \frac{x+1}{x}}{1 - \left(\frac{x}{x+1}\right)\left(\frac{x+1}{x}\right)}\right) \cr = \arctan\left(\frac{\frac{x}{x+1} + \frac{x+1}{x}}{1 - 1}\right) = \arctan\left(\frac{\frac{x}{x+1} + \frac{x+1}{x}}{0}\right) = \arctan(\infty) = \boxed{\frac{\pi}{2}}}$$</p>
My attempt has a few questionable steps. The first is the deduction that division by 0 yields $\infty$. Secondly, I have been unable to consider the appropriate domain. Although my steps exclude for $-1$ and $0$, I don’t think they accurately consider values in between. I would appreciate if someone can make this "intuitive" proof more rigorous/concrete. I am also open to alternate solutions, but I would also appreciate comments on my attempt.