Two expressions for potential energy in the gravitational field of the earth Let $M$ be the mass of the earth, considered as a point mass, then the potential energy of a point with distance $r$ away from the center (assume $r > \textrm{radius of earth})$ is
$$
 U(r) = -\frac{G M m} r = -\frac{gm}{r}
$$
with $g := G\cdot M$. Now, as it is written in the textbooks, the potential energy of a body of height $h$ on earth is approximately
$$
 U(h) = mgh.
$$
Now for me both expression contradict each other, one is negative, the other positive, one decreases as $r \to \infty$, the other increases as $h \to \infty$ (and the height is directly related to the distance/radius $r$ I think).
So whats my misconception, what have I missed that I came to conclusion that both expression contradict each other? Thanks for any help!
EDIT: Changed
$$
 U(r) = -\frac{GM}{r} = -\frac{g}{r}
$$
to 
$$
 U(r) = -\frac{GMm}{r} = \frac{gm}{r}.
$$
 A: Notice that $h$ and $r$ are related in the following way:
\begin{align}
    r = R + h
\end{align}
where $R$ is the radius of the Earth (the distance from the center to the surface) and $h$ is the height above the surface.  Then notice that
\begin{align}
    U = -\frac{GmM}{r} = -\frac{GMm}{R+h} = -\frac{GMm}{R}\left[1 -\frac{h}{R} + O(\frac{h}{R})^2\right].
\end{align}
Now $g$ is defined as the magnitude of the acceleration due to gravity at the surface of the Earth, namely
\begin{align}
    g = \frac{GM}{R^2}
\end{align}
so we can write
\begin{align}
    U = -mgR\left[1 -\frac{h}{R} + O(\frac{h}{R})^2\right]
\end{align}
Now we simply note that the potential energy is only defined up to an additive constant, so we can add $mgR$ to this expression to obtain
\begin{align}
  U = mgR\left[\frac{h}{R} + O(\frac{h}{R})^2\right].
\end{align}
In other words, the formula $mgh$ is the approximate form of the more precise formula $-GmM/r$ for heights $h$ above the surface of the Earth that are small compared to the radius R$ of the Earth since when that ratio is small, the higher order terms in brackets on the right hand side can be neglected to good approximation.
A: The first the expression $U(r) = -\frac {GM} r$ is a potential, but not potential energy. The units are velocity2. This is a widely used potential in solar system astronomy, geology, geophysics, and in aerospace engineering. For example, see http://ocw.mit.edu/courses/earth-atmospheric-and-planetary-sciences/12-201-essentials-of-geophysics-fall-2004/lecture-notes/ch2.pdf beginning at the bottom of the third page.
This becomes energy when you multiple by the mass $m$ of the test particle that is subject to the mass $M$: $U(r) = -\frac {GMm}r$. The second expression, $U=mgh$, is linear approximation to the former.
A linear approximation of some function $f(x)$ about some point $x=x_0$ can be constructed by using the first two terms of the Taylor expansion of $f(x)$. This yields $f(x) \approx f(x_0) + \frac{df(x)}{dx}(x-x_0)$. Applying that concept to the potential $U(r)$ results in $$U(r) \approx U(r_0) + \left.\frac {dU(r)}{dr}\right|_{r=r_0}(r-r_0)$$
Upon choosing $r_0$ as the Earth's radius, $r-r_0$ becomes height $h$. The derivative $\frac {dU(r)}{dr}$ is $\frac {GM}{r^2}$, and at the surface of the Earth this becomes $g$. Finally, potential energy involves an arbitrary additive constant. We can get rid of that constant term $U(r_0)$ without no loss of generality. The final result is $$U(r) \approx mgh$$
