Different function with the same derivative

Solution 1:

Note:

$$\tan(A-B)=\frac{\tan A - \tan B}{1+\tan A \tan B}$$

If $x=\tan A$ and $\tan B=1$, then you get:

$$\tan(A-B)=\frac{x-1}{x+1}$$

So $$\arctan x - B = \arctan\left(\frac{x-1}{x+1}\right)$$ So the functions differ by a constant.

(Well, close enough - they actually differ by a constant locally, wherever both functions are defined. The differences will be constant in $(-\infty,-1)$ and in $(-1,\infty)$, but not necessarily the entire real line.)

Solution 2:

Are you surprised from $3-2=10-9$? ;-) I guess you aren't.

Are you surprised from the fact that $f(x)=x^2$ and $g(x)=x^2+1$ have the same derivative? Not at all, I believe.

The same holds in this case, and it's not the only one! For instance, $f(x)=\arcsin x$ and $g(x)=-\arccos x$ have the same derivative! Also $f(x)=\log x$ and $g(x)=\log(3x)$ do.

The conclusion you can draw is that the two functions differ by a constant on each interval where they are both defined. Since $\arctan\frac{x-1}{x+1}$ is defined for $x\ne-1$, you know that there exist constants $h$ and $k$ such that $$ \begin{cases} \arctan\dfrac{x-1}{x+1}=h+\arctan x & \text{for $x<-1$}\\[12px] \arctan\dfrac{x-1}{x+1}=k+\arctan x & \text{for $x>-1$} \end{cases} $$

You can now compute $h$ and $k$, by evaluating the limit at $-\infty$ and at $\infty$: $$ \frac{\pi}{4}=\lim_{x\to-\infty}\arctan\dfrac{x-1}{x+1}= \lim_{x\to-\infty}(h+\arctan x)=h-\frac{\pi}{2} $$ and $$ \frac{\pi}{4}=\lim_{x\to\infty}\arctan\dfrac{x-1}{x+1}= \lim_{x\to\infty}(k+\arctan x)=k+\frac{\pi}{2} $$