Find the point on the curve $x^{2}=8 y$ which is nearest to the point $(2,4)$.
Let $(x, y)$ be nearest to the point $(2,4)$. Then,
$x^{2}=8 y$
$\Rightarrow y=\frac{x^{2}}{8}$ .....(1)
$d^{2}=(x-2)^{2}+(y-4)^{2}$ [Using distance formula]
Now,
$Z=d^{2}=(x-2)^{2}+(y-4)^{2}$
$\Rightarrow Z=(x-2)^{2}+\left(\frac{x^{2}}{8}-4\right)^{2}$ [From eq. (1)]
$\Rightarrow Z=x^{2}+4-4 x+\frac{x^{4}}{64}+16-x^{2}$
$\Rightarrow \frac{d Z}{d y}=-4+\frac{4 x^{3}}{64}$
For maximum or minimum values of $Z$, we must have
$\frac{d Z}{d y}=0$
$\Rightarrow-4+\frac{4 x^{3}}{64}=0$
$\Rightarrow \frac{x^{3}}{16}=4$
$\Rightarrow x^{3}=64$
$\Rightarrow x=4$
Substituting the value of $x$ in eq. (1), we get
$y=2$
Now,
$\frac{d^{2} Z}{d y^{2}}=\frac{12 x^{2}}{64}$
$\Rightarrow \frac{d^{2} Z}{d y^{2}}=3>0$
So, the nearest point is $(4,2)$.