Find the point on the parabola $y^2 = 2x$ that is closest to $(1,4)$.
        \begin{scope}[ultra thick]
          \draw[cgreen] plot[smooth,domain=0:4,samples=40] function{sqrt(2*x)};
          \draw[cgreen] plot[smooth,domain=0:4,samples=40] function{-sqrt(2*x)};
        \node[include=cred] (a) at (1,4) {};
        \node[anchor=west,xshift=1mm] at (a) {{\small $(1,4)$}};
        \node[include=cgreen] (b) at (2,2) {};
        \node[anchor=north west,xshift=1mm] at (b) {{\small $(x,y)$}};
        \draw[cred,dashed] (a) -- node[left,yshift=-1mm] {$d$} (b);
      Introducing notation:
        \item let $d$ be the distance of $(x,y)$ to $(1,4)$
        d &= \mpause[1]{\sqrt{(x-1)^2 + (y-4)^2}} & \mpause{x &=}\mpause{ y^2/2 }
      Square root makes derivative complicated.\\\pause
      Note that $d$ minimal $\;\iff\;$ \pause $d^2$ minimal.\\\pause
      Thus, instead of $d$ we minimize $d^2$!\vspace{-.5ex}\pause
        f(y) = d^2 = \mpause[1]{(y^2/2-1)^2 + (y-4)^2}
      &f'(y) = \mpause[1]{2(y^2/2-1)y + 2(y-4)} \mpause{= y^3-8} \\
      &\mpause{f'(y) = 0 \;\iff\;} \mpause{y = 2}
    Moreover $f'(y) < 0$ for all $y < 2$ and  $f'(y) > 0$ for all $y > 2$.
    Thus by the First Derivative Test for Absolute Extrema,
    $f(2)$ is the absolute minimum.
    Thus the point \alert{$(\mpause[1]{2},\mpause[1]{2})$ is closest to $(1,4)$}.