Let the natural length of wire be \(=1\)
When only \(M_1\) hanging
Using \(\Delta l=\frac{F L}{A Y}\)
\(\left(l_1-l \right)=\frac{M_1 g \cdot l}{A Y \ldots(1)}\)
When both \(M_1, M_2\) hanging
\(\left(l_2-l\right)=\frac{\left(M_1+M_2\right) g \cdot l}{A Y} \ldots(2)\)
Dividing \((1)\) by \((2)\)
\(\frac{l_1-l}{l_2-l}=\frac{M_1}{M_1+M_2}\)
Solving this we get
\(I=\frac{M_1}{M_2}\left(l_1-l_2\right)+I_1\)