An expression is derived for the elastic energy produced by a contained, underground nuclear detonation using an analytic approximation for the pressure profile acting at the elastic radius. The resulting static strain energy and radiated energy equations are evaluated as a function of yield and depth of burial for detonations in tuff and rhyolite. It is shown that, for a given medium, the elastic-energy efficiency depends only on the depth of burial (h) of the device and is proportional to h0.72. Moreover, for the particular scaling relations used, the strain energy shows the same depth dependence as the radiated energy. Seismic-spectrum scaling theory is applied to an analysis of nuclear seismic-source functions, giving results which are in good agreement with the observed differences in the teleseismic magnitude determinations. A magnitude-energy equation is derived for underground nuclear detonations and is noted to be in poor agreement with the Gutenberg-Richter equation. This discrepancy is interpreted to be an indication that the radiated energy from small earthquakes may typically have been underestimated.