Something goes wrong when I was deriving the equation of motion in Kepler's probelm, as below,
- Angular momentum conservation $L = Mr^2\dot{\theta}^2$.
- And Lagrangian is $L = \frac{1}{2}M(\dot{r}^2 + r^2\dot{\theta}^2) - V(r)$.
Method 1 compute $\frac{\partial L}{\partial r} = Mr\dot{\theta}^2 - d_rV = \frac{L^2}{Mr^3}-d_rV$.
however, another way is to rewrite Lagrangian first, $L = \frac{1}{2}M\dot{r}^2+\frac{1}{2}\frac{L^2}{Mr^2} - V(r)$, and then compute the partial derivative w.r.t to $r$ again,
Method 2 we get different result $\frac{\partial L}{\partial r} = -\frac{L^2}{Mr^3}-d_rV$.
These two should be equal, but there are different with a sign, can somebody tell me where is wrong?