According to energy conservation principle,
If, \(x _1\) is maximum elongation in the spring when the particle is in its lowest extreme position. Then,
\(mgh =\frac{1}{2} kx _1^2- mgx _1\)
\(\Rightarrow \frac{1}{2} kx _1^2- mgx _1- mgh =0\)
\(\text { or, } x _1^2-\frac{2 mg }{ k } x _1-\frac{2 mg }{ k } \cdot h =0\)
\(\therefore x _1=\frac{2 mg }{ k } \pm \sqrt{\left[\left(\frac{2 mg }{ k }\right)^2+4 \times \frac{2 mg }{ k } h \right]}\)
Amplitude \(A= x _1 -x _0\) (elongation in spring for equilibrium position)
\(A =\frac{ mg }{ k } \sqrt{\left(1+\frac{2 hk }{ mg }\right)}\)