WannabeNewton said:
Check out appendix B in Wald's "General Relativity" and also problem 5 in chapter 4. It is essentially the converse of the poincare lemma. The lemma itself comes out of a combination of differential and algebraic topology; for its proof you would need to consult a proper text on differentiable manifolds.
I don't use Wald for a mathematical reference. He's picked the 'Poincaré lemma' part from Flanders's text on Differential Forms*. But merely stating that the exterior differential is nilpotent to the second order is not an interesting/difficult result, but rather
<
Poincare lemma. Let U be an open ball in E and let A be a differential
form of degree >= 1 on U such that dA = 0. Then there exists a differential
form B on U such that dB = A.>
This is the mathematical standard result picked up from <Serge Lang,
Differential Manifolds, Springer Verlag, 1985>.
Let's go to <Spivak,
Calculus on Manifolds, Addison-Wesley> Page 94:
<4-11 Theorem (
Poincare Lemma). If A\subset \mathbb{R}^{n} is an open
set star-shaped with respect to 0, then every closed form on A
is exact.>
*From Flanders's text, his first words from this preface to the first (1963) edition (quoted by Wald).
<
Last spring the author gave a series of lectures on exterior differential
forms to a group of faculty members and graduate students from the Purdue
Engineering Schools. The material that was covered in these lectures is
presented here in an expanded version. The book is aimed primarily at
engineers and physical scientists in the hope of making available to them new
tools of very great power in modern mathematics.>