\section{Parametric Equations}

We have seen how a function $F(x)$ can define a curve via the equation $y=F(x)$.  Similarly a function $G(y)$ of the $y$-coordinate can define a curve via $x=G(y)$.  Finally a relation $H(x,y)=0$ such as $x^2+y^2-25=0$ can define a curve in the coordinate plane.

Another way in which we can define a planar curve is to consider writing both $x$ and $y$ as functions of a further variable.

\definition{Let $f(t)$ and $g(t)$ be continuous functions of a real variable $t$ with common domain $D$.  Then
\begin{eqnarray*}
x & = & f(t) \\
y & = & g(t)
\end{eqnarray*}
are called \textbf{parametric equations} \index{parametric equations}.  The variable $\bm{t}$ is called the \textbf{parameter} \index{parameter}.}

Geometrically such a parametric equation represents a curve.  Given a value for $t$ the point \mbox{$(x,y)=(f(t),g(t))$} is defined.  As $t$ ranges over the domain $D$ a curve $\mathcal{C}$ is defined.

\begin{example}
The following shows the curve $\mathcal{C}$ generated by the parametric equations
\begin{eqnarray*}
x(t) & = & \cos(t/2)+\frac{t}{20} \\
y(t) & = & \sin(t/2)+\frac{t}{20}
\end{eqnarray*}
from $t=0$ to $t=20$. The dots highlight the points at $t=0,2,4,\ldots,20$.
\begin{center}
\includegraphics[width=.6\textwidth]{graphics/parametric_equations1}%
\end{center}
\end{example}

The parameter $t$ can, as the choice of variable name suggests, represent a time.  In this case $(x,y)=(f(t),g(t))$ can represent the position of an object in the plane at a given time.  The curve, in this case, is the path that the object takes in time.  However the parameter need not be time.  The parameter could, for instance, represent a physical variable such as an angle $\theta$.  Another common physical parameter is $s$, the arc length from some fixed point on the curve to the point $(x,y)$.  Finally the parameter may have no physical interpretation whatsoever.
% TODO: I could modify my original diagram to show the angle parameter and the
% arclength being used as a parameter.  I would need to not go all the way to
% 20 however if angle is to be used properly as a parameter.  Label the points
% with their the initial and final theta and s.

The curve $\mathcal{C}$ in the last example could not be represented either by a function $y=F(x)$ or $x=G(y)$ as vertical and horizontal lines intersect the curve at more than one place.  However, as a parametric curve the curve is represented entirely by functions; one just requires two of them.
\begin{example}\label{exam:param1}%
Sketch the curve given by the following parametric equations. 
\begin{multicols}{2}
\begin{enumerate}
    \item $\displaystyle x=\sec \theta,\,\, y=\tan \theta;\ -\frac{\pi}{2} < \theta < \frac{\pi}{2}$
    \item $\displaystyle x=4t^2-5, \,\, y=2t+3; \,\,\, t$ in $\mathset{R}$ 
    \end{enumerate}
  \end{multicols}
\begin{solution*}
\begin{enumerate}
\item $\displaystyle x=\sec \theta,\,\, y=\tan \theta;\ -\frac{\pi}{2} < \theta < \frac{\pi}{2}$\\
\parbox[t]{.5\textwidth}{Here the parametric equations are written in terms of parameter $\theta$ rather than $t$.  We note that as $\theta\to\pm\frac{\pi}{2}$ that $x\to+\infty$ and $y\to\pm\infty$.  Choosing values of $\theta$ as $0$, $\pm0.4$, $\pm0.8$, and $\pm1.2$ we can evaluate $x(\theta)$ and $y(\theta)$ to get the points $(x,y)$ on the curve.  These are shown on the following graph of the parametric equation.}~~~~~~~~
\raisebox{-14em}{\includegraphics[width=.3\textwidth]{graphics/parametric_equations2}}%

\item $\displaystyle x=4t^2-5, \,\, y=2t+3; \,\,\, t$ in $\mathset{R}$\\
\parbox[t]{.5\textwidth}{Note that as parameter $t\to\pm\infty$ that $x\to+\infty$ and $y\to\pm\infty$.  Choosing values of $t$ as in increments of $\Delta t=0.5$ about $t=0$ gives the labelled points $(x,y)$ on the curve.}~~~~~~~~
\raisebox{-8em}{\includegraphics[width=.4\textwidth]{graphics/parametric_equations3}}%
\end{enumerate}
\end{solution*}

\begin{furtherquestion}
  Sketch the curve given by the parametric equations $x=3\cos\theta$, $y=2\sin\theta$; $0\le\theta\le2\pi$.
\end{furtherquestion}
\end{example}

\textbook{\clearpage}
One way to identify a curve from its parametric definition is to eliminate the parameter between the two equations to get a single equation involving only $x$ and $y$.
\begin{example}
Identify the curves from Example~\ref{exam:param1} by writing each as a single equation involving only~$x$ and~$y$.

\begin{solution*}
\begin{enumerate}
\item  $\displaystyle x=\sec \theta,\,\, y=\tan \theta;\ -\frac{\pi}{2} < \theta < \frac{\pi}{2}$
  
  Identity $\sec^2\theta=\tan^2\theta+1$ implies $x^2=y^2+1$ and thus
  \begin{align*}
    x^2-y^2&=1\,.
  \end{align*}
  We recognize the standard form of a hyperbola oriented along the $x$-axis with vertex $(1,0)$.  Note that the graph of the latter equation admits solutions that are a reflection of our curve about the $y$-axis.  These extraneous solutions have been introduced by squaring.  We must restrict the equation of the hyperbola to $x>0$ since secant is positive on $\left(-\frac{\pi}{2},\frac{\pi}{2}\right)$.
