So I wanted to derive the total energy for an elliptical orbit, E = -GmM/2a, and while I was doing it, I ran into this hurdle. So at the closest point to the focus, the orbiting object is at a distance of a(1-e) from the focus, where a is the semi-major axis and e is the eccentricity. So if we were to take the centripetal force at this point we should get mv^2/r = GmM/r^2 and r = a(1-e) so then we would get 1/2mv^2 = GmM/(2a(1-e)) which is the kinetic energy. If we were to add this to the potential energy( -GmM/(a(1-e)), we get the total energy as -GmM/(2a(1-e)). Isn't this wrong because the total energy of an ellipse is -GmM/2a? Why did I end up with a total energy not equal to that?