Math confusion: gravitational field strength and gravitational potential I was taught in school that
$g=\frac{GM}{r^2}$
Integrating, I obtain
$\phi=-\frac{GM}{r}$
Mathematically, I can see that $\phi=-gr$, but why is this relationship considered wrong by my teacher? She mentioned something about $g$ not being a constant. Can someone help explain to me why it is wrong?
Thanks in advance!
 A: There is some amount of choice involved here, so you're not stating an invariant physical fact.
First set of definitions. If you define the force of gravity as a scalar (not a vector) $g=\frac{G M}{r^2}$, and if you define $\phi=-\frac{G M}{r}$, then you do indeed have $g=\frac{d\phi}{dr}$ and $\phi=-g r$. This is mathematically true as you have pointed out.
Second set of definitions. If you define $g=\frac{G M}{r^2}$, and if you define $\phi=-\frac{G M}{r}+C$ for some constant $C$, then you still have $g=\frac{d\phi}{dr}$, the physics and forces are totally unchanged, but you no longer have $\phi=-gr$. Physically, you can add any constant to a potential and the result stays unchanged. So your teacher may want to point out that this alternative definition is valid, and in this alternative definition your law does not hold.
Also note that usually, one would prefer to say $g=-\frac{G M}{r^2}$ and $g=-\frac{d \phi}{dr}$, reflecting the fact that the force $mg$ should accelerate objects down the potential. That negative sign is an important when defining potentials!
Third set of definitions. (Added later). As EL_DON points out, another commonly used definition is to take $g$ as a constant, $g=9.81 \frac{m}{s^2}$. With this definition $g\neq -\frac{G M}{r^2}$, except given a specific mass and radius. So, if your teacher is using this set of definitions, clearly $g=-\frac{d \phi}{dr}$ can't be a correct statement.
Fourth set of definitions. And finally, in the most general version of Newton's law of gravity, $\phi(x,y,z)$ is a scalar and the gravitational field $\vec{g}=(g_x,g_y,g_z)$ is a vector. The relations are then $\phi=-\frac{G M}{\|\vec{r}\|}$ and $\vec{g}=-\vec{\nabla} \phi$, where $\|\vec{r}\|$ is the length of the vector $(x,y,z)$ (that is, $\|\vec{r}\|=\sqrt{x^2+y^2+z^2}$), and where $\vec{\nabla} \phi=(\frac{d\phi}{dx},\frac{d\phi}{dy},\frac{d\phi}{dz})$. In this case the equation $\phi=\vec{g}r$ isn't even well formed, because one side is a scalar and the other is a vector! So this is another viewpoint from which your equation isn't correct. (However, it would still hold true that $\phi=\vec{g}\cdot\vec{r}$)
So there's one set of definitions under which your equation is true, and two or three sets of definitions under which your equation is not true. Your teacher was probably thinking about the second or third set of definitions.
A: You are not wrong mathematically, but you are hiding powers of $r$ inside of $g$, which could be confusing. If $g$ is a constant, then everything is fine. If $g$ is a function of $r$, don't obscure the physics; just write $\phi=-GM/r$. 
@NeuroFuzzy brought up true point about $\phi$ only being defined up to a constant, but this isn't really that important (although possibly to your teacher it is) because you can only ever measure differences in $\phi$, where the unknown constant will always cancel out. @NeuroFuzzy is also correct that you should always be careful with your negative signs.
