Did Hilbert publish general relativity field equation before Einstein?
On November 25, nearly ten years after the foundation of special relativity, Einstein submitted his paper The Field Equations of Gravitation for publication, which gave the correct field equations for the theory of general relativity (or general relativity for short). Actually, the German mathematician David Hilbert submitted an article containing the correct field equations for general relativity five days before Einstein. Hilbert never claimed priority for this theory. [Bold mine.]
The Official Web Site of the Nobel Prize
Edit 1. But...
Many have claimed that in 1915 Hilbert discovered the correct field equations for general relativity before Einstein but never claimed priority. The article  however, shows that this view is in error. In this paper the authors show convincingly that Hilbert submitted his article on 20 November 1915, five days before Einstein submitted his article containing the correct field equations. Einstein's article appeared on 2 December 1915 but the proofs of Hilbert's paper (dated 6 December 1915) do not contain the field equations.
As the authors of  write:-
In the printed version of his paper, Hilbert added a reference to Einstein's conclusive paper and a concession to the latter's priority: "The differential equations of gravitation that result are, as it seems to me, in agreement with the magnificent theory of general relativity established by Einstein in his later papers". If Hilbert had only altered the dateline to read "submitted on 20 November 1915, revised on [any date after 2 December 1915, the date of Einstein's conclusive paper]," no later priority question would have arisen.
 L Corry, J Renn and J Stachel, Belated Decision in the Hilbert-Einstein Priority Dispute, Science 278 (14 November, 1997).
Edit 2. Haha, butbut... :)
Edit 3. Roundup.
Recent controversy, raised by a much publicized 1997 reading of Hilbert's proof-sheets of his article of November 1915, is also discussed [on pp. 11-13; presumed included in this answer].
Einstein and Hilbert had the moral strength and wisdom - after a month of intense competition, from which, in a final account, everybody (including science itself) profited - to avoid a lifelong priority dispute (something in which Leibniz and Newton failed). It would be a shame to subsequent generations of scientists and historians of science to try to undo their achievement.
3$\begingroup$ "It would be a shame to subsequent generations of scientists and historians of science to try to undo their achievement." These words sound utterly manipulative. Like somebody dislikes the truth and for that bad reason inclines us to believe the nonsense that historical research can undermine the achievements made. $\endgroup$– ValApr 25, 2013 at 19:28
3$\begingroup$ @Val I think the author meant something different than "undermine" with his "undo", perhaps more like "under-appreciate". In my reading, he emphasises that the near-simulteneity wasn't because GR was there for the taking ("low-hanging fruit"), but rather that the development of GR was a huge effort. $\endgroup$– ŘídícíApr 25, 2013 at 20:00
1$\begingroup$ This is an excellent collection of quotes, thanks! It does seem to me, though, that Hilbert was quite fond of his way of deriving the equations and behind all the politeness was a feeling of superiority. Because in one of his "Lectures on the Foundations of Physics" that Hilbert gave a few days after Einstein's article surfaced he speaks of the work of Civita, Weyl, Schouten, Eddington and culminating in Einstein as a "colossal detour" and concludes that Einstein's equations confirm his variational computation is a "nice consistency check" (German: "schöne Gewähr"). See the citations listed.. $\endgroup$ Feb 5, 2014 at 0:11
3$\begingroup$ ...listed here: ncatlab.org/nlab/show/Einstein-Hilbert+action#History $\endgroup$ Feb 5, 2014 at 0:12
The accepted answer by Řídící is thorough (+1 :-), and the answer to your question is probably "yes". However I would add that Hilbert acknowledged that he had merely added the last step to a long process and therefore that he had no claim to have invented General Relativity.
It's tempting to think of GR being revealed to the world in a single stunning paper, but this isn't the way it happened. Hilbert was only able to write down the correct action because of the previous publications by Einstein on his work leading up to that point.
1$\begingroup$ it is not clear who Gugg is $\endgroup$– anna vAug 6, 2018 at 12:16
$\begingroup$ Yes the final sentence here says it all. "Priority" of a few days, weeks or even months should count for nothing when work is done independently; but when one contribution takes up and develops from another then that is an entirely different situation. $\endgroup$ Jun 9, 2022 at 17:29
People are still asking this? This is revisionist nonsense. Hilbert did NOT publish the correct field equations before Einstein. Research done between 97 and 2002 discovered that field equations published by Hilbert were NOT generally co-variant, Einstein's were. (Ironically it was Einstein who pointed this mathematical fact out to Hilbert - arguably one the top 3 most gifted mathematicians of all-time).
Moreover, if you read the letters between Einstein and Levi-Civita, it is very apparent that it was Einstein who had done most of the mathematical and conceptual work for GR. It was Einstein that had tutored Hilbert - who had invited Einstein to perform a series of lectures in Gottingen on GR in 1913 and 1914. And Einstein, after publishing his failed Entwurf theory (which was a necessary step in clarifying which tensors held primacy), actually wrote down the correct field equations in a previous paper he had discarded in 1914 but returned to once he discovered Hilbert was on his ass. Without Einstein's papers published in 12 through 14 Hilbert doesn't even stand a chance at coming up with the proper FE.
Remember, the most difficult element of GR wasn't the differential equations, it was the translation of very, very difficult kinematic concepts into mathematics. This is why many physicists-cum-historians tend to say that it may have taken another 100 years to discover General Relativity had Einstein never came along. GR is laden with very subtle but highly complex conceptual nuances that defy easy explanation.
There is no giant controversy about who discovered what first, and we don't know anything about who wrote what -- maybe Einstein broke his arm and forced someone else to write for him, I don't know. What we can talk about is their discovery of the relevant laws or the insights leading to the relevant laws.
The difference between Einstein and Hilbert is in their choice of axiom. This is akin to Einstein vs. Minkowski on the formulation of special relativity, for instance -- there is no doubt that Einstein first wrote his field equation, you can see this in "On the foundation of the General theory of relativity", but Hilbert first discovered the Einstein-Hilbert action, which is the more elegant formulation of the theory, because it directly states the link between curvature and gravity in a simple way, in terms of the latter's Lagrangian.
$\begingroup$ This doesn't answer the question though. $\endgroup$ Jul 3, 2013 at 14:17
1$\begingroup$ @LarryHarson: It does. They formulate General Relativity in different ways, both of them contributed to GR in enormous ways, like Ein&Mink, New&Lei etc. and the EFE was postulated and first published by Einstein, but the EH Action was first published by Hilbert. $\endgroup$ Jul 3, 2013 at 14:20
$\begingroup$ Where in your answer does it say who published what before who, and whether the papers contained the field equations? $\endgroup$ Jul 3, 2013 at 14:49
1$\begingroup$ The fact that I stated that Einstein's postulate was EFE, and Hilbert's was EH, was enough. AAnd that there's no controversy. $\endgroup$ Jul 3, 2013 at 15:13
$\begingroup$ Read the question. $\endgroup$ Jul 3, 2013 at 15:21