\item $\displaystyle x=4t^2-5, \,\, y=2t+3; \,\,\, t$ in $\mathset{R}$
  
  As a general strategy we can sometimes solve for the parameter in terms of one of the variables and then substitute that result into the equation for the other variable.  In this case we solve for $t$ in terms of $y$ since that provides a single solution,
    \begin{align*}
      y=2t +3 \implies t=\frac{y-3}{2}\,.
    \end{align*}
    Substitution into $x(t)=4t^2-5$ gives
    \begin{align*}
       x&=4\left(\frac{y-3}{2}\right)^2-5 
       \implies x=(y-3)^2-5
    \end{align*}
    We recognize the equation of a horizontal parabola with vertex $(-5,3)$ opening to the right.
\end{enumerate}
\end{solution*}

\begin{furtherquestion}
  Identify the curve from Example~\ref{exam:param1} given by $x=3\cos\theta$, $y=2\sin\theta$; $0\le\theta\le2\pi$ by writing it as a single equation involving only $x$ and $y$.
%In the previous example of the ellipse one finds $\displaystyle\cos\theta=\frac{x}{3}$ and $\displaystyle\sin\theta=\frac{y}{2}$.  From this it follows that
%\begin{eqnarray*}
%\cos^2\theta+\sin^2\theta & = & 1 \\
%\Rightarrow\left(\frac{x}{3}\right)^2+\left(\frac{y}{2}\right)^2 & = & 1 \\
%\Rightarrow\frac{x^2}{9}+\frac{y^2}{4} & = & 1
%\end{eqnarray*}
%We recognize the relation in the last line as defining a horizontal ellipse centred on the origin with semimajor axis of length $\sqrt{9}=3$ and semiminor axis of $\sqrt{4}=2$.
\end{furtherquestion}
\end{example}

\begin{example}
Eliminate the parameter $t$ from the given parametric equations to find an equation for the curve in terms of $x$ and $y$ only.
\begin{multicols}{2}
\begin{enumerate}
    \item $\displaystyle x=3t^3-4, \,\, y=4t+1$
    \item $\displaystyle x=e^{3t}-1, \,\, y=e^{-3t}$
    \end{enumerate}
  \end{multicols}
\begin{solution*}
\begin{enumerate}
\item $\displaystyle x=3t^3-4, \,\, y=4t+1$

  From $y=4t+1$, we have 
    \begin{align*}
    4t=y-1 \implies t=\frac{1}{4}(y-1)\,.
    \end{align*}
    Substitute this into $x=3t^3-4$, we obtain
    \begin{align*}
    x=3t^3-4 \implies x=3\left[\frac{1}{4}(y-1)\right]^3-4
    \implies x= \frac{3}{16}(y-1)^3-4\,.
    \end{align*}
    We note in passing that we could have solved for $t$ in terms of $x$ to get $t=\sqrt[3]{(x+4)/3}$ and substituted that into the equation for $y$, but solving for $t$ in terms of $y$ here was easier.
  \item $\displaystyle x=e^{3t}-1, \,\, y=e^{-3t}$

    From $y=e^{-3t}$ we have
    \begin{align*}
    y=e^{-3t} \implies y=\frac{1}{e^{3t}} \implies e^{3t}= \frac{1}{y}\,.
    \end{align*}
    Substitute this into $x=e^{3t}-1$ to obtain
    \begin{align*}
        x=e^{3t}-1 \implies x=\frac{1}{y}-1\,.
    \end{align*}
\end{enumerate}
\end{solution*}

\begin{furtherquestion}
  Eliminate the parameter $t$ from the parametric equations $x=e^{2t}$, $y=t+1$ to find an equation for the curve in terms of $x$ and $y$ only.
\end{furtherquestion}
\end{example}

One may also want to go in the other direction, namely to take a curve written in terms of an equation involving $x$ and $y$ and turn that into parametric equations.  We note that a function $y=F(x)$ can always be written in parametric form by associating the independent variable with the parameter
\begin{eqnarray*}
x(t) & = & t \\
y(t) & = & F(t)
\end{eqnarray*}
or, equivalently, $\mathcal{C}(t)=(t,F(t))$.  Similarly $x=G(y)$ can be generated by the parametrization $\mathcal{C}(t)=(G(t),t)$.  Where $x$ and $y$ are defined implicitly in a relation it may yet be possible to write one variable as a function of the other and proceed from there.

\begin{example}
  Write the given curves in parametric form.
  \begin{multicols}{3}
    \begin{enumerate}
    \item $\displaystyle y=\sqrt{x^2-1}$
    \item $\displaystyle x=3y+5$
    \item $\displaystyle x^2=e^y$
    \end{enumerate}
  \end{multicols}
\begin{solution*}
\begin{enumerate}
\item  $\displaystyle y=\sqrt{x^2-1}$

  Let $x(t)=t$, then
  \begin{align*}
   y=\sqrt{x^2-1} \implies y=\sqrt{t^2-1}\,.
  \end{align*}
  Thus the parametric equations are $x(t)=t, \,\,\, y(t)=\sqrt{t^2-1}$\,.
  \item $\displaystyle x=3y+5$

    Let $y(t)=t$, then
  \begin{align*}
      x=3y+5 \implies x=3t+5\,.
  \end{align*}
  Thus the parametric equations are $x(t)=3t+5, \,\,\,\ y(t)=t$\,.
