While solving the following question:
``A particle executes simple harmonic motion in a straight line such that in two of its positions the velocities are $v_1$ and $v_2$ and the corresponding accelerations are $f_1$ and $f_2$. Show that the amplitude of the motion is $\frac{\sqrt{\left(v_2^2-v_1^2\right)\left(f_1^2v_2^2-f_2^2v_1^2\right)}}{f_1^2-f_2^2}$,''
I got the amplitude as $\frac{\sqrt{\left(v_2^2-v_1^2\right)\left(f_1^2v_2^2-f_2^2v_1^2\right)}}{x_1^2-x_2^2}$ instead as follows.
From the displacement equation $x=a\cos\big(\mu t+\varepsilon\big)$ we get $$v_1^2=\mu^2\big(a^2-x_1^2\big)\qquad\text{and}\qquad v_2^2=\mu^2\big(a^2-x_2^2\big)\qquad\qquad(1)$$ from which we get $$v_1^2-v_2^2=\mu^2\big(x_2^2-x_1^2\big).\qquad\qquad(2)$$
Eliminating $\mu^2$ from the equations (1), we get
$$v_1^2\big(a^2-x_2^2\big)=v_2^2\big(a^2-x_1^2\big)\qquad\text{or,}\qquad a^2=\frac{v_1^2x_2^2-v_2^2x_1^2}{v_1^2-v_2^2}.$$
Since $x_1^2=\mu^4f_1^2$ and $x_2^2=\mu^4f_2^2$, using (2) we have
\begin{align*}
a^2&=\mu^4\frac{f_2^2v_1^2-f_1^2v_2^2}{v_1^2-v_2^2}=\mu^2\frac{v_1^2-v_2^2}{x_2^2-x_1^2}\cdot\frac{f_2^2v_1^2-f_1^2v_2^2}{v_1^2-v_2^2}=\mu^2\frac{f_2^2v_1^2-f_1^2v_2^2}{x_2^2-x_1^2}\\
&=\frac{v_1^2-v_2^2}{x_2^2-x_1^2}\cdot\frac{f_2^2v_1^2-f_1^2v_2^2}{x_2^2-x_1^2}=\frac{\big(v_2^2-v_1^2\big)\big(f_1^2v_2^2-f_2^2v_1^2\big)}{\big(x_1^2-x_2^2\big)^2}
\end{align*}
so that its amplitude,
$$a=\frac{\sqrt{\big(v_2^2-v_1^2\big)\big(f_1^2v_2^2-f_2^2v_1^2\big)}}{x_1^2-x_2^2}\cdot$$
Can someone tell me how to get the amplitude as given in the question?
For a simple linear harmonic motion we have
$$ m\ddot x = m f = k x $$
and also
$$ m \dot x\ddot x = k x\dot x\Rightarrow v^2 = \frac km(x^2-a^2) $$
and then
$$ \frac{\sqrt{\left(v_2^2-v_1^2\right)\left(f_1^2v_2^2-f_2^2v_1^2\right)}}{f_1^2-f_2^2} = a $$
because
$$ f_1 = \frac km x_1\\ f_2 = \frac km x_2\\ v_1^2 = \frac km(x_1^2-a^2)\\ v_2^2 = \frac km(x_2^2-a^2)\\ a = \frac{m^2 \sqrt{\frac{a^2 k^4 \left(x_1^2-x_2^2\right)^2}{m^4}}}{k^2 \left(x_1^2-x_2^2\right)} $$