"Did Einstein work back from Mercury's anomalous precession?" I asked myself and then found this:
Conquering the Perihelion
[quote]On 18 November, 1915, shortly before arriving at the final field equations of general relativity, Einstein published a derivation of Mercury's orbital precession based on the vacuum field equations, which turned out to carry over unchanged in the final theory. As early as 1907 he had written to Conrad Habicht that he was working in a theory of gravitation that he hoped would account for the anomalous precession of Mercury. Now, eight years later, he was finally was able to derive this result. He told a friend that he was beside himself with excitement for several days after establishing this agreement between theory and observation. The derivation he published in 1915 is mathematically interesting, not just for how he inferred the equation of motion from the vacuum field equations (without the benefit of the Schwarzschild metric), but also for his method of inferring the amount of precession from this equation.
Hilbert may not have been aware of it, but Einstein had an advantage in "conquering" the perihelion calculation so rapidly, because he had performed the same calculation previously (together with his friend Michele Besso) based on earlier versions of his theory. From the theoretical standpoint the important part of this work was obviously deriving the equation of motion, but from a purely mathematical standpoint, in order to quantitatively compare the results with observation, the determination of the implied perihelion precession rate was also important. This step introduced no novel concepts, but it was not an entirely trivial exercise. The "quadrature" approach taken by Einstein is not followed by most modern texts (an exception being Weinberg, 1972), so it's interesting to review the paper of 18 November 1915 paper to see exactly how he did it. His explanation is rather terse (and there are a couple of typos in the published paper), so it takes a bit of effort to reconstruct his reasoning.
First we should reiterate that Einstein did not arrive at the final form of the field equations (with the "trace" term) until November 25th, but the perihelion motion depends only on the vacuum solution, which is unaffected by the trace term, so its absence didn't invalidate the November 18 results on Mercury's precession.
Similarly, in a review of gravitation theories, Walter Ritz wrote in 1909
Astronomical observations carried out over many centuries have revealed some deviations between observation and calculation, which cannot be explained by Newton's law up to now, and which a new theory will have to explain. Of these anomalies by far the largest is of the planet Mercury, whose ellipse precesses slowly, under the effect of the remaining planets; but the observed precession is larger by approximately 42 arc-seconds per century than the computed. The difference is small, but nevertheless unquestionable and unexplained.
Again this clearly indicates not only that the precession of Mercury's orbit was considered anomalous, but that it was widely suspected that its resolution would come from a new theory of gravity. Of course, Einstein was very familiar with Ritz's work, having engaged him in a public debate in 1909 on the subject of the advanced solutions of Maxwell's equations.
Considering that Einstein began his search for a new gravitational theory in 1907 with the expressed purpose (as stated in his letter to Habicht) of explaining the anomalous precession of Mercury, and that he kept this objective in view throughout the intermediate development (including the Entwurf of 1913), and considering that Einstein listed the failure of the Entwurf theory to give the correct perihelion of Mercury as one of the three reasons that led him to lose faith in that theory, which then led him to the fully covariant theory of general relativity, it seems hard to justify the claim that general relativity was developed without any attention to this problem. This claim is somewhat similar to Einstein's assertions that special relativity was developed without any attention to the Michelson and Morley experiment - despite the fact that at other times (notably his 1922 talk in Japan on how he developed the theory of relativity) he acknowledged that this experiment had been an important factor in his thinking. Of course, in both cases it's perfectly correct to say that the theories follow logically and almost without ambiguity from very broad and fundamental principles, so they were certainly not ad hoc explanations of the respective experimental facts. Nevertheless it is historically inaccurate to claim that general relativity was developed "without any attention" to Mercury's anomalous precession.[end quote]