When the material is subjected to a shearing stress, the strain energy density can be expressed in integral form as the product of the shearing stress and the corresponding shearing strain. Within the elastic limit, shearing stress is proportional to the shearing strain, with a constant of proportionality being the modulus of rigidity. Performing the integration, the strain energy density is expressed as a product of the modulus of rigidity and shearing strain squared. The corresponding strain energy can be calculated by integrating the strain energy density over a small volume element. This equation is valid only for elastic deformations. Consider a shaft subjected to one or more twisting couples. The shearing stress of a cross-sectional area, A, located at a distance x from a fixed end, can be expressed in terms of internal torque and the polar moment of inertia J. The stored strain energy in such a shaft can be expressed in integral form in terms of twisting torque. Rewriting the volume element in terms of cross-sectional area simplifies the expression.