Step 1: Understand what residual stress is.
Residual stress is the stress that stays locked inside a material even when no outside load is acting on it. It builds up during processes like casting, welding, rolling, forging or heat treatment, when different parts of a component cool, deform or transform at different rates and pull against each other.
Step 2: Recall how such a hidden stress can be measured.
Residual stress cannot be seen or read directly with an instrument. It has to be worked out from a physical effect it produces inside the crystal lattice of the material, namely a very small change in the spacing between atomic planes. X-ray diffraction (XRD) is built around exactly this idea. X-rays reflect off the crystal planes of the material, and the angle at which the beam diffracts depends on the interplanar spacing \(d\), following Bragg's law
\[ n\lambda = 2d\sin\theta \]
When the material carries a residual elastic strain, the spacing \(d\) shifts by a tiny amount, so the diffraction peak position shifts too. By measuring this peak shift at several tilt angles of the sample (the \(\sin^2\psi\) method), the elastic strain, and from it the residual stress, can be calculated using the material's elastic modulus and Poisson's ratio.
Step 3: Check why the other options do not fit.
(B) Tensile Testing: A tensile test pulls a specimen until it yields or breaks and gives properties like yield strength, tensile strength and elongation. It measures how the material responds to a freshly applied load, not the stress already locked inside it before the test. The test is also destructive, so it cannot be used to find the stress state of the actual component.
(C) Thermo-Gravimetric Analysis (TGA): TGA tracks the change in mass of a sample as its temperature is raised, and it is used to study decomposition, oxidation or moisture loss. It has no way of sensing mechanical or elastic strain, so it cannot measure residual stress.
(D) Optical Microscopy: Optical microscopy shows grain structure, phases and surface defects like cracks on a polished and etched sample. It can reveal the damage that very high residual stress eventually causes, such as cracking or warping, but it does not measure the size of the stress itself.
Step 4: Final Answer.
Residual stress is found from the shift it causes in the diffraction pattern of the crystal lattice, so it is measured using X-ray diffraction.
\[ \boxed{\text{X-ray Diffraction (XRD)}} \]