\item $\displaystyle x^2=e^y$

  Here neither $x$ nor $y$ are explicitly defined as functions of the other variable.  However solving for $y$ in terms of $x$ gives
  \begin{align*}
    y=\ln(x^2)
  \end{align*}
  Let $x(t)=t$, then 
  \begin{align*}
   y=\ln(x^2)\implies y=\ln(t^2)\,.
  \end{align*}
  Thus the parametric equations are $x(t)=t, \,\,\, y(t)=\ln(t^2)$.

  Note that since $x^2$ is not invertible we cannot write $x$ as a function of $y$.  Indeed, solving we have $x=\pm\sqrt{e^y}=\pm e^{\frac{y}{2}}$\,. We would need to use two sets of parametric equations $x(t)=e^{\frac{t}{2}}$, $y(t)=t$, and $x(t)=-e^{\frac{t}{2}}$, $y(t)=t$ to generate the full curve.
\end{enumerate}
\end{solution*}

\begin{furtherquestions}
  Write the given curves in parametric form.
  \begin{multicols}{2}
    \begin{enumerate}
    \item $y=1+x^2$
    \item $x=e^y+\sin y$
    \end{enumerate}
  \end{multicols}
\end{furtherquestions}
\end{example}

\textbook{\addtoanswerkey{\clearpage}}
\begin{exercise}
\input{PARAMETRIC_EQUATIONS/parametric-equations.tex}
\end{exercise}

\section{Calculus of Parametric Curves} \index{parametric curve}

\subsection{Tangent Slope and Concavity} \index{parametric curve! tangent slope and concavity}
For a curve defined by $y=F(x)$ we know the slope of the tangent at the point $(x,y)=(x,F(x))$ is given by the derivative $F'(x)$.  What then is the slope of the tangent to a curve defined parametrically by $x=f(t)$, $y=g(t)$\,?  Suppose we can eliminate the parameter $t$ as we have done in the previous section to obtain $y=F(x)$ for some function $F$.\footnote{While this may not be possible for the entire curve, this may plausibly be done for a portion of the curve near the point at which we desire the tangent slope.}  Then it follows that 
\[g(t)=F(f(t))\,.\]
Differentiating both sides of the latter equation with respect to $t$ one obtains, by the Chain Rule,
\[g'(t)=F'(f(t))\cdot f'(t)\,.\]
If $f'(t)\neq0$ then $F'(f(t))=\frac{g'(t)}{f'(t)}$ and hence the tangent slope at the point $(x(t),y(t))$ is given by
\[F'(x)=\frac{g'(t)}{f'(t)}\ \ \ \ \ (f'(t)\neq 0).\]
In Leibniz derivative notation this is easily remembered; the slope of the tangent line $x=f(t)$, $y=g(t)$ is given by
\[\frac{dy}{dx}=\frac{\frac{dy}{dt}}{\frac{dx}{dt}}\ \ \ \ \ \left(\frac{dx}{dt}\neq 0\right).\]
Note that:
\begin{enumerate}
\item The curve has a horizontal tangent line when $\frac{dy}{dt}=0$ (provided $\frac{dx}{dt}\neq 0$).
\item The curve has a vertical tangent line when $\frac{dx}{dt}=0$ (provided $\frac{dy}{dt}\neq 0$).
\end{enumerate}

