The $L$ -shaped arm $A B C D$ shown in the figure lies in a vertical plane and pivots about a horizontal pin at $A .$ The arm has a constant cross-sectional area and total weight $W$. A vertical spring of stiffness $k$ supports the arm at point $B$
(a) Obtain a formula for the elongation of the spring due to the weight of the arm.
(b) Repeat part (a) if the pin support at $A$ is moved to $D$