Prove: $\forall x \gt 1, \arctan(\frac{1+x}{1-x}) = \arctan(x) - \frac{3\pi}{4}$

It's not necessary to use integrals. When two functions defined over an interval have the same derivative, they differ by a constant.

This is a consequence of the mean value theorem: if $f$ is a function having zero derivative over an interval, then, for $a,b$ in this interval, $$ \frac{f(b)-f(a)}{b-a}=f'(c)=0 $$ so $f(a)=f(b)$ and $f$ is constant. So, if $f'(x)=g'(x)$ over an interval, the derivative of $F(x)=f(x)-g(x)$ is zero and so $f(x)-g(x)$ is constant.

You have correctly proved that the two functions have the same derivative. Therefore there exists a constant $k$ such that $$ \arctan\frac{1+x}{1-x}=k+\arctan x $$ for every $x>1$.

Now we want to determine $k$. With the limit at $\infty$ is the easiest way: $$ \lim_{x\to\infty}\arctan\frac{1+x}{1-x}=\arctan(-1)=-\frac{\pi}{4} $$ and $$ \lim_{x\to\infty}(k+\arctan x)=k+\frac{\pi}{2} $$ Therefore $$ k+\frac{\pi}{2}=-\frac{\pi}{4} $$ and so $$ k=-\frac{3\pi}{4} $$


If you consider the same for $x<1$, you have $$ \arctan\frac{x+1}{x-1}=k_1+\arctan x $$ for a constant $k_1$ possibly different from the above one. Indeed, if we set $x=0$, we get $$ \arctan1=k_1+\arctan0 $$ so $$ k_1=\arctan1=\frac{\pi}{4} $$


(Edit: the question was edited to get rid of the error.)

Your argument with integrals is faulty. The two functions have the same derivative, but this does not mean their integrals are equal.

What you can say is that, for an arbitrary $x_0>1$,

Your argument with integrals can be made easier as follows: if $x_0>1$ is arbitrary, $$ \arctan\frac{1+x}{1-x}- \arctan\frac{1+x_0}{1-x_0} =\int_{x_0}^x\frac{1}{1+t^2}\,dt =\arctan x-\arctan x_0 $$ by applying the fundamental theorem of calculus.

Since this holds for every $x$ and every $x_0$, you can plug in a particular value of $x_0$ and get the required identity. Again, it's easier to do the limit for $x_0\to\infty$, so $$ \arctan\frac{1+x}{1-x}+\frac{\pi}{4}=\arctan x-\frac{\pi}{2} $$