To find the second derivative $\frac{d^2\!y}{dx^2}$, one may continue as before noting that this would be $F''(x)$. Differentiating $F'(f(t))=\frac{g'(t)}{f'(t)}$ with respect to $t$ on both sides gives, using the Chain Rule,
\[F''(f(t))\cdot f'(t)=\frac{d}{dt}\left[\frac{g'(t)}{f'(t)}\right]\,.\]
Thus, for the second derivative with respect to $x$ we have
\[F''(x) = \frac{\frac{d}{dt}\!\left[\frac{g'(t)}{f'(t)}\right]}{f'(t)}\ \ \ \ \ (f'(t)\neq 0)\ ,\]
or in Leibniz notation, 
\[\frac{d^2\!y}{dx^2}=\frac{\frac{d}{dt}\!\left(\frac{dy}{dx}\right)}{\frac{dx}{dt}}\ \ \ \ \ \ \left(\frac{dx}{dt}\neq 0\right).\]
Here we must find $\frac{dy}{dx}$ as a function of $t$ as above and then differentiate.\footnote{This latter formula may be remembered by imagining $\frac{dy}{dx}$ as a function of $t$ and then differentiating this with respect to $x$. Assuming we can find an inverse of $f$ (at least locally around the point of interest), so that $t=f^{-1}(x)$ and $\frac{dt}{dx}$ is defined, then, by the Chain Rule,
\[\frac{d^2y}{dx^2}=\frac{d}{dx}\!\left(\frac{dy}{dx}\right)=\frac{d}{dt}\!\left(\frac{dy}{dx}\right)\cdot\frac{dt}{dx}\]
Noting that our inverse functions satisfy $\frac{dt}{dx}\cdot\frac{dx}{dt}=1$ we can bring $\frac{dt}{dx}$ into the denominator as $\frac{dx}{dt}$ to recover our previously derived formula.}

Note that $\frac{dy}{dx}$ and $\frac{d^2\!y}{dx^2}$ are of interest as these are, within the given the coordinate system, quantities that will be independent of the particular parameterization used to generate the curve.

\begin{example}
  Find the equation of the tangent line to the curve $x(t)=t^3$, $y(t)=t^2-1$ at the point corresponding to $t=-4$\,.

\begin{solution*}
\begin{align*}
 \frac{dy}{dx}&=\frac{\frac{dy}{dt}}{\frac{dx}{dt}} =\frac{2t}{3t^2}= \frac{2}{3t} \\
 \left.\frac{dy}{dx}\right|_{t=-4} &= \frac{2}{3(-4)}=\frac{2}{-12}=-\frac{1}{6} 
\end{align*}
When $t=-4$ we have 
\begin{align*}
 x=(-4)^3= -64, \,\, y=(-4)^2-1=16-1=15\,.
\end{align*}
The equation of the tangent line is, using the point-slope formula $y=m(x-x_0)+y_0$, 
\begin{align*}
  y&=-\frac{1}{6}[x-(-64)]+15 \implies y=-\frac{1}{6}(x+64)+15 \\
  \implies y&=-\frac{1}{6}x-\frac{64}{6} +15\implies y=-\frac{1}{6}x-\frac{32}{3}+15
\implies y=-\frac{1}{6}x + \frac{13}{3}\,.
\end{align*}
\end{solution*}

\begin{furtherquestion}
  Find the equation of the tangent line to the curve $x(t)=1-t^3$, $y(t)=t^2-3t+1$ at the point corresponding to $t=1$\,.
\end{furtherquestion}
\end{example}

\begin{example}
  Find the equation(s) of the tangent(s) to the curve $x(t)=2\sin t$, $y(t)=3\cos t$, $t$~in $[0,2\pi)$ at the point~$\left(\sqrt{2},\frac{3\sqrt{2}}{2}\right)$.

  \begin{solution}
    Solving for $t$ for the given point $(x,y)=\left(\sqrt{2},\frac{3\sqrt{2}}{2}\right)$ gives
    \begin{align*}
      \sqrt{2}&=2\sin t\implies\sin t=\frac{\sqrt{2}}{2}\implies t=\left\{\begin{array}{l}\frac{\pi}{4}+2n\pi\\[.5em]
                                                                          \pi-\frac{\pi}{4}+2n\pi
                                                                         \end{array}\right.=\left\{\begin{array}{l}\frac{\pi}{4}+2n\pi\\[.5em]
                                                                          \frac{3\pi}{4}+2n\pi
                                                                         \end{array}\right.(n\ \text{an integer})\\
      \frac{3\sqrt{2}}{2}&=3\cos t\implies\cos t=\frac{\sqrt{2}}{2}\implies t=\left\{\begin{array}{l}\frac{\pi}{4}+2n\pi\\[.5em]
                                                                          2\pi-\frac{\pi}{4}+2n\pi
                                                                         \end{array}\right.=\left\{\begin{array}{l}\frac{\pi}{4}+2n\pi\\[.5em]
                                                                          \frac{7\pi}{4}+2n\pi
                                                                         \end{array}\right.(n\ \text{an integer})
    \end{align*}
    Since both equations must hold and $t$ also lie in $[0,2\pi)$ we conclude $\displaystyle t=\frac{\pi}{4}$. Thus the curve only passes through the point at this value of the parameter and hence only one tangent line can occur.  We now evaluate the derivative at the value $\displaystyle t=\frac{\pi}{4}$. 
  \begin{align*}
 \frac{dy}{dx}&=\frac{\frac{dy}{dt}}{\frac{dx}{dt}} =\frac{-3\sin t}{2\cos t} \\  
 \left. \frac{dy}{dx}\right|_{t=\frac{\pi}{4}} &= -\frac{3\sin \frac{\pi}{4}}{2\cos \frac{\pi}{4}}=-\frac{3\left(\frac{\sqrt{2}}{2}\right)}{2\left(\frac{\sqrt{2}}{2}\right)}=-\frac{3}{2}
  \end{align*}
Thus the equation of the tangent line is
\begin{align*}
y&=-\frac{3}{2}(x-\sqrt{2})+\frac{3\sqrt{2}}{2}\\
\implies y&=-\frac{3}{2}x + \frac{3\sqrt{2}}{2}+\frac{3\sqrt{2}}{2}
\implies y=-\frac{3}{2}x + 3\sqrt{2}\,.
\end{align*}
\end{solution}

\begin{furtherquestion}
  Find the equation(s) of the tangent(s) to the curve $x(t)=1-2\cos^2\!t$, $y(t)=(\tan t)(1-2\cos^2\!t)$, $t$~in $(-\pi/2,\pi/2)$ at the point~$(0,0)$.
\end{furtherquestion}
\end{example}

%TODO: Note in the following example one has a vertical tangent due to the
%behaviour of dy/dt not dx/dt=0.  This points to the fact that there is a
%problem with our original discussion of how vertical tangents can, in fact
%occur.  Maybe that discussion should be modified.  Also there are no
%horizontal tangents in the following problem.
\begin{example}
  For the following curves
  \begin{multicols}{2}
    \begin{enumerate}
    \item $\displaystyle x(t)=4t^2,\,\, y(t)=t^3-t$
    \item $\displaystyle x(t)= 3(t-\sin t), \,\, y(t)=3(1-\cos t)$
    \end{enumerate}
  \end{multicols}
  \begin{enumerate}[label=(\alph*)]
  \item Find the points at which the tangent line is horizontal or vertical.
  \item Find $\displaystyle \frac{d^2y}{dx^2}$ and discuss the concavity. 
  \end{enumerate}
\begin{solution*}
\begin{enumerate}
\item $\displaystyle x(t)=4t^2,\,\, y(t)=t^3-t$
  
  Note the curve is defined for all $t$ in $\mathset{R}$. Taking derivatives gives
\begin{align*}
 \frac{dy}{dx}&=\frac{\frac{dy}{dt}}{\frac{dx}{dt}} =\frac{3t^2-1}{8t}= \frac{3}{8}t-\frac{1}{8t}\\
 \frac{d^2y}{dx^2}&=\frac{\frac{d}{dt}\left(\frac{dy}{dt}\right)}{\frac{dx}{dt}}=\frac{\frac{3}{8}+ \frac{1}{8t^2}}{8t}=\frac{3}{64t}+ \frac{1}{64t^3}=\frac{3t^2+1}{64t^3}\,.
\end{align*}
\begin{enumerate}
\item $\displaystyle\frac{dy}{dt}=0\implies 3t^2-1=0\implies t=\pm\sqrt{\frac{1}{3}}=\pm\frac{1}{\sqrt{3}}=\pm\frac{\sqrt{3}}{3}$. At these values of $t$, $\displaystyle\frac{dx}{dt}\neq0$ and thus the following are points with horizontal tangents.
  \begin{align*}
    t&=\frac{\sqrt{3}}{3}\implies (x,y)=\left(4\left(\frac{\sqrt{3}}{3}\right)^2,\left(\frac{\sqrt{3}}{3}\right)^3-\frac{\sqrt{3}}{3}\right)=\left(\frac{4}{3},-\frac{2\sqrt{3}}{9}\right)\\
    t&=-\frac{\sqrt{3}}{3}\implies (x,y)=\left(4\left(-\frac{\sqrt{3}}{3}\right)^2,\left(\frac{-\sqrt{3}}{3}\right)^3+\frac{\sqrt{3}}{3}\right)=\left(\frac{4}{3},\frac{2\sqrt{3}}{9}\right)
  \end{align*}
  Solving $\displaystyle\frac{dx}{dt}=0\implies 8t=0\implies t=0$.  At this value of $t$, $\displaystyle\frac{dy}{dt}=-1\neq0$ and thus the point $(x,y)=(4(0)^2,0^3-0)=(0,0)$ has a vertical tangent.
\item $\displaystyle \frac{d^2y}{dx^2}$ is not defined if $t=0$. It vanishes nowhere since $3t^2+1>0$\,.  Thus we need to consider two intervals for $t$,  $(-\infty, 0)$ and $(0, \infty)$\,.  On the interval $(-\infty, 0)$ we have
  \begin{align*} 
    \frac{d^2y}{dx^2}=\frac{(+)}{(+)(-)^3}<0\,.
  \end{align*}
  Thus on $(-\infty, 0)$ the curve is concave down. On the interval $(0, \infty)$ we have
  \begin{align*}
    &\frac{d^2y}{dx^2}=\frac{(+)}{(+)(+)^3}>0\,.
  \end{align*}
Thus on $(0, \infty)$ the curve is concave up.
\end{enumerate}
These properties can be identified on the following plot of the curve.
\begin{center}
  \includegraphics[width=.33\textwidth]{graphics/parametric_equations8}
\end{center}
\item $\displaystyle x(t)= 3(t-\sin t), \,\, y(t)=3(1-\cos t)$
  
  Once again the curve is defined for all $t$ in $\mathset{R}$.  Calculating derivatives gives
\begin{align*}
  \frac{dy}{dx}&=\frac{\frac{dy}{dt}}{\frac{dx}{dt}} =\frac{3\sin t}{3(1-\cos t)} =\frac{\sin t}{1-\cos t} \\  
  \frac{d^2y}{dx^2}&=\frac{\frac{d}{dt}\left(\frac{dy}{dt}\right)}{\frac{dx}{dt}}
                     =\frac{\frac{\cos t(1-\cos t)-\sin t (\sin t)}{(1-\cos t)^2}}{3(1-\cos t)}
                     =\frac{\cos t-\cos ^{2}t-\sin^{2}t}{3(1-\cos t)^3}\\
               &=\frac{\cos t-1}{3(1-\cos t)^3}
                 =-\frac{1-\cos t}{3(1-\cos t)^3}
                 =-\frac{1}{3(1-\cos t)^2}\,.
\end{align*}
\begin{enumerate}
  \item We solve $\frac{dy}{dt}=0$ and $\frac{dx}{dt}=0$,
    \begin{align*}
      \frac{dy}{dt}&=0\implies\sin t=0\implies t=\left\{\begin{array}{l}0+2n\pi\\[.5em]
                                                                          \pi+2n\pi
                                                                         \end{array}\right.=\left\{\begin{array}{l}2n\pi\\[.5em]
                                                                          (2n+1)\pi
                                                                         \end{array}\right.(n\ \text{an integer})\\
      \frac{dx}{dt}&=0\implies 3(1-\cos t)=0\implies\cos t=1\implies t=0+2n\pi=2n\pi\ \  (n\ \text{an integer})\,.
    \end{align*}
    Now $\frac{dy}{dt}=0$ and $\frac{dx}{dt}\neq 0$ when $t=(2n+1)\pi$ so there are horizontal asymptotes at the points having coordinates
    \begin{align*}
      x&=3\left[(2n+1)\pi-\sin\left((2n+1)\pi\right)\right]=3[(2n+1)\pi+0]=(6n+3)\pi\\
      y&=3\left(1-\cos\left((2n+1)\pi\right)\right]=3(1-(-1))=6\,,
    \end{align*}
    so $(x,y)=(6n\pi+3\pi,6)$, $n$ an integer.

    There are no values of $t$ for which $\frac{dx}{dt}=0$ and $\frac{dy}{dt}\neq0$ so we cannot discern vertical asymptotes from that criterion.  When $t=2n\pi$ both derivatives vanish and we must consider the limit
    \begin{align*}
      \lim_{t\to 2n\pi}\frac{dy}{dx}=\lim_{t\to2n\pi}\frac{\sin t}{1-\cos t}=\lim_{t\to2n\pi}\frac{\cos t}{\sin t}=\lim_{t\to 2n\pi}\cot t\,.
    \end{align*}
    Noting that $\displaystyle\lim_{t\to 2n\pi^-}\cot t=-\infty$ and $\displaystyle\lim_{t\to 2n\pi^+}\cot t=\infty$\, we observe that vertical asymptotes occur when $t=2n\pi$.  The coordinates there are
    \begin{align*}
      x&=3\left[2n\pi-\sin(2n\pi)\right]=3[2n\pi+0]=6n\pi\\
      y&=3\left(1-\cos(2n\pi)\right]=3(1-1)=0\,,
    \end{align*}
    so $(x,y)=(6n\pi,0)$, $n$ an integer.

  \item The second derivative $\frac{d^2y}{dt^2}=-\frac{1}{3(1-\cos t)^2}<0$ where it is defined.  That occurs except when $\cos t=1\implies t=2n\pi$.  Thus the curve is concave downward everywhere except at points $(x,y)=(6n\pi,0$), $n$ an integer, where concavity is not defined.
\end{enumerate}
\end{enumerate}
A plot of the curve illustrates these findings.
\begin{center}
  \includegraphics[width=.8\textwidth]{graphics/parametric_equations9}
\end{center}
\end{solution*}

\begin{furtherquestions}
For the curve given by $x(t)=3t^2-6t$, $y(t)=\sqrt{t}$, with $t\ge 0$,
\begin{enumerate}
\item Find the points at which the tangent line is horizontal or vertical.
\item Find $\frac{d^2\!y}{dx^2}$ and discuss the concavity.
\end{enumerate}
\end{furtherquestions}
\end{example}

\textbook{\clearpage}
\subsection{Area Under the Curve} \index{parametric curve! area under}

For non-negative function $F(x)$, the area under the curve $y=F(x)$ and above the $x$-axis for $a\le x\le b$ is found using vertical area elements and is given by $A=\int_a^b F(x)\,dx=\int_a^b y\,dx$. If the curve is parametrically defined by $x=f(t)$, $y=g(t)$, for $t$ in $[t_a,t_b]$, so that $a=f(t_a)$ and $b=f(t_b)$, the area becomes, upon change of variables via $x=f(t)$ and noting $dx=\frac{dx}{dt}\,dt$,

\[A=\int_a^by\,dx=\int_{t_a}^{t_b}y\frac{dx}{dt}\,dt=\int_{t_a}^{t_b}g(t)f'(t)\,dt\]

\begin{example}
  Find the area enclosed by the $x$-axis and the given curve.
  \begin{multicols}{2}
    \begin{enumerate}
    \item $\displaystyle x(t)=e^{2t}+3, \,\, y(t)=t-t^2$
    \item $\displaystyle x(t)=t+2, \,\, y(t)=-t^2+4t+5$
    \end{enumerate}
  \end{multicols}
\begin{solution*}
  \begin{enumerate}
  \item $\displaystyle x(t)=e^{2t}+3, \,\, y(t)=t-t^2$

    The intersection points of the curve with the $x$-axis occur when $y=0$.
    \begin{align*}
      y(t)=0 \implies t-t^2=0 \implies t(t-1)=0 \implies t=0\ \text{or}\ t=1  
    \end{align*}
    Evaluating $x(t)$ gives the points $(4,0)$ and $(e^2+3,0)$ respectively.  
    A graph of the curve follows.
    \begin{center}
      \includegraphics[width=.6\textwidth]{graphics/parametric_equations4}%
    \end{center}
    The area enclosed by the given curve and the $x$-axis is therefore
    \begin{align*}
      A=\int_0^1 y\frac{dx}{dt}dt&=\int_{0}^{1} (t-t^2)(2e^{2t})\,dt 
     =\left.\rule{0em}{1.24em}(t-t^2)e^{2t}\right|_0^1-\int_0^1e^{2t}(1-2t)\,dt\\
     &=\left[(t-t^2)e^{2t}-(1-2t)\left(\frac{e^{2t}}{2}\right)\right|_0^1+\int_0^1\frac{e^{2t}}{2}(-2)\,dt\\
     &=\left[(t-t^2)e^{2t}-\frac{1}{2}(1-2t)e^{2t}-\frac{1}{2}e^{2t}\right|^1_0 \\
    &=(1-1)e^2-\frac{1}{2}(1-2)e^2-\frac{1}{2}e^2-\left[(0-0)e^0 - \frac{1}{2}(1-0)e^0-\frac{1}{2}e^0 \right]\\
    &=\frac{1}{2}e^2-\frac{1}{2}e^2+\frac{1}{2}+\frac{1}{2}=1\,\,\text{square unit}\,,
   \end{align*}
   where here we used repeated Integration by Parts.
 \item $\displaystyle x(t)=t+2, \,\, y(t)=-t^2+4t+5$

   First find the intersection points of the given curve and the $x$-axis.
    \begin{align*}
    y(t)=0 &\implies -t^2+4t+5=0 \implies t^2-4t-5=0
             \implies (t+1)(t-5)=0\\
      & \implies t=-1\ \text{or}\ t=5
    \end{align*}
    Substituting these values for $x(t)$ gives the intersection with the $x$-axist to be the points $(1,0)$ and $(7,0)$.  A graph of the curve is as follows.
    \begin{center}
      \includegraphics[width=.7\textwidth]{graphics/parametric_equations5}%
    \end{center}
    Thus the area enclosed by the given curve and the $x$-axis is
    \begin{align*}
    A=\int_0^1 y\frac{dx}{dt}dt&=\int_{-1}^{5}(-t^2+4t+5)(1)\, dt
    =\left.-\frac{1}{3}t^3+2t^2+5t\right|^{5}_{-1} \\
     &=-\frac{1}{3}(5)^{3}+2(5)^2+5(5)-\left[-\frac{1}{3}(-1)^3+2(-1)^2+5(-1)\right] \\
     &=-\frac{125}{3}+50+25-\frac{1}{3}-2+5 \\
    &=-\frac{126}{3} +78=\frac{-126+234}{3}=\frac{108}{3}\,\,\text{square units}.
    \end{align*}
\end{enumerate}
\end{solution*}

\begin{furtherquestion}
  Find the area enclosed by the $x$-axis and the curve $x=1+\sin t$, $y=\frac{\pi}{2}t-t^2$.
\end{furtherquestion}
\end{example}


Similarly if a curve is defined by the non-negative function $x=G(y)$ for $c\le y\le d$ then the area between that curve and the $y$-axis is found using horizontal area elements and is given by $A=\int_c^d G(y)\,dy=\int_c^d x\,dy$.   If the curve is parametrically defined by $x=f(t)$, $y=g(t)$, for $t$ in $[t_c,t_d]$, such that $c=g(t_c)$ and $d=g(t_d)$, the area becomes, upon changinge variable via $y=g(t)$ and noting $dy=\frac{dy}{dt}\,dt$,

\[A=\int_c^dx\,dy=\int_{t_c}^{t_d}x\frac{dy}{dt}\,dt=\int_{t_c}^{t_d}f(t)g'(t)\,dt\]

These formulae can be generalized for areas between parametric curves by consideration of the coordinates of the endpoints of the area elements. 

\begin{example}\label{exam:paramarea}%
Find the area enclosed by the curve described by the parametric equations. 
\begin{align*}
x(t)=2 + \sin t, \,\, y(t)=1+\cos t; \,\, 0 \leq t \leq 2\pi\,.
\end{align*}
\begin{solution*}
  
A graph of the parametric curve follows.
\begin{center}
\includegraphics[width=.7\textwidth]{graphics/parametric_equations6}%
\end{center}
In this case we can use vertical or horizontal area elements.  We choose the latter (as shown) because the rightmost curve corresponds to $t$ in $[0,\pi]$ while the leftmost curve corresponds to $[\pi,2\pi]$. Considering the right endpoint of the element to be $(x_2,y)$ and the left endpoint to be $(x_1,y)$ the 
differential area element is $dA=(x_2-x_1)dy$.  The area is given by the integral
\begin{align*}
  A=\int_0^2(x_2-x_1)dy&=\int_0^2x_2dy-\int_0^2x_1dy=\int_\pi^0x\frac{dy}{dt}dt-\int_\pi^{2\pi}x\frac{dy}{dt}dt\,.
\end{align*}
Note here that for the first integral the limits of $y=0$ and $y=2$ correspond to $t=\pi$ and $t=0$ respectively since we are following the curve on the right while for the second integral these values of $y$ correspond to $t=\pi$ and $t=2\pi$ as we are then traversing the curve on the left.  Exchanging limits simplifies the integral which can then be evaluated to be
\begin{align*}
  A&=-\int_0^\pi x\frac{dy}{dt}dt-\int_\pi^{2\pi}x\frac{dy}{dt}dt
  = -\int_0^{2\pi}x\frac{dy}{dt}dt\\
  &=-\int_{0}^{2\pi} (2+\sin t)(-\sin t)\,dt
    =\int_{0}^{2\pi} (2\sin t + \sin^{2}\!t)\,dt
    =\int_{0}^{2\pi} \left(2\sin t + \frac{1}{2}\left[1-\cos(2t)\right]\right)dt \\
   &=\int_{0}^{2\pi}\left(2\sin t + \frac{1}{2}-\frac{1}{2}\cos(2t)\right)\,dt
                         =\left[-2\cos t+\frac{1}{2}t -\frac{1}{4}\sin(2t)\right|_0^{2\pi}\\
   &=-2\cos(2\pi) +\frac{1}{2}(2\pi) - \frac{1}{4}\sin(4\pi)-\left[-2\cos(0)+0-\frac{1}{4}\sin(0)\right] \\
   &= -2+\pi+2=\pi\,\,\text{square units}.
\end{align*}
As expected from the diagram this is just the area of a circle of radius $r=1$\,.
\end{solution*}

\begin{furtherquestion}
  Find the area inside the \textbf{deltoid curve} \index{deltoid curve} described by the parametric equations
  \begin{align*}
    x(t)=2a\cos t+a\cos(2t),\ \ y(t)=2a\sin t-a\sin(2t);\ \ 0\le t\le 2\pi\,.
  \end{align*}
  Here $a$ is a positive constant. A graph of the curve is the following.
  \begin{center}
    \includegraphics[width=.6\textwidth]{graphics/parametric_equations7}%
  \end{center}
\end{furtherquestion}
\end{example}

\subsection{Arc Length}\label{subsec:parametricarclength} \index{parametric curve! arc length of} \index{arc length! of parametric curves} \index{arc length}

We have seen that the arc length of a curve $\mathcal{C}$ described by $y=F(x)$ for $a\le x \le b$ is given by 
\[s=\int_a^b\sqrt{1+[F'(x)]^2}\,dx=\int_a^b\sqrt{1+\left(\frac{dy}{dx}\right)^2}\,dx\]
If curve $\mathcal{C}$ is also parameterized by $x=f(t)$, $y=g(t)$, for $t_a\le t\le t_b$ where $t_a=f(a)$ and $t_b=f(b)$ one has, by the change of variable $x=f(t)$, that
\[s=\int_{t_a}^{t_b}\sqrt{1+\left(\frac{dy/dt}{dx/dt}\right)^2}\frac{dx}{dt}\,dt\ ,\]
where here we used our expression for the derivative $\frac{dy}{dx}$ in terms of $t$ found before. If we further assume that our function $x=f(t)$ is an increasing function of $x$, so $dx/dt>0$ and $\sqrt{(dx/dt)^2}=dx/dt$, we may rewrite this:
\[s=\int_{t_a}^{t_b}\sqrt{\left(\frac{dx}{dt}\right)^2+\left(\frac{dy}{dt}\right)^2}\,dt\ .\]
The previous result can be shown to be be true quite generally for any parameterized curve $\mathcal{C}$, not simply for curves that may be described by a function of $x$.
\theorem{Suppose curve $\mathcal{C}$ is traced exactly once by the parameterization $x=f(t)$, $y=g(t)$ as $t$ increases from  $t_i$ to $t_f$.  If derivatives $f'$ and $g'$ exist and are continuous on $[t_i,t_f]$ then the arc length of $\mathcal{C}$ is
\[s=\int_{t_i}^{t_f}\sqrt{\left(\frac{dx}{dt}\right)^2+\left(\frac{dy}{dt}\right)^2}\,dt\ .\]
}

One can recover special case formulae from Chapter~\ref{ch:integration_applications} for $y=F(x)$ using parameterization $x=t$, $y=F(t)$ and for $x=G(y)$ using parameterization $x=G(t)$, $y=t$.  

Note that the formula is easily remembered by $s=\int\!ds$, where the differential arc length element $ds=\sqrt{dx^2+dy^2}$\,.  This formula requires some form of parameterization of the curve for its application.  However, the differential $ds=\sqrt{dx^2+dy^2}$ reflects the fact that the arc length of a curve is independent of the parameterization of the curve chosen to calculate it.

\begin{example}
Find the length of the given curve.
\begin{enumerate}
    \item $\displaystyle x(t)=e^{2t}\cos t, \,\, y(t)=e^{2t}\sin t; \,\, 0\leq t\leq \frac{\pi}{2}$
    \item $\displaystyle x(t)=2+\sin t, \,\, y(t)=1+\cos t; \,\, 0 \leq t \leq 2\pi$
\end{enumerate}
\begin{solution*}
\begin{enumerate}
\item $\displaystyle x(t)=e^{2t}\cos t, \,\, y(t)=e^{2t}\sin t; \,\, 0\leq t\leq \frac{\pi}{2}$
  
A graph showing the parametric curve over the given interval is the following.
\begin{center}
\includegraphics[width=.4\textwidth]{graphics/parametric_equations10}%
\end{center}
After taking the derivatives
  \begin{align*}
    \frac{dx}{dt}&=2e^{2t}\cos t-e^{2t}\sin t\\
    \frac{dy}{dt}&=2e^{2t}\sin t +e^{2t}\cos t\,,
  \end{align*}
  we evaluate
  \begin{align*}
\left(\frac{dx}{dt}\right)^{2}+\left(\frac{dy}{dt}\right)^{2} &=(2e^{2t}\cos t-e^{2t}\sin t)^2+ (2e^{2t}\sin t+e^{2t}\cos t)^2 \\
                                                              &=4e^{4t}\cos^{2}\!t-4e^{4t}\cos t\sin t +e^{4t}\sin ^{2}\!t\\
    &~~~+ 4e^{4t}\sin ^{2}\!t +4e^{4t}\cos t \sin t + e^{4t}\cos ^{2}\!t \\
&=4e^{4t} + e^{4t}=5e^{4t}\,.
    \end{align*}
Thus the arc length is
\begin{align*}
 s&=\int_{0}^{\frac{\pi}{2}} \sqrt{\left(\frac{dx}{dt}\right)^2+\left(\frac{dy}{dt}\right)^2}\, dt
 =\int_{0}^{\frac{\pi}{2}}\sqrt{5e^{4t}}\, dt 
 =\sqrt{5}\int_{0}^{\frac{\pi}{2}}e^{2t}\, dt
 =\left.\frac{\sqrt{5}}{2}e^{2t}\right|^{\frac{\pi}{2}}_{0} \\
 &=\frac{\sqrt{5}}{2}e^{\pi}-\frac{\sqrt{5}}{2}e^0
 =\frac{\sqrt{5}}{2}(e^{\pi}-1)\,\,\text{units}.
\end{align*}
\item $\displaystyle x(t)=2+\sin t, \,\, y(t)=1+\cos t; \,\, 0 \leq t \leq 2\pi$
  \begin{align*}
  \frac{dx}{dt}=\cos t,\,\,\, \frac{dy}{dt}=-\sin t\implies
   \left(\frac{dx}{dt}\right)^2+\left(\frac{dy}{dt}\right)^2=\cos^{2}t +\sin^{2}t =1   
    \end{align*}
    Thus the arc length is given by
    \begin{align*}
     s=\int_{0}^{2\pi}\sqrt{\left(\frac{dx}{dt}\right)^2+\left(\frac{dy}{dt}\right)^2}  \,dt
     =\left.\int_{0}^{2\pi}(1)\, dt= t\right|^{2\pi}_0
     =2\pi-0=2\pi\,\,\text{units}.
    \end{align*}
    Note that a graph of the parametric curve is the same as in Example~\ref{exam:paramarea}, namely a circle of radius $r=1$ centred at $(2,1)$.  As such its arc length is just the circumference $2\pi r=2\pi$ as found.
\end{enumerate}
\end{solution*}

\begin{furtherquestion}
  Find the length $s$ of the arc of the circle $x=R\cos\theta$, $y=R\sin\theta$ for $0\le\theta\le\frac{2\pi}{3}$ where $R$ is the constant radius.
\end{furtherquestion}
\end{example}

\begin{exercise}
\input{PARAMETRIC_EQUATIONS/calculus-of-parametric-curves.tex}
\end{exercise}

\begin{reviewexercise}
\input{PARAMETRIC_EQUATIONS/parametric-equations-review.tex}
\end{reviewexercise}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% End:
