The strain energy ($U$) stored in a shaft subjected to torque is proportional to:
\[U \propto \frac{T^2}{GJ}\]
where:
$T$: Applied torque,
$G$: Shear modulus,
$J = \frac{\pi d^4}{32}$: Polar moment of inertia.
For identical torque and material:
\[\frac{U_1}{U_2} = \frac{J_2}{J_1} = \left(\frac{d_2}{d_1}\right)^4.\]