Answer
$1.2\times 10^7m/s$ away from Earth
Work Step by Step
We can find the required speed of the quasar as follows:
$f^{\prime}=f(1\pm\frac{u}{c})$
$\implies \frac{c}{\lambda^{\prime}}=\frac{c}{\lambda}(1\pm\frac{u}{c})$
Since the quasar is moving along the line of sight, we will use the negative sign.
$\implies \frac{c}{\lambda^{\prime}}=\frac{c}{\lambda}(1-\frac{u}{c})$
This simplifies to:
$\frac{\lambda}{\lambda^{\prime}}=1-\frac{u}{c}$
$\implies \frac{u}{c}=1-\frac{\lambda}{\lambda^{\prime}}$
$\implies u=c(1-\frac{\lambda}{\lambda^{\prime}})$........eq(1)
Given that $\lambda=486\times 10^{-9}m$ and the same line is lengthened by $20nm$, that is $\lambda^{\prime}=(486+20)\times10^{-9}m=506\times 10^{-9}m$
Now, we plug in the known values in eq(1) to obtain:
$u=(3\times 10^8)(1-\frac{486\times 10^{-9}}{506\times 10^{-9}})$
$u=1.2\times 10^7m/s$ away from Earth