Functions that have the same derivative Let’s say I have two continuous functions $f(x)$ and $g(x)$ , and both have the same derivative $h(x)$.
How could I formally show that $f(x)=g(x)+c$ where $c$ is a constant.
I know I have to show that $f(x)-g(x)$ is a constant function but not sure how? 
Thanks
 A: Beware that the statement is not true, unless you make some further assumptions.

If $f$ and $g$ are continuous functions over an interval $I$, differentiable in the interior of $I$, and $f'(x)=g'(x)$ for every $x$ in the interior of $I$, then there exists a constant $k$ such that $f(x)=g(x)+k$, for every $x\in I$.

This is nothing else than the mean value theorem: consider $h(x)=f(x)-g(x)$. Then, for $a<b$ in $I$,
$$
\frac{h(b)-h(a)}{b-a}=h'(c)
$$
for some $c\in(a,b)$. But then $h'(c)=0$, so $h(b)=h(a)$ and therefore $h$ is constant.
The usual counterexample is
$$
f(x)=\arctan x,\qquad g(x)=-\arctan\frac{1}{x}
$$
defined over $\mathbb{R}\setminus\{0\}$.
They have the same derivative, but the difference is not constant. Indeed
$$
f(x)-g(x)=\begin{cases} \pi/2 & x>0 \\[4px] -\pi/2 & x<0 \end{cases}
$$
A: $f'(x)-g'(x) \equiv 0$ given that their derivatives are the same. Now we can apply FTC to this (integrate between some lower limit $a$ and $x$), and this will give you your answer!
A: It suffices to show that if $A'=0$ then $A(x)=c$ for some $c$. But this is clear by the mean value theorem. Indeed fix $x\in \mathbb{R}$ and apply the mean value theorem to the interval $[ x, y]$ to deduce that $A(y)=A(x)$ for all $y>x$. Similarly one can deduce that $A(y)=A(x)$ for all $y<x$ whence $A$ is constant.
A: $$ f^{'}(x) = g^{'}(x) $$
Integrating both sides with respect to x .
$$ \int f^{'}(x) = \int g^{'}(x) $$
$$ f(x) +C_1= g(x) +C_2$$
$$ f(x) - g(x) = C_2 - C_1$$
Since $ C_1$ is a constant and also $C_2$ is a constant so $C_2-C_1$ is also a constant
Thus
$$ f(x) - g(x) = C $$
