<s>[INST] Different constants of integration on different intervals I tried to prove that on the interval $(-1,\infty)$ that: $$\arctan\left(\frac{x-1}{x+1}\right)=\arctan(x)-\frac{\pi}{4}$$
So I defined: $$f(x)=\arctan\left(\frac{x-1}{x+1}\right)-\arctan(x)$$
Then apparently: $$f'(x)=0$$
Therefore $f(x)$ is constant thus:
$$f(x)=\arctan\left(\frac{x-1}{x+1}\right)-\arctan(x)=C$$
$$\arctan\left(\frac{x-1}{x+1}\right)=\arctan(x)+C$$
Taking $x=0$ gives $C=-\frac{\pi}{4}$
Thus is proven: $$\arctan\left(\frac{x-1}{x+1}\right)=\arctan(x)-\frac{\pi}{4}$$
QUESTION: Why does $C$ have a different value for $x<-1$? Why does the above reasoning only apply to the interval $(-1,\infty)$ How to find $C$ for $x<-1$?
 [/INST] From the Article $240,$ Ex$-5$ of Plane Trigonometry(by Loney),
$$\arctan x+\arctan y=\begin{cases} \arctan\frac{x+y}{1-xy} &\mbox{if } xy<1\\ \pi+\arctan\frac{x+y}{1-xy} & \mbox{if } xy>1 \\ \text{sgn}(x)\dfrac\pi2 & \mbox{if } xy=1 \end{cases} $$
As $\arctan(-u)=-\arctan u,$
Setting $y=-1,$
$$\arctan x-\dfrac\pi4=\begin{cases} \arctan\frac{x-1}{1+x} &\mbox{if } -x<1\iff x>-1\\ \pi+\arctan\frac{x-1}{1+x} & \mbox{if } -x>1\iff x<-1 \\ -\dfrac\pi2 & \mbox{if } -x=1\iff x=-1 \end{cases} $$
Do you notice tthe different constants?
</s>