\subsection{2018 Free-Response Answers}
\begin{enumerate}
	\item \begin{enumerate}
		\item $r(t)$ tells us the rate at which people enter the line.
			By integrating $r(t)$ over the given interval, we can find the total number of people who entered the line.
			Using a calculator,
			\begin{equation*}
				\int_{0}^{300}{r(t)\d{t}} = \int_{0}^{300}{44\left(\frac{t}{100}\right)^3\left(1-\frac{t}{300}\right)^7\d{t}} = 270 \text{ people}.
			\end{equation*}
		\item We know that at $t=0$, there are already 20 people in line.
			Combining this fact with our answer from part (a), we know that $270+20=290$ people entered the line in the time interval.
			We also know that people leave the line at a constant rate of 0.7 people per second.
			Integrating this rate over the time interval will give us the number of people who left the line.
			\begin{equation*}
				\int_{0}^{300}{0.7\d{t}} = 210 \text{ people}.
			\end{equation*}
			So, there are $290-210=80$ people in line at $t=30$.
		\item We know from our answer in (b) that there are 80 people in line at $t=300$.
			We see from $r(t)$ that no more people are entering the line when $t>300$.
			So, the only thing that contributes to changing the number of people in line is people constantly leaving at a rate of 0.7 people per second.
			\begin{equation*}
				300\text{s} + \frac{80 \text{ people}}{0.7\text{ people/s}} \approx 414.286\text{s}.
			\end{equation*}
		\item Combining the fact that there are initially 20 people in line, the inflow rate is given by $r(t)$ and the outflow rate is 0.7, we can get that the number of people in line at time $x$ is modeled by
		\begin{equation*}
			20 + \int_{0}^{x}{\left(r(t)-0.7\right)\d{t}}.
		\end{equation*}
		Finding when the derivative is 0,
		\begin{equation*}
			r(t) - 0.7 = 0 \implies t = 33.013 \text{ or } 166.575.
		\end{equation*}
		Finding the number of people in line at these times and the endpoints 0 and 300,
		\begin{align*}
			\text{people}_{0} &= 20 \\
			\text{people}_{33.013} &= 3.803 \\
			\text{people}_{166.575} &= 158.070 \\
			\text{people}_{300} &= 80,
		\end{align*}
		we see that the fewest number of people occurs when $t\approx 33.013\text{s}$.
	\end{enumerate}

	\item \begin{enumerate}
		\item Using a calculator, we see that $p^\prime(25) = -1.17906$.
			In the context of the problem, this value means that at a depth of 25 meters, the density of plankton is decreasing at a rate of 1.17906 million plankton per cubic meter per meter.
		\item The vertical density of the plankton in the column is given by $p(h)*3\text{m}^2$.
			Integrating this density function for $0 \leq h \leq 30\text{m}$, we'll get the total number of plankton on the column.
			\begin{equation*}
				\int_{0}^{30}{3p(h)\d{h}} \approx 1675.414.
			\end{equation*}
			So, there are 1675.414 million plankton in the column from 0 to 30 meters depth.
		\item The total number of plankton in the entire vertical column with cross section area $A\text{m}^2$ is given by
			\begin{equation*}
				P = \int_{0}^{\infty}{A\text{density}(h)\d{h}}.
			\end{equation*}
			We can break this integral up, and we can use $A=3\text{m}^2$ for our particular column.
			\begin{equation*}
				P = 3\int_{0}^{30}{p(h)\d{h}} + 3\int_{30}^{\infty}{f(h)\d{h}}.
			\end{equation*}
			Since $u(h) \geq f(h)$ for $h \geq 30$, we can write the following inequality, the right side of which we can numerically evaluate:
			\begin{align*}
				P &\leq 3\int_{0}^{30}{p(h)\d{h}} + 3\int_{0}^{\infty}{u(h)\d{h}} \\
				&\leq 1675.414 + 3(105) \\
				&\leq 1990.414.
			\end{align*}
			So, we see that the number of plankton in the entire vertical column is at most 1990.414 million, which is strictly less than 2000 million.
		\item Since the position of the boat is parametric, we can use the parametric arc length formula to find the total distance traveled for $0 \leq t \leq 1\text{hr}$.
			\begin{align*}
				D &= \int_{0}^{1}{\sqrt{(x^\prime(t))^2+(y^\prime(t))^2}\d{t}} \\
				&= \int_{0}^{1}{\sqrt{\left(662\sin{(5t)}\right)^2 + \left(880\cos{(6t)}\right)^2}\d{t}} \\
				&\approx 757.456.
			\end{align*}
			So, for $0 \leq t \leq 1\text{hr}$, the boat travels a distance of 757.456 meters.
	\end{enumerate}

	\item \begin{enumerate}
		\item Trying to treat this like an initial value problem would be too tedious with all the piecewise parts of $g$.
			Plus, it would be doing more than the question asked because it only wants the value of $f$ at a particular point, not an expression for $f$.
			Instead, we can use the fact that $g$ is the derivative of $f$ and apply the Fundamental Theorem of Calculus.
			\begin{equation*}
				\int_{-5}^{1}{g(x)\d{x}} = f(1) - f(-5) = 3 - f(-5).
			\end{equation*}
			Evaluating the integral geometrically,
			\begin{equation*}
				\int_{-5}^{1}{g(x)\d{x}} = -(9+\frac{3}{2}) + 1 = \frac{-19}{2}.
			\end{equation*}
			Solving for $f(-5)$,
			\begin{equation*}
				\frac{-19}{2} = 3 - f(-5) \implies f(-5) = \frac{25}{2}.
			\end{equation*}
		\item Evaluating the integral,
			\begin{align*}
				\int_{1}^{6}{g(x)\d{x}} &= \int_{1}^{3}{2\d{x}} + \int_{3}^{6}{2(x-4)^2\d{x}} \\
				&= 2x\biggr\rvert_{1}^{3} + \frac{2}{3}(x-4)^3\biggr\rvert_{3}^{6} \\
				&= 4 + \frac{18}{3} \\
				&= 10.
			\end{align*}
		\item $f$ is increasing when its first derivative is positive and concave up when its second derivative is positive.
			Since $g$ is the derivative of $f$, we can also say that $f$ is increasing when $g$ is positive and concave up when $g$ is increasing.
			$g$ is positive on $(0,4) \cup (4,6]$.
			$g$ is increasing on $(-2,-1) \cup (0,1) \cup (4,6)$.
			Taking the intersection of these intervals, we see that $f$ is increasing and concave up on $(0,1) \cup (4,6)$.
		\item $f$ has an inflection point when its second derivative is equal to 0, changing sign.
			Since $g$ is the derivative of $f$, we can also say that $f$ has an inflection point when the derivative of $g$ is equal to 0, changing sign.
			Although we see by looking at the graph that the derivative of $g$ is 0 over several intervals, it does not change sign.
			The only place the derivative is 0 and changes sign is at $x=4$.
	\end{enumerate}

	\item \begin{enumerate}
		\item We can approximate $H^\prime(6)$ as the average rate of change between $t=5$ and $t=7$.
			\begin{equation*}
				H^\prime(6) \approx \frac{H(7)-H(5)}{7-5} = \frac{11-6}{7-5} = \frac{5}{2}.
			\end{equation*}
			In the context of this problem $H^\prime(6) \approx = \frac{5}{2}$ means that at 6 years, the tree is growing at a rate of 5/2 meters per year.
		\item Looking at the average rate of change between $t=3$ and $t=5$,
			\begin{equation*}
				\bar{H^\prime}_{3,5} = \frac{H(5)-H(3)}{5-3} = \frac{6-2}{5-3} = 2.
			\end{equation*}
			Since $H$ is differentiable, it is also continuous.
			So, by the mean value theorem, there is at least one point $3 \leq c \leq 5$ (which is a sub-interval of $2 \leq t \leq 10$) such that $H^\prime(c) = 2$.
		\item We know that the average value of a continous function $f$ over some interval $[a,b]$ is
			\begin{equation*}
				\bar{f}_{a,b} = \frac{1}{b-a}\int_{a}^{b}{f(x)\d{x}}.
			\end{equation*}
			So, over our interval of $[2,10]$, we need to approximate this integral using trapezoids.
			Because the sub-interval widths given by the table are not equally-sized, we can't apply the shortcut trapezoidal rule.
			However, we can still approximate the area using trapezoids.
			\begin{equation*}
				\frac{1}{10-2}\int_{2}^{10}{H(x)\d{x}} \approx \frac{1}{8}\left(\frac{1.5+2}{2}1+\frac{2+6}{2}2+\frac{6+11}{2}2+\frac{11+15}{2}3\right) = \frac{1}{8}(65.75) = 8.21875.
			\end{equation*}
			So, the average height of the tree between 2 and 10 years is approximately 8.21875 meters.
		\item Finding the diameter of the base of the tree when it is 50 meters tall according to $G$.
			\begin{equation*}
				50 = \frac{100x}{1+x} \implies x = 1.
			\end{equation*}
			Differentiating $G$, remembering the chain rule,
			\begin{equation*}
				G^\prime(x) = \frac{100(1+x)\dd{x}{t} - 100x\dd{x}{t}}{(1+x)^2}.
			\end{equation*}
			Plugging in $x=1$ and $\dd{x}{t}=0.03$,
			\begin{equation*}
				G^\prime(1) = \frac{100(1+1)(0.03) - 100(1)(0.03)}{(1+1)^2} = \frac{6-3}{4} = \frac{3}{4}.
			\end{equation*}
			So, according to $G$, the tree is growing at 3/4 meters per year when it is 50 meters tall.
	\end{enumerate}

	\item \begin{enumerate}
		\item We know the formula for the area between two polar curves is
			\begin{equation*}
				A = \frac{1}{2}\int_{\alpha}^{\beta}{\left(f^2(\theta)-g^2(\theta)\right)\d{\theta}}.
			\end{equation*}
			Since we want the area inside the circle and outside the lima\c{c}on for $\pi/3 \leq \theta \leq 5\pi/3$,
			\begin{equation*}
				A = \frac{1}{2}\int_{\pi/3}^{5\pi/3}{\left((4)^2-(3+2\cos{\theta})^2\right)\d{\theta}}.
			\end{equation*}
		\item Remembering that $x=r\cos{\theta}$ and $y=r\sin{\theta}$,
			\begin{equation*}
				x = (3+2\cos{\theta})\cos{\theta} \text{, } y = (3+2\cos{\theta})\sin{\theta}.
			\end{equation*}
			Differentiating $x$ and $y$ with respect to $\theta$,
			\begin{equation*}
				\dd{x}{\theta}=-(3+2\cos{\theta})\sin{\theta} + \cos{\theta}(-2\sin{\theta}) \text{, } \dd{y}{\theta} = (3+2\cos{\theta})\cos{\theta} + \sin{\theta}(-2\sin{\theta}).
			\end{equation*}
			Dividing one by the other,
			\begin{equation*}
				\dd{y}{x} = \frac{\dd{y}{\theta}}{\dd{x}{\theta}} = \frac{(3+2\cos{\theta})\cos{\theta} + \sin{\theta}(-2\sin{\theta})}{-(3+2\cos{\theta})\sin{\theta} + \cos{\theta}(-2\sin{\theta})}.
			\end{equation*}
			At $\theta=\pi/2$,
			\begin{equation*}
				\dd{y}{x}_{\theta=\pi/2} = \frac{(3+2\cdot 0)\cdot 0 + 1(-2\cdot 1)}{-(3+2\cdot 0)1 + 0(-2\cdot 1)} = \frac{-2}{-3} = \frac{2}{3}.
			\end{equation*}
		\item $r$ is a function of $\theta$, and we're being told that $\theta$ behaves as a function of $t$, due to how the particle moves.
			So, we can apply the chain rule:
			\begin{align*}
				\dd{r}{t} &= \dd{r}{\theta}\cdot\dd{\theta}{t} \\
				&= -2\sin{\theta}\dd{\theta}{t}.
			\end{align*}
			Solving for $\dd{\theta}{t}$,
			\begin{equation*}
				\dd{\theta}{t} = \dd{r}{t}\frac{1}{-2\sin{\theta}}.
			\end{equation*}
			Moving away from the origin at some rate tell us how $r$ changes.
			Plugging in $\dd{r}{t}=3$ and $\theta=\pi/3$,
			\begin{equation*}
				\dd{\theta}{t} = 3\frac{1}{-2\sin{\left(\pi/3\right)}} = \frac{3}{-\sqrt{3}} = -\sqrt{3}.
			\end{equation*}
			So, $\theta$ is changing at a rate of $-\sqrt{3}$ radians per second.
	\end{enumerate}

	\item \begin{enumerate}
		\item Starting with the given Maclaurin series,
			\begin{equation*}
				\ln{(1+u)} = u - \frac{u^2}{2} + \frac{u^3}{3} - \frac{u^4}{4} + \ldots + (-1)^{n+1}\frac{u^n}{n} + \ldots .
			\end{equation*}
			Substituting $u=x/3$,
			\begin{equation*}
				\ln{\left(1+\frac{x}{3}\right)} = \frac{x}{3} - \frac{(\frac{x}{3})^4}{2} + \frac{(\frac{x}{3})^4}{3} - \frac{(\frac{x}{3})^4}{4} + \ldots + (-1)^{n+1}\frac{(\frac{x}{3})^n}{n} + \ldots .
			\end{equation*}
			Multiplying by $x$,
			\begin{equation*}
				x\ln{\left(1+\frac{x}{3}\right)} = x\frac{x}{3} - x\frac{(\frac{x}{3})^4}{2} + x\frac{(\frac{x}{3})^4}{3} - x\frac{(\frac{x}{3})^4}{4} + \ldots + (-1)^{n+1}x\frac{(\frac{x}{3})^n}{n} + \ldots .
			\end{equation*}
		\item Applying the ratio test on the absolute terms,
			\begin{equation*}
				\lim_{n\to\infty}{\frac{x\frac{(\frac{x}{3})^{n+1}}{n+1}}{x\frac{(\frac{x}{3})^n}{n}}} = \lim_{n\to\infty}{\frac{n\frac{x}{3}}{n+1}} = \frac{x}{3}.
			\end{equation*}
			The ratio test tells us the series converges when the limit is less than 1, so we can safely say that $\abs{x} < 3$, and we still need to test the endpoints.
			When $x=-3$ the series becomes
			\begin{equation*}
				\sum_{n=1}^{\infty}{(-1)^{n+1}(-3)\frac{\left(\frac{-3}{3}\right)^n}{n}} = \sum_{n=1}^{\infty}{\frac{3}{n}}
			\end{equation*}
			which diverges by the P-Test.
			When $x=3$, the series becomes
			\begin{equation*}
				\sum_{n=1}^{\infty}{(-1)^{n+1}3\frac{\left(\frac{3}{3}\right)^{n}}{n}} = \sum_{n=1}^{\infty}{(-1)^{n+1}\frac{3}{n}}
			\end{equation*}
			which converges by the Alternating Series Test.
			So, the interval of convergence is $-3 < x \leq 3$.
		\item The Alternating Series Estimation Theorem tells us that the error from an alternating series is at most the value of the first term not included, and the error is the same sign as the first not included term.
			For $P_4(x)$,
			\begin{equation*}
				\abs{P_4(2)-f(2)} \leq \abs{(-1)^5 2\frac{\left(\frac{2}{3}\right)^4}{4}} = \frac{8}{81}.
			\end{equation*}
			So, our upper bound on the error is $8/81$.
	\end{enumerate}

\end{enumerate}


\section{Basic techniques and properties}

\begin{outcome}
  \begin{enumerate}
  \item Evaluate the determinant of a square matrix using either
    Laplace Expansion or row operations.
  \item Demonstrate the effects that row operations have on
    determinants.
  \item Verify the following:
    \begin{enumerate}
    \item The determinant of a product of matrices is the product of the
      determinants.
    \item The determinant of a matrix is equal to the determinant of its
      transpose.
    \end{enumerate}
  \end{enumerate}
\end{outcome}


\subsection{Solving}

\begin{frame}
  \frametitle{The Tableau}

  \scriptsize

  The equations $A\vec{x} = \vec{0}$ are kept in a {\bf tableau}, the most
  important structure of the Simplex
  \vfill
  The variables are {\bf partitioned} into the set of {\bf non-basic} \nonbas
  and {\bf basic} \bas  variables
  \vfill
  E.g., \bas = $\{ x_1, x_3, x_4 \}$, \nonbas = $\{ x_2, x_5, x_6 \}$
  $$
  \begin{array}{rcl}
    x_1 & = & 4 x_2 + x_5 \\
    x_3 & = & 5 x_2 + 3 x_6 \\
    x_4 & = & x_5 - x_6
  \end{array}
  $$
  \vfill
  non-basic variables can be considered as {\bf independent}, while basic variables
  assume values forced by the non-basic ones. E.g., in the row
  $$
    x_1 = 4 x_2 + x_5
  $$
  suppose that $x_2 = 2, x_5 = 1$, then we set $x_1 = 9$

\end{frame}

\begin{frame}
  \frametitle{Solving}

  \scriptsize

  The \tsolver stores
  \begin{itemize}
    \item the Tableau (does not grow/shrink)
    \item the active bounds on variables (initially none)
    \item the current model $\mu$ (initially all $0$, but could be chosen differently)
  \end{itemize}

  \vfill

  \begin{columns}

  \begin{column}{.4\textwidth}
  \begin{center}
  Tableau
  \end{center}
  $$
  \begin{array}{rcl}
    x_1 & = & a_{11} x_{m+1} \ldots + a_{1n} x_n  \\
    x_2 & = & a_{21} x_{m+1} \ldots + a_{2n} x_n  \\
    & \ldots \\
    x_i & = & a_{i1} x_{m+1} \ldots + a_{in} x_n  \\
    & \ldots \\
    x_m & = & a_{m1} x_{m+1} \ldots + a_{mn} x_n \\
    \\
    \\
  \end{array}
  $$
  \end{column}

  \begin{column}{.3\textwidth}
  \begin{center}
  $lb$~~~~~~~Bounds~~~~~~~$ub$
  \end{center}
  $$
  \begin{array}{rcccl}
    - \infty & \leq & x_1 & \leq & \infty \\
    - \infty & \leq & x_2 & \leq & \infty \\
    & & \ldots & & \\
    - \infty & \leq & x_i & \leq & \infty \\
    & & \ldots & & \\
    - \infty & \leq & x_m & \leq & \infty \\
    & & \ldots & & \\
    - \infty & \leq & x_n & \leq & \infty \\
  \end{array}
  $$
  \end{column}

  \begin{column}{.3\textwidth}
  \begin{center}
  $\mu$
  \end{center}
  $$
  \begin{array}{rcl}
  x_1 & \mapsto & 0 \\
  x_2 & \mapsto & 0 \\
  & \ldots \\
  x_i & \mapsto & 0 \\
  & \ldots \\
  x_m & \mapsto & 0 \\
  & \ldots \\
  x_n & \mapsto & 0
  \end{array}
  $$
  \end{column}

  \end{columns}

  \vfill

  The \tsolver is in a consistent state if the model $(i)$ respects the tableau
  and $(ii)$ satisfies the bounds (for all $x$, $lb(x) \leq \mu(x) \leq ub(x)$)

\end{frame}

\begin{frame}
  \frametitle{Asserting a bound on a non-basic variable}

  \scriptsize

  Asserting a bound $x \leq c$ (resp. $x \geq c$), $x \in \nonbas$ may result in \pause
  \begin{itemize}
    \item unsatisfiability, if $c < lb(x)$ (resp. $c > ub(x)$) \pause
    \item nothing, if $c > ub(x)$ (resp. $c < lb(x)$) \pause
    \item bound tightening, model not affected if $\mu(x) \leq c$ (resp. $\mu(x) \geq c$) \pause
    \item bound tightening, model affected if $\mu(x) > c$ (resp. $\mu(x) < c$) \pause
  \end{itemize}
  \vfill
  The last case is ``problematic'' because we need to
  \begin{enumerate}[$(i)$]
    \item adjust $\mu(x)$: $\mu(x)$ is set to $c$
    \item adjust the values of basic variables
  \end{enumerate}
  We assume we have a function $Update(x,c)$ that implements $(i)-(ii)$
  \vfill \pause
  \begin{columns}

  \begin{column}{.4\textwidth}
  \begin{center}
  Tableau
  \end{center}
  $$
  \begin{array}{rcl}
    x_1 & = & - x_3 + x_4  \\
    x_2 & = &   x_3 + x_4  \\
    \\
    \\
  \end{array}
  $$
  \end{column}

  \begin{column}{.3\textwidth}
  \begin{center}
  $lb$~~~~~~~Bounds~~~~~~~$ub$
  \end{center}
  $$
  \begin{array}{rcccl}
    - \infty & \leq & x_1 & \leq & \infty \\
    - \infty & \leq & x_2 & \leq & \infty \\
    \only<1-9|handout:0>{-\infty}\only<10->{-8} & \leq & x_3 & \leq & \only<1-7|handout:0>{\infty}\only<8->{-4} \\
    - \infty & \leq & x_4 & \leq & \infty
  \end{array}
  $$
  \end{column}

  \begin{column}{.3\textwidth}
  \begin{center}
  $\mu$
  \end{center}
  $$
  \begin{array}{rcl}
  x_1 & \mapsto & \only<1-8|handout:0>{0}\only<9->{4} \\
  x_2 & \mapsto & \only<1-8|handout:0>{0}\only<9->{-4} \\
  x_3 & \mapsto & \only<1-8|handout:0>{\coloneat{0}{8}}\only<9->{-4} \\
  x_4 & \mapsto & 0
  \end{array}
  $$
  \end{column}

  \end{columns}
  \vfill
  \tsolver stack: \\
  \onslide<8->{$x_3 \leq -4$\ \ \ \ (tighten $ub(x_3)$, affects other values)\\}
  \onslide<10->{$x_3 \geq -8$\ \ \ \ (tighten $lb(x_3)$, does not affect other values)\\}
  \onslide<11->{$x_3 \leq 0$\ \ \ \ \ \  (does not tighten $ub(x_3)$)\\}

\end{frame}

\begin{frame}
  \frametitle{Asserting a bound on a basic variable}

  \scriptsize

  Asserting a bound $x \leq c$ (resp. $x \geq c$), $x \in \bas$ may result in
  the same $4$ cases as before
  \begin{itemize}
    \item unsatisfiability, if $c < lb(x)$ (resp. $c > ub(x)$)
    \item nothing, if $c > ub(x)$ (resp. $c < lb(x)$)
    \item bound tightening, model not affected if $\mu(x) \leq c$ (resp. $\mu(x) \geq c$)
    \item bound tightening, model affected if $\mu(x) > c$ (resp. $\mu(x) < c$)
  \end{itemize}
  \vfill
  however, since a basic variable is {\bf dependent} from non-basic variables in the
  tableau, we cannot use function $Update$ directly. Before we need to
  turn $x$ into a non-basic variables.
  \pause
  \vfill
  So if $\mu(x) > c$ or $\mu(x) < c$ we have to
  \begin{enumerate}[$(i)$]
    \item {\bf turn $x$ into non-basic} (another non-basic variable will become basic instead)
    \item adjust $\mu(x)$: $\mu(x)$ is set to $c$
    \item adjust the values of basic variables
  \end{enumerate}
  \vfill
  Step $(i)$ is performed by a function $Pivot(x,y)$ (see next slide). Therefore asserting
  a bound on a basic variable $x$ consists in executing $Pivot(x,y)$ and then $Update(x,c)$
\end{frame}

\begin{frame}
  \frametitle{Pivoting}

  \scriptsize

  $Pivot(x,y)$ is the operation of swapping a basic variable $x$ with a non-basic variable $y$
  (how to choose $y$ ? See next slide)
  \vfill
  It consists of the following steps:
  \begin{enumerate}
    \item Take the row $x = a y + R$ in the tableau ($R = \mbox{rest of the polynome}$)
    \item Rewrite it as $y = \frac{x - R}{a}$
    \item Substitute $y$ with $\frac{x - R}{a}$ in all the other rows of the tableau (and simplify)
  \end{enumerate}
  \vfill\pause
  Example for $Pivot(x_1,x_3)$
  \vfill
  \ra{1.5}
  \begin{columns}

    \begin{column}{.33\textwidth}
      \begin{center}
      Step 1
      \end{center}
      $$
      \begin{array}{rcl}
	\colone{x_1} & \colone{=} & \colone{3 x_2 + 4 x_3 - 5 x_4} \\
	x_5 & = & - x_2 - x_3 \\
	x_6 & = & 10 x_2 + 5 x_4
      \end{array}
      $$
    \end{column}

    \begin{column}{.33\textwidth}
      \begin{center}
      Step 2
      \end{center}
      $$
      \begin{array}{rcl}
	\colone{x_3} & \colone{=} & \colone{-\frac{3}{4} x_2 + \frac{1}{4} x_1 + \frac{5}{4} x_4} \\
	x_5 & = & - x_2 - x_3 \\
	x_6 & = & 10 x_2 + 5 x_4
      \end{array}
      $$
    \end{column}

    \begin{column}{.33\textwidth}
      \begin{center}
      Step 3
      \end{center}
      $$
      \begin{array}{rcl}
	x_3 & = & -\frac{3}{4} x_2 + \frac{1}{4} x_1 + \frac{5}{4} x_4 \\
	\colone{x_5} & \colone{=} & \colone{- \frac{1}{4} x_2 -\frac{1}{4} x_1 - \frac{5}{4} x_4} \\
	x_6 & = & 10 x_2 + 5 x_4
      \end{array}
      $$
    \end{column}

  \end{columns}
  \vfill\pause
  we moved from $\bas = \{ x_1, x_5, x_6 \}$ to $\bas = \{ x_3, x_5, x_6 \}$

\end{frame}

\begin{frame}
  \frametitle{Choosing Pivoting Variable}

  \scriptsize

  Consider the following situation
  \vfill
  \begin{columns}

  \begin{column}{.4\textwidth}
  \begin{center}
  Tableau
  \end{center}
  $$
  \begin{array}{rcl}
    & \ldots \\
    x_1 & = & 3 x_2 - 4 x_3 + 2 x_4 - x_5 \\
    & \ldots \\
    \\
    \\
  \end{array}
  $$
  \end{column}

  \begin{column}{.3\textwidth}
  \begin{center}
  $lb$~~~~~~~Bounds~~~~~~~$ub$
  \end{center}
  $$
  \begin{array}{rcccl}
     -4 & \leq & x_1 & \leq & 10 \\
      1 & \leq & x_2 & \leq & 3 \\
     -4 & \leq & x_3 & \leq & -1 \\
      1 & \leq & x_4 & \leq & 2 \\
     -1 & \leq & x_5 & \leq & 10 \\
  \end{array}
  $$
  \end{column}

  \begin{column}{.3\textwidth}
  \begin{center}
  $\mu$
  \end{center}
  $$
  \begin{array}{rcl}
  x_1 & \mapsto & \colone{12} \\
  x_2 & \mapsto & 1 \\
  x_3 & \mapsto & -1 \\
  x_4 & \mapsto & 2 \\
  x_5 & \mapsto & -1
  \end{array}
  $$
  \end{column}

  \end{columns}
  \vfill
  which among $\nonbas = \{ x_2, x_3, x_4 \}$ do I choose for pivoting ? Clearly, the value of $\mu(x_1)$
  is too high, I have to decrease it by playing with the values of \nonbas: \pause
  \begin{itemize}
    \item $  3 x_2$ cannot decrease, as $\mu(x_2) = lb(x_2)$ and cannot be moved down \pause
    \item $- 4 x_3$ cannot decrease, as $\mu(x_3) = ub(x_3)$ and cannot be moved up \pause
    \item $  2 x_4$ can decrease, as  $\mu(x_4) = ub(x_4)$, and can be moved down \pause
    \item $-   x_5$ can decrease, as  $\mu(x_5) = lb(x_5)$, and can be moved up
  \end{itemize}
  \vfill\pause
  both $x_4$ and $x_5$ are therefore good candidates for pivoting. To avoid loops,
  choose variable with smallest subscript (Bland's Rule). This rule is not necessarily
  efficient, though

\end{frame}

\begin{frame}
  \frametitle{Detect Unsatisfiability}

  \scriptsize

  There might be cases in which {\bf no suitable variable for pivoting can be found}.
  This indicates unsatisfiability. \pause
  Consider the following where we have just asserted $x_1 \leq 9$
  \vfill
  \begin{columns}

  \begin{column}{.4\textwidth}
  \begin{center}
  Tableau
  \end{center}
  $$
  \begin{array}{rcl}
    & \ldots \\
    x_1 & = & 3 x_2 - 4 x_3 + 2 x_4 - x_5 \\
    & \ldots \\
    \\
    \\
  \end{array}
  $$
  \end{column}

  \begin{column}{.3\textwidth}
  \begin{center}
  $lb$~~~~~~~Bounds~~~~~~~$ub$
  \end{center}
  $$
  \begin{array}{rcccl}
     -4 & \leq & x_1 & \leq & 9 \\
      1 & \leq & x_2 & \leq & 3 \\
     -4 & \leq & x_3 & \leq & -1 \\
      2 & \leq & x_4 & \leq & 2 \\
     -1 & \leq & x_5 & \leq & -1 \\
  \end{array}
  $$
  \end{column}

  \begin{column}{.3\textwidth}
  \begin{center}
  $\mu$
  \end{center}
  $$
  \begin{array}{rcl}
  x_1 & \mapsto & \colone{12} \\
  x_2 & \mapsto & 1 \\
  x_3 & \mapsto & -1 \\
  x_4 & \mapsto & 2 \\
  x_5 & \mapsto & -1
  \end{array}
  $$
  \end{column}

  \end{columns}
  \vfill
  no variable among $\nonbas = \{ x_2, x_3, x_4 \}$ can be chosen for pivoting. This is because (due to tableau)
  $$x_2 \geq 3\ \swedge\ x_3 \leq -1\ \swedge\ x_4 \geq 4\ \swedge\ x_5 \leq -1\ \ \Rightarrow\ \ x_1 \geq 12\ \ \Rightarrow\ \ \neg (x_1 \leq 9)$$
  \vfill
  Therefore
  $$\{ x_2 \geq 3,\ x_3 \leq -1,\ x_4 \geq 4,\ x_5 \leq -1,\ \neg( x_1 \leq 9 ) \}$$
  is a \tconflict (modulo the tableau)

\end{frame}

\begin{frame}
  \frametitle{Solving}

  \scriptsize

  \begin{tabbing}
  asv \= a \= a \= a \= as \= asdfasdfasdfasdfasdfasdfasdfasdf \= \kill
  1  \> while( $true$ ) \\
     \> \\
  2  \> \> pick first $x_i \in \bas$ such that $\mu(x_i) < lb(x_i)$ or $\mu(x_i) > ub(x_i)$ \\
  3  \> \> if ( there is no such $x_i$ ) return $sat$ \\
     \> \\
  4  \> \> $x_j = ChoosePivot( x_i )$ \\
  5  \> \> if ( $x_j$ == $undef$ ) return $unsat$ \\
  6  \> \> $Pivot(x_i,x_j)$ \\
     \> \\
  7  \> \> if ( $\mu(x_i) < lb(x_i)$ ) \\
  8  \> \> \> $Update( x_i, lb(x_i) )$ \\
     \> \\
  9  \> \> if ( $\mu(x_i) > ub(x_i)$ ) \\
  10 \> \> \> $Update( x_i, ub(x_i) )$ \\
     \> \\
  11 \> end
  \end{tabbing}

  $x_j = ChoosePivot( x_i )$: returns variable to use for pivoting with $x_i$, or $undef$ if conflict\\
  pick first $x_i$ \ldots: it's again Bland's rule

\end{frame}


\section{Implementation: \toolname}
Here we give some more examples on how we can use \toolname.
We start by proving termination on mutual recursive functions,
using lexicographical ordering.
%
Then we describe how we proved functional correctness on
two commonly used functions, namely \texttt{ByteString}
and \texttt{Text}.

\subsection{Proving Termination}

   Next, consider the Ackermann function.
   %
   \begin{code}
     ack m n
       | m == 0    = n + 1
       | n == 0    = ack (m-1) 1
       | otherwise = ack (m-1) (ack m (n-1))
   \end{code}
   %
   There exists no integer termination metric that decreases at each recursive call.
   %
   However @ack@ terminates because at each call \emph{either}
   @m@ decreases \emph{or} @m@ remains the same and @n@ decreases.
   %
   In other words, the pair @(m,n)@ strictly decreases according to
   \emph{lexicographic} ordering.
   %
   To capture this requirement we extend termination metric
   from an integer to a list of integers
   and at each recursive call we check that this list is
   lexicographically decreasing.
   %
   In the case of
   @ack@ this list will simply be the parameters @m@
   and @n@:
   %
   \begin{code}
     ack :: m:Nat -> n:Nat -> Nat / [m,n]
   \end{code}
   %
   Thus, \toolname uses lexicographic ordering on
   a list of natural numbers to prove termination.
   %
   Termination metrics could be generalized to
   any \emph{well-found} metric.

   \spara{Mutual Recursion}
   %
   Equipped with termination metrics
   \toolname instantiates a powerful
   termination checker that like~\citep{XiTerminationLICS01}
   proves termination even for mutual recursive functions.
   %
   Consider the mutual recursive functions @isEven@ and @isOdd@
   \begin{code}
   {-@ isEven :: n:Nat -> Bool / [n, 0] @-}
   {-@ isOdd  :: n:Nat -> Bool / [n, 1] @-}

   isEven 0 = True
   isEven n = isOdd $ n-1

   isOdd n  = not $ isEven n
   \end{code}
   Each call terminates as either @isEven@
   calls @isOdd@ with a decreasing argument,
   or the argument remains the same, and @isOdd@
   calls @isEven@ that should then decrease the argument.
   %
   We capture this reasoning using two lexicographic pairs:
   each function has its own metric,
   and when @isEven@ calls @isOdd@
   the metric of the caller $(n, 0)$
   should be greater that callee's metric
   $(n-1, 1)$.
   %
   Similarly, at @isEven@'s call-site
   \toolname verifies that
   $(n, 1) > (n, 0)$.
   %
   For example, the call @isEven m@
   will fire the decreasing metric sequence
   $(m, 0) > (m-1, 1) > (m-1, 0) > (m-2, 1) > \dots$
   that ultimate terminates for \textit{any}
   natural number $m$.

\subsection{Bytestring}\label{sec:bytestring}
\input{bytestring}

\subsection{Text}\label{sec:text}
\input{text}


%
% 386
%
\chapter{The Equations of Mathematical Physics}

\Section{18}{1}{The differential equations of mathematical physics.}

The functions which have been introduced in the preceding chapters are
of importance in the applications of mathematics to physical
investigations. Such applications are outside the province of this
book; but most of them depend essentially on the fact that, by means
of these functions, it is possible to construct solutions of certain
partial differential equations, of which the following are among the
most important :

(I) Laplace s equation

dx- dy' dz which was originally introduced in a memoir* on Saturn's
rings.

If x, y, z) be the rectangular coordinates of any point in space, this
equation is satisfied by the following functions which occur in
various branches of mathematical physics :

(i) The gravitational potential in regions not occupied by
attractii:ig matter.

(ii) The electrostatic potential in a uniform dielectric, in the
theory of electro- statics.

(iii) The magnetic potential in free aether, in the theory of
magnetostatics.

(iv) The electric potential, in the theory of the steady flow of
electric currents in solid conductoi's.

(v) The temperature, in the theory of thermal equilibrium in solids.

(vi) The velocity potential at points of a homogeneous liquid moving
irrotationally, in hydrodynamical problems,

Notwithstanding the physical diflferences of these theories, the
mathematical investi- gations are much the same for all of them :
thus, the problem of thermal equilibrium in a solid when the points of
its surface are maintained at given temperatures is mathe- matically
iden.tical with the problem of determining the electric intensity in a
region when the points of its boundary are maintained at given
potentials.

(II) The equation of ivave motions

dx dy' dz C' dt- This equation is of general occurrence in
investigations of undidatory disturbances propagated with velocity c
independent of the wave length; for example, in the theory of
electric waves and the electro-magnetic theory of light, it is the
equation satisfied by each component of the electric or magnetic
vector; in the theory of elastic vibrations, it is the equati<Mi
satisfied by each component of the displacement; and in the theory of
sound, it is the equation satisfied by the velocity potential in a
perfect gas.

* Mem. de FAcad. des Sciences, 1787 (published 1789), p. 252.

%
% 387
%

(III) The equation of conduction of heat

dfV dfV dfV\ ldV dec- dy dz- k dt

This is the equation satisfied by the temperature at a point of a
homogeneous isotropic body; the constant k is proportional to the
heat conductivity of the body and inversely proportional to its
specific heat and density.

(IV) A particular case of the preceding equation (II), when the
variable z is absent, is

dx- dy- c- dt'

This is the equation satisfied by the displacement in the theory of
transverse vibrations of a membrane; the equation also occurs in the
theory of wave motion in two dimensions.

(V) The equation of telegraphy

This is the equation satisfied by the potential in a telegraph cable
when the inductance X, the capacity K, and the resistance It per unit
length are taken into account.

It would not be possible, within the limits of this chapter, to
attempt an exhaustive account of the theories of these and the other
differential equations of mathematical physics; but, by considering
selected 'typical cases, we shall expound some of the principal
methods employed, with special reference to the uses of the
transcendental functions.

\Section{18}{2}{Boundary conditions.}

A problem which arises very frequently is the determination, for one
of the equations of \hardsectionref{18}{1}, of a solution which is subject to certain
boundary con- ditions; thus we may desire to find the temperature at
any point inside a homogeneous isotropic conducting solid in thermal
equilibrium when the points of its outer surface are maintained at
given temperatures. This amounts to finding a solution of Laplace's
equation at points inside a given surface, when the value of the
solution at points on the surface is given.

A more complicated problem of a similar nature occurs in discussing
small oscillations of a liquid in a basin, the liquid being exposed to
the atmosphere; in this problem we are given, effectively, the
velocity potential at points of the free surface and the normal
derivate of the velocity potential where the liquid is in contact with
the basin.

The nature of the boundary conditions, necessary to determine a
solution uniquely, varies very much with the form of differential
equation considered, even in the case of equations which, at first
sight, seem very much alike. Thus a solution of the equation

dx- dy'

25-2

%
% 388
%

(which occurs in the problem of thermal equilibrium in a conducting
cylinder) is uniquely determined at points inside a closed curve in
the x7/-ip\ a,ne by a knowledge of the value of V at points on the
curve; but in the case of the equation

da; c- dt-

(which effectively only differs from the former in a change of sign),
occurring

in connexion with transverse vibrations of a stretched string, where V

denotes the displacement at time t at distance x from the end of the

string, it is physically evident that a solution is determined
uniquely only if

dV both V and - are given for all values of x such that x l, when =

(where I denotes the length of the string).

Physical intuitions will usually indicate the nature of the boundary
conditions which are necessary to determine a solution of a
differential equation uniquely; but the existence theorems which are
necessary from the point of view of the pure mathematician are usually
very tedious and difficult*.

\Section{18}{3}{A general solution of Laplace's equation.}

It is possible to construct a general solution of Laplace's equation
in the form of a definite integral. This solution can be employed to
solve various problems involving boundary conditions.

Let V x, y, z) be a solution of Laplace's equation which can be
expanded into a power series in three variables valid for points of x,
y, z) sufficiently near a given point Xf, yo, z ). Accordingly we
write

x = Xq + X, y=zy + Y, z = Zo+ Z;

and we assume the expansion

V = c(o + a X + biY + CiZ + a.. X- + b. Y- + c Z

+ 2cLYZ+2e,ZX + 2f,XY+...,

it being supposed that this series is absolutely convergent whenever

\ X'f+\ Yr + \ Z' a,

where a is some positive constant :]:. If this expansion exists, V is
said to be analytic at (xo, yo, S'o). It can be proved by the methods
of §§ 3*7, 4'7

* See e.g. Forsyth, Theory of Functions (1918), §§ 216-220, where an
apparently simple problem is discussed.

t Whittaker, Math. Ann. lvii. (1902), p. 333.

* The functions of applied mathematics satisfy this condition.

%
% 389
%

that the series converges uniformly throughout the domain indicated
and may be differentiated term-by-term with regard to X, Y or Z any
number of times at points inside the domain.

If we substitute the expansion in Laplace's equation, which may be
written

d'V a F d V dX-' dY-' dZ-' '

and equate to zero (§ 373) the coefficients of the various powers of
X, Y and Z, we get an infinite set of linear relations between the
coefficients, of which

a.2 4- 62 -I- c. = may be taken as typical.

There are n(n - l) of these relations* between the n + 2) n + l)
coefficients of the terms of degree n in the expansion of V, so that
there are only (n+2)(n + 1) - n (n - 1) = 2n -f 1 independent
coefficients in the terms of degree n in V. Hence the terms of degree
n in V must be a linear combination of 2n+l linearly independent
particular solutions of Laplace's equation, these solutions being each
of degree n in X, Y and Z.

To find a set of such solutions, consider (Z + iX cos u 4- iFsin m)";
it is a solution of Laplace's equation which may be expanded in a
series of sines and cosines of multiples of u, thus :

n n

2 gm X, Y, Z) COS mu+ 2 h,, (X, Y, Z) sin. mu,

m = 111 = 1

the functions g iX, Y, Z) and h X, Y, Z) being independent of u. The
highest power of Z in gm X, Y, Z) and A,, (X, F, Z) is Z"'" and the
former function is an even function of Y, the latter an odd function;
hence the functions are linearly independent. They therefore form a
set of 2?i -f- 1 functions of the type sought.

Now by Fourier's rulef \hardsectionref{9}{1}'2)

Trgm X, Y, Z)= j Z + iX cos u + i Fsin u)" cos mudu,

irhyn X, Y, Z)= \ Z + iX cos u -H iFsin uY sin mudu,

J -77

* If a,s,j (where r + s + t = n) be the coefficient of A''T Z' in V,
and if the terms of degree . d-V d V dW, . .,

" ~ WV "*" Wr- "*" dZ arranged primarily in powers of X and
secondarily in powers of F,

the coefficient fl .s.t <loes not occur in any term after Z'- -r Z<
(or ZT*- if r = or 1), and hence the relations are all linearly
independent.

t 27r must be written for tt in the coefficient of g X, Y, Z).

%
% 390
%

and so any linear combination of the 2/; + 1 solutions can be written
in the form

/:

 Z + iX COS i( + iY sin i()' fn u) du,

where / (w) is a rational function of e*".

Now it is readily verified that, if the terms of degree n in the
expression assumed for V be written in this form, the series of terms
under the integral sign converges uniformly if \ X\ \ + \ Y Jr\ Z be
sufficiently small, and so \hardsectionref{4}{7}) w e may write

V =\ Z+iX cos u + iY sin ?()"/ (w) du.

 -TT n-i)

But any expression of this form may be written

F = / F Z - iX cos u + i Y sin u, u) du,

J -n

where i is a function such that differentiations with regard to X, Y
or Z under the sign of integration are permissible. And, conversely,
if F be any function of this type, V is a solution of Laplace's
equation.

This result may be written

J -TT

on absorbing the terms - 2,1 - * o cos m - I'yo sin m into the second
variable; and, if differentiations under the sign of integi-ation are
permissible, this gives a general solution of Laplace's equation;
that is to say, every solution of Laplace's equation which is analytic
throughout the interior of some sphere is expressible by an integral
of the form given.

This result is the three-dimensional analogue of the theorem that

V=f x- iy)+g x-ii/) is the general solution of

ox oy-

[NoTE. A distinction has to be drawn between the primitive of an
ordinary diflFerential equation and general integrals of a i)artial
differential equation of order higher than the first*.

Two apparently distinct primitives are always directly transformable
into one another

by means of suitable relations between the constants; thus in the case
of;T"f +y = 0, we

can obtain the primitive Csin x + t) from A cos .r + 5 sin .r by
defining C and e by the equations Csin e = A, C'cos f = B. On the
other hand, every solution of Laplace's equation is expressible in
each of the forms

/:

f x cos < +// sin + iz, t) dt, I g (y cos ?< + sin u + ix, ) du;

r ' ' - TT

* For a discussion of general integrals of such equations, see
Forsyth, Theory of Differential Equations, vi. (1906), Ch. xii.

%
% 391
%

but if these are known to be the same solution, there appears to be no
general analytical relation, connecting the functions / and g, which
will directly transform one form of the solution into the other.]

Example 1. Shew that the potential of a particle of unit mass at (a,
b, c) is 1 [ " du

2tt J -TT z - c) + i x - a) cos u + i y - b) sin u at all points for
which z> c.

Example 2. Shew that a general solution of Laplace's equation of zero
degree in X, y, z is

/ log (.rcos <+j/sin il + jj) (<)(:/i, if I g t)dt = Q.

Express the solutions - -; and log-; - \ in this form, where r- = x'
+y' - z .

Example 3. Shew that, in the case of the equation

p + g; = x+y

( where jo =, q = ), integrals of Charpit's subsidiary equations (see
Forsyth, Differential

Equations, Chap, ix.) are

(i) p --x=y-q - = a,

(ii) p = q + a?.

Deduce that the corresponding general integrals are derived from

(i) z =, :c + af+l y-af+F a)\ Q = x + af- y-af + F' a) j'

(ii) Az = \ (. +y)3 + 2a2 x-y)-a x -y)- + G a)\ = Aa x-y)-Aa x->ry)-'
+ G' [a) j'

and thence obtain a diflferential equation determining the function O
(a) in terms of the function E a) when the two general integrals are
the same.

\Subsection{18}{3}{1}{Solutions of Laplace s equation involving Leg endive functions.}
If an expansion for V, of the form assumed in \hardsectionref{18}{3}, exists when

Xq = y Zq ), we have seen that we can express F as a series of
expressions of the type

I (z + ix cos u + iy sin u)"' cos mudu, (z + ix cos u + iy sin uy sin
inudu,

J -TT J -TT

where n and m are integers such that m n.

We shall now examine these expressions more closely. If we take polar
coordinates, defined by the equations

x= r sin 6 cos (f), y = r sin 6 sin (/>, z = r cos 6,

%
% 392
%

we have

I z + ix cos u + iy sin w)" cos mu du

J - ]T

= ?" I cos + i sin 6 cos ( - )j" cos mudu

rn-<t> = ?'" (cos + i sin cos yjr]" cos 7?l (</) + ylr) rf-v/r

Z - TT - I

= ?'" cos + I sin cos -v " cos m (p + fr) dy\ r

J -It

= ?" COS m(f> cos d + i sin cos i " cos m'yjrd'yjr,

J -TT

since the integrand is a periodic function of - and

(cos + z sin 6 cos i/r)" sin ii/r

is an odd function of yjr. Therefore \hardsubsectionref{15}{6}{1}), with Ferrers'
definition of the associated Legendre function,

rir 27ri"' . n !

1 (z + ix cos u + iy sin )" cos ??m c?ii = 7 -;' r Pn' (cos ) cos md).

j - c / (-. j + m) !

Similarly

/:

( + iv cos i/ + 1?/ sin k)" sin ?/it<c?w = 7 -! r Fn ' (cos ) sin md>.

'(71 + m) I

Thei efore 7'' P,i" (cos 6) cos 7?i aiic? r ''Pn' (cos ) sin 7/i</>
are polynomials in X, y, z and are particular solutions of Laplace's
equation. Further, by \hardsectionref{18}{3}, every solution of Laplace's equation,
which is analytic near the origin, can be expr essed in the form

F = i r' \ AnFn (cos (9) + I (yl " ' cos m< + Bn ''' sin m ) P " (cos
6)1 .

Any expression of the form

AnPn (cos ) + i ( n<"" cos ? </) + 5 <' sin m(f>) P,r (cos ),

m = \

where w is a positive integer, is called a surface harmonic of degree
7i; a surface harmonic of degi-ee n multiplied by ?'" is called a
solid harmonic (or a spherical Jiarmonic) of degree n.

The curves on a unit sphere (with centre at the origin) on which P
(cos 6) vanishes are n parallels of latitude which divide the surface
of the sphere into zones, and so P (cos d)

is called (see S 15*1) a zonal harmonic; and the curves on which .
mtb . Pn" (cos 6) vanishes

are n-7n parallels of latitude and 2m meridians, which divide the
surface of the sphere into quadrangles wh(> e angles are right angles,
and so these functions are called tesseral harmonics.

%
% 393
%

A solid harmonic of degree n is .evidently a homogeneous polynomial of
degree n in X, y, z and it satisfies Laplace's equation.

It is evident that, if a change of rectangular coordinates* is made
l;)y rotating the axes about the origin, a solid harmonic (or a
surface harmonic) of degree n transforms into a solid harmonic (or a
suz'face harmonic) of degree n in the new coordinates.

Spherical harmonics were investigated with the aid of Cartesian
coordinates by W. Thomson in 1862, see Phil. Trans. (1863), pp.
573-582, and Thomson and Tait, Treatise on Natural Philosophy i.
(1879), jip. 171-218; they were also investigated independently in
the same manner at about the same time by Clebsch, Journal fur Math.
LXi. (1863), pp. 195-262.

Example. If coordinates r,, are defined by the equations

1 1

a; = rcos, ?/ = (/'- 1)- sin cos 0, 3 = (/'2- 1)- sin sin(,

shew that P,/" (r) P '" (cos 6) cos wi0 satisfies Laplace's equation.

\Section{18}{4}{The solution of Laplace's equation which satisfies
  assigned boundary conditions at the surface of a sphere.}

We have seen \hardsubsectionref{18}{3}{1}) that any solution of Laplace's equation which
is analytic near the origin can be expanded in the form

w = (

+ i ( <" ' cos m(f) + 5 " ' sin m(f>) P,,"* (cos 6) \

m = l J

and, from \hardsectionref{3}{7}, it is evident that if it converges for a given value
of r, say a, for all values of 6 and (f) such that O tt, - tt tt, it
converges absolutely and uniformly when r < a.

To determine the constants, we must know the boundary conditions which
V must satisfy. A boundary condition of frequent occurrence is that F
is a given bounded integrable function of 6 and (f), say f(0, (f>), on
the surface of a given sphere, which we take to have radius a, and V
is analytic at points inside this sphere.

We then have to determine the coefficients An, -4 <'"', 5,i""* from
the equation

f d,( )= S a'M Pn (cos )+ 2 ( ' ' cos ?n</) + £ " ' sin m</))P,;' (cos
6')

rt = i m = l J

Assuming that this series converges uniformly f throughout the domain

multiplying by

P ' (cos ) °%i<i, sm

* Laplace's operator -, +;r-, +; -5 is invariant for changes of
rectangular axes. ox dij- oz-

t This is usually the case in physical problems.

%
% 394
%

integrating term-by-term \hardsectionref{4}{7}) and using the results of §§ 15'14,
1551 on the integral properties of Legendre functions, we find that

fid', 4>') P,r (cos 6') cos m<f>' sin e'dd'dcf ' = 7ra - . ) " ',

Cn fir 9 (yx -1- 171, " t

A 6*', 6') P ' (cos d') sin wt<i)' sin O'dO'd ' = -jra" =- . ) (; 5
<' ',

f f V( '' <l>') Pn (cos ') sin e'dB'dcf)' = lira" 5-?-. . Therefore,
when r < a, F(r, e,4>)=l ? f-)" f f7( ', f )]p,(cos )P (cos ')

+ 2 i (!i:i; p m (cos 6) Pn' (cos ') COS m (6 - d)') sin O'dO'd )'.

The series which is here integrated term-by-term converges uniformly
when r <a, since the expression under the integral sign is a bounded
function of 6, 0', (f), (f>', and so \hardsectionref{4}{7} )

47rF(r, 6*, 0) = T 1 /(0', cf>') I (2n -h 1) f-VlPn (cos ) P (cos )

+ 2 i y' - Pn'"" (cos d)Pn''' (cos d') cos 7n(4>-(f>')\ sin
e'de'd(f>'. m=i(n + m)l J

Now suppose that we take the line (6, (f>) as a new polar axis and let
( 1'. 1') be the new coordinates of the line whose old coordinates
were (6', < '); we consequently have to replace Pn (cos 6) by 1 and
P, ! (cos 6) by zero; and so we get

47rF(r, e, (f>)=r t f(0', </)') t (2n + l)(-Y
Pn(cos0,')sme,'de,'d<f>,'

J -TT J W=0 \ \ V

= r rf(0''<f>') i (2n+l)(-Y Pn(cose,')sme'dO'd(f>'.

If, in this formula, we make use of the result of example 23 of
Chapter xv (p. 332), we get

 ' 'J-nJo \ r'-2arcos6,'+a-) and so

47r F(r, e, </))

, r f" f(0', <i>') sin e'dd'dd)'

= a(a- - r')\ I - - -n-

J -nJ [r- - 2ar cos 6 cos ' -f sin 6 sin ' cos (( - </>) + a"]

In this compact formula the Legendre functions have ceased to appear
explicitly.

%
% 395
%

The last formula can be obtained by the theory of Green's functions.
For properties of such functions the reader is refei'red to Thomson
and Tait, Natural Philosophy., §§ 499-519.

[Note. From the integrals for V (r, 6, cf)) involving Legendre
functions of cos j' and of cos, cos ' respectively, we can obtain a
new proof of the addition theorem for the Legendre polynomial.

For let

Xn \&', (t>') =Pn (COS d ) - |P (cos 6) P (cOS 6')

+ 2 2 - -f; P - (COS 6) P,;" (cos 6') cos ra (0 - < '), and we get,
on comparing the two formulae for V r, 6, (f)),

0= r f'/iff, < ') 2 (2 +i) (-Xxn (d\ 4>') siD e'd\&d,'.

J -TT J n=0 \ /

If we take/( ', 0') to be a surface harmonic of degree n, the term
involving r" is the only one which occurs in the integrated series;
and in particular, if we take/( ', 4>') = Xn i 'i 0')> we get

' Xni6',fp') 'id'de'd(t)' = 0.

-n J

Since the integrand is continuous and is not negative it must be zero
; and so Xn ff, (f)') = 0; that is to say we have proved the formula

Pn (cos i') = Pn (cos 6) Pn (COS 6') + 2 2 ) '- . Pn'" (COS 6) Pn""
(COS 6') COS 711 (j>- (f)'),

m-1 n + M) ! wherein it is obvious that

cos ]' = cos 6 cos 6' + sin 6 sin 0' cos (0 - < '), from geometrical
considerations.

We have thus obtained a physical proof of a theorem proved elsewhere*
(§ I5"7) by purely analytical reasoning.]

Example 1. Find the solution of Laplace's equation analytic inside the
sphere /=1 which has the value sin 36 cos < at the surface of the
sphere.

[ s r Pgi (cos 6) cos (f) - irPji (cos 0) cos 0.]

Example 2. Let fii r, 6, (f)) be equal to a homogeneous polynomial of
degree n in, y, z. Shew that

l" I fnla, G, (f)) Pn cos 6 con d' + siudamd' cos (f) -4>') a' sin 6
d0dcf> J - J o'

-; /.( . '< )-

[Take the direction (6', < ') as a new polar axis.]

\Section{18}{5}{Solutions of Laplace's equation which involve Bessel
  coefficients.}
A particular case of the result of \hardsectionref{18}{3} is that

Qk(z+ixcosu+iysmu, gQg f)iuclu

is a solution of Laplace's equation, k being any constant and m being
any

integer.

* The absence of the factor ( - )'" which occurs in \hardsectionref{1}{5}-7 is due to
the fact that the functions now employed are Ferrers' associated
functions.

%
% 396
%

Taking cylindrical-polar coordinates p, (f), z) defined by the
equations . = p cos, y = p sin 4>, the above solution becomes

 kz I gikpcos iu-4>) cos ( dii = gkz i gikpcos V g g . (v + (f)) . clv

J -IT J - JT

= 2e* I 6**'" ° " cos ?HV cos m<pdv

Jo

= 2e* cos (mcj)) j e'*'" ° " cos mvdv,

Jo and so, using \hardsectionref{17}{1} example 3, we see that 'Itti ' e'' cos (m(f))
. Jm(f 'p) is a solution of Laplace's equation analytic near the
origin.

Similarly, from the expression

T

where m is an integer, ive deduce that 27rz'" e* sin (??i</)) . (kp)
is a solution of Laplace's equation.

18 "SI. The periods of vibration of a uniform membrane*.

The equation satisfied by the displacement V at time t of a point x,
y) of a uniform plane membrane vibrating harmonically is

'dx cy- c- Ct- '

where c is a constant depending on the tension and density of the
membrane. The equation can be reduced to Laplace's equation by the
change of variable given by z = cti. It follows, from \hardsectionref{18}{5}, that
expressions of the form

'sm sin satisfy the equation of motion of the membrane.

Take as a particular case a drum, that is to say a membrane with a
fixed circular boundary of radius R.

Then one possible type of vibration is given by the equation

r=t kp) cos m<\ i cos ckt, provided that F=0 when p = R; so that we
have to choose k to satisfy the equation

J, kR)=0. This equation to determine / has an infinite number of real
roots \hardsectionref{17}{3} example 3), 1, 2j 3j  S3,y. A possible type of
vibration is then given by

r=/, (f-'rp) cosmcf) cos ckrt r= 1, 2, 3,,..).

This is a periodic motion with period 1iTJ ckj.); and so the
calculation of the periods depends essentially on calculating the
zeros of Bessel coefficients (see 17'9).

 Euler, Novi Covim. Acad. Petrop. x. (1764) [published 1766], pp.
243-260; Poisson, Mem. de I'Academie, viii. (1829), pp. 357-570;
Bourget, Ann. de I'Ecole nvrm.sup. iii. (1866), pp. 55-95. For a
detailed discussion of vibrations of membranes, see also Rayleigh,
Theory of Sound, Chapter ix.

%
% 397
%

Example. The equation of motion of air in a circular cylinder
vibrating per- pendicularly to the axis OZ of the cylinder is

dx dy' c' dt- ' V denoting the velocity potential. If the cylinder
have radius R, the boundary condition

dV is that n- =0 when p = R. Shew that the determination of the free
periods depends on

finding the zeros of J,,/ (C) == 0-

\Section{18}{6}{A general solution of the equation of wave motions.}
It may be
shewn* by the methods of \hardsectionref{18}{3} that a general solution of the equation
of wave motions

dx dy'' dz- c- di?

IS

F = I I f(x sin u cos v + y sin u sin v + z cos n + ct, u, v) dudv,

where /is a function (of three variables) of the type considered in §
18"3.

Regarding an integral as a limit of a sum, we see that a physical
interpretation of this equation is that the velocity potential V is
produced by a number of plane waves, the disturbance represented by
the element

f(x sin u cos v + y sin u sin v + z cos u + ct, u, v) 8u Bv being
propagated in the direction (sin u cos v, sin u sin v, cos u) with
velocity c. The solution therefore represents an aggregate of plane
waves travelling in all directions with velocity c.

\Subsection{18}{6}{1}{Solutions of the equation of wave motions which involve Bessel functions.}

We shall now obtain a class of particular solutions of the equation of
wave motions, useful for the solution of certain special problems.

In physical investigations, it is desirable to have the time occurring
by means of a factor sin ckt or cos ckt, where k is constant. This
suggests that we should consider solutions of the type

/tt rn

y =, \ I giA;(a;sinttcost;+2/sinMsiuv+2cosM+cti f (u i)\ dudv

J -TT J

Physically this means that we consider motions in which all the
elementary waves have the same period.

Now let the polar coordinates of (x, y, z) be (r, 6, (f>) and let (o),
yjr) be the polar coordinates of the direction (u, v) referred to new
axes such that the polar axis is the direction (ff, (f)), and the
plane -v/r = passes through OZ; so that

cos CO = cos 6 cos u + sin d sin u cos ((f) - v),

sin II sin ((f) - v) = sin w sin yjr.

* See the paper previously cited, Math. Ann. lvii. (1902), pp.
342-345, or Messenger of Mathe- matics, XXXVI. (1907), pp. 98-106.

%
% 398
%

Also, take the arbitrary function /(w, y) to be;S,j (w, y) sin i
where Sn denotes a surface harmonic in u, v of degree ?i; so that we
may write

Sn(u, V) = Sn 0, 4>] CO, yjr),

where \hardsubsectionref{18}{3}{1}) Sn is a surface harmonic in co, -sjr of degree n. We
thus get

V = e ' ' f r I ' e''""°"" Sn 6, < \ w, y\ r) sin a> dw df.

Now we may write (§ 18 "SI)

Sn (d, (i>; 0,y r) = An e,(f>). Pn (COS Oj)

+ S "'" (0, <f>) cos myfr + Bn'"' 0, (f)) sin myfr] P "' (cos co),

m = l

where An 6, </>), n'"'* 6, <p) and 5 ""' 6, 0) are independent of yjr
and co. Performing the integration with respect to -yjr, we get

F= 27re'' ' An 0, 4>) f"e '*"° "P (cos to) sin codco

Jo

= 27re' '- A n 0,(ii)j e''"-' P,, (/i) djM

= 27r. - '* An (, ( ) J' e'* ' - (f. - l)n d,

by Rodrigues' formula (§ loll); on integrating by parts ti times and
using Hankel's integral (§ 17 '3 corollary), we obtain the equation

 = o;r '"" n 0, 4>) ikrY I e'>"- (1 - /x )" c yu

Zi  'It \ J 1

= (27r) iV'* ' kr) - -J + (kr) An (6, c >), and so F is a constant
multiple of e' ' h-' Jj \ \ i(kr) An(0, (f>).

Now the equation of wave motions is unaffected if we multiply x, y, z
and t by the same constant factor, i.e. if we multiply r and t by the
same constant factor leaving Q and unaltered; so that An B, <f)) may
be taken to be independent of the arbitrary constant k which
multiplies r and t.

Hence lim e**-''' r ~ H' ~ " ~ /, i (kr) An 0, 9) is a solution of
the equation

A:-*0

of wave motions; and therefore r' An(0, <f>) is a solution
(independent of t) of the equation of wave motions, and is
consequently a solution of Laplace's equation; it is, accordingly,
permissible to take An (0, <f>) to be any surface harmonic of degree n
; and so we obtain the result that

r - Jn+r ih-) Pn''' (cos 0) md> ckt 2 sm sm

is a particular solution of the equation of wave motions.

%
% 399
%

\Subsubsection{18}{6}{1}{1}{Application of \hardsubsectionref{18}{6}{1}
  to a physical problem.}

The solution just obtained for the equation of wave motions may be
used in the following manner to determine the periods of free
vibration of air contained in a rigid sphere.

The velocity potential T' satisfies the equation of wave motions and
the boundary

dV condition is that - =- =0 when ? =, where a is the radius of the
sphere. Hence

or

~\ -,,i.r,, /iv COS, COS,

Y-r *J,.(/-/),™ cos<9) . wd) . ckt "+- " sm sin

gives a possible motion if Z* is so chosen that

This equation determines k; on using \hardsubsectionref{17}{2}{4}, we see that it may be
written in the form

tan ka = ka)

where f (ka) is a rational function of ka.

In particular the radial vibrations, in which V is independent of 6
and <, are given by taking n = 0; then the equation to determine k
becomes simply

tan ka = ka; and the pitches of the fundamental radial vibrations
correspond to the roots of this equation.

REFERENCES.

J. Fourier, La theorie analytique de la Chaleur. (Translated by A.
Freeman.)

W. Thomson and P. G. Tait, Natural Philosophy. (1879.)

Lord Rayleigh, Theory of Sound. (London, 1894-1896.)

F. PoCKELS, Uber die partielle Diferentialgleichung /\ u + khi. = 0.
(Leipzig, 1891.)

H. BuRKHARDT, Eiitivickelungen nach oscillirenden Funktionen.
(Leipzig, 1908.)

H. Bateman, Electrical and Optical Wave-motion. (1915.)

E. T. Whittaker, History of the Theories of Aether and Electricity.
(Dublin, 1910.)

A. E. H. Love, Proc. London Math. Soc. xxx. (1899), pp. 308-321.

H. Bateman, Proc. London Math. Soc. (2), i. (1904), pp. 451-458.

L. N. G. FiLON, Philosophical Magazine (6), vi. (1903), pp. 193-213.

H. Bateman, Proc. London Math. Soc. (2), vii. (1909), pp. 70-89.

Miscellaneous Examples.

1. If V be a solution of Laplace's equation which is symmetrical with
respect to OZ, and if y=f z) on OZ, shew that if f \ be a function
which is analytic in a domain of values (which contains the origin) of
the complex variable f, then

'=i r - + i(.r2+j/2)5cos0 rf( /

at any point of a certain three-dimensional region.

Deduce that the potential of a uniform circular ring of radius c and
of mass M lying in the plane XO T with its centre at the origin is

  r [ + + ( ' + '/) cos (/) 2] - I d<t>.

7!" y

%
% 400
%

2. If r be a solution of Laplace's equation, which is of the form
e""*jP(p, 2), where

(p, (f>, z) are cylindrical coordinates, and if this solution is
approximately equal to

p"'e""*/(i) near the axis of z, where /(f) is of the character
described in example 1, shew that

 = r ( i+ 1 ) r (*) / ' " '''' ' '""" ' - \addexamplecitation{DougaU.}

3. If ? be determined as a function of .r, y and z by means of the
equation

A.v+By + Cz=\, where A, B, C are functions of ?< such that

shew that (subject to certain general conditions) any function of is a
solution of

Laplace's equation.

(Forsyth, Messenger, xxvii. (1898), pp. 99-118.)

4. A, B are two points outside a sphere whose centre is C. A layer of
attracting matter on the surface of the sphere is such that its
surface density (Tp at P is given by the formula

apCc AP.BP)-\

Shew that the total quantity of matter is unaffected by varying A and
B so long as

CA . CB and ACB are unaltered; and prove that this result is
equivalent to the theorem

that the surface integral of two harmonics of different degrees taken
over the sphere

IS zero.

(Sylvester, Phil. Mag. (5), il. (1876), pp. 291-307.)

5. Let V (.r, y, z) be the potential function defined analytically as
due to particles of masses X + iy., X - z/x at the points (a + ia', b
+ ib', c + ic') and (a - ia', b - ib', c - ic') respectively. Shew
that V x, y, z) is infinite at all points of a certain real circle,
and if the point (.r, y, z) describes a circuit intertwined once with
this circle the initial and final values of V x,y, z) are numerically
equal, but opposite in sign.

(Appell, Math. Ann. xxx. (1887), pp. 155-156.)

6. Find the solution of Laplace's equation analytic in the region for
which a<r<iA, it being given that on the spheres /=a and r = A the
solution reduces to

2 c P (cos(9), 2 C;P (cos<9), respectively.

7. Let 0' have coordinates (0, 0, c), and let

Pdz=6, P0'Z=6', PO = r, PO' = r'. Shew that

P cos6') \ P cosd ) . .s cPn i(cos ) jn + 1) Qi + 2) c'' P + cos d) (
Y" f I (n I 1) - 1 ( " ) 1 n + l) n + 2) r 'P, oo,d) 1

"~ / Un + l V" / pn + 2 ' 2! C"" T...|,

according as r>c or r<c.

Obtain a similar expansion for /"P ' (cos ). \addexamplecitation{Trinity, 1893.}

8. At a point (r, 6, (p) outside a uniform oblate spheroid whose
semi-axes are a, b and whose density is p, shew that the potential is

)a-b

;\ \ \ m Pj (cos 0) m P (cos 6)

-...].

3/- 3.5 r b.l r°

where ni - a--b- and ?>? .. Obtain the i otential at points for which
r<m.

\addexamplecitation{St John's, 1899.}

%
% 401
%

9. Shew that

eirco,e=( )i I in [271 + 1) r-lP cos 6) J +i(r).

n =

\addexamplecitation{Bauer, Journal fiir Math, lvi.}

10*. Shew that if x ±iy = h cosh (| + irj), the equation of
two-dimensional wave motions in the coordinates and ? is

a|7 + 5 = ( h- 1 - cos2 rj) - . \addexamplecitation{Lame.}

IL Let X - c + r cos 6) cos (p, y = c + r cos 6) sin cp, 2 = /-sin;

shew that the surfaces for which /, d, (f) respectively are constant
form an orthogonal .system; and shew that Laplace's equation in the
coordinates /, \&, is

- - r(c + '/-cos ) +-; (c + ?-cos(9)-; [+- 7., =0.

vr \ a- j r 06 \ j- ' cd \ c + rcosdd(f>-

(W. D. Xiven, J/essenger, x.)

12. Let P have Cartesian coordinates x, ? z) and polar coordinates
(;, 6, (f)). Let the plane POZ meet the circle x' + t/' = k-, s = in
the points a, y; and let

aPy = (o, log (Pa/Py) = a. Shew that Laplace's equation in the
coordinates o-, a>, (p is

8 f sinho- bV] d j sinho- \ 871 1 -0-

da- [cosh o- - cos a da j ca (cosh a - cos o) 8w j sinh o- (cosh cr -
cos w) 8( 2 ' and shew that a solution is

V= (cosh o" - cos 0)) cos /iQ) cos ??i0 P (cosh o-).

(Hicks, Phil. Trans. CLXXii. p. 617 et seq.)

13. Shew that

00 -hn i r-j- r

 R + p -2Rpcoscl) + c-)-h= 2 I dk I e-"" J, I- p)e' ' ''°"' cos
rauclu,

m=0 y J -T

and deduce an expression for the potential of a particle in terms of
Bessel functions.

14. Shew that if a, b, c are constants and X, /x, v are confocal
coordinates, defined as the roots of the equation in e

a2 + e' 6- + e' 6-2 + 6 ' then Laplace's equation may be written

Ax(M-) xf + M(-X)| A/J +A.(X-M) A. ]=0,

where A;, = V (aHX) (i' + X) (c- + X) .

\addexamplecitation{Lame.}

* Examples 10, 11, 12 and 14 are most easily proved by using Lame's
result (Journal de VEcole Polyt. xiv. cahier 23 (1834), pp. 191-288)
that if (X, /ul, v) be orthogonal coordinates for which the
line-element is given by the formula dx)'' + (8yf + 5zy =(H d\ y +
(H2diM)'- + H 5v)', Laplace's equation in these coordinates is

d fH.H cV\ 8 / H. H, dV\ 8 / H,H., dV\ \

'Hi-

d\ V Hi a,\ J dfjL\ H., d/jiJ di'\ Hs dv A simple method (due to W.
Thomson, Camh. Math. Journal, iv. (1845), pp. 83-42) of proving this
result, by means of arguments of a physical character, is reproduced
by Lamb, Hydro- dynamics (1916), § 111. Analytical proofs, based on
Lame's proof, are given by Bertrand, Traite de Calcul Differentielle
(1864), pp. 181-187, and Goursat, Coiirs d'Analyse, i. (1910), pp.
155-159, the last proof being appreciably the simplest. Another proof
is given by Heine, Theorie der Kugelfunctionen, i. (1878), pp.
303-306.

W. M. A. 26

%
% 402
%

15. Shew that a general solution of the equation of wave motions is

r= F .v coH 6 + iiin \$ + iz, >/ + iz siu 6 + ct cos B, B)dd.

J -IT

(Bateman, Proc. London Math. Soc. (2) l. (1904), p. 457.)

16. If r=/(.r, y, z, t) be a solution of

d ct cx' cy' dz- ' prove that another solution of the equation is

17. Shew that a general solution of the equation of wave motions, when
the motion is independent of <, is

/ / (2 + ip cos e, ct + p sin 6) dO

f' /"", / a - z + ct cos d\,,,.,

+ arc suih - r- ) F (a, 6) dBda,

J (1 .' -TT \ p sin / ' '

where p, (f>, z are cylindrical coordinates and a, h are arbitrary
constants.

(Bateman, Proc. London Math. Soc. (2) i. (1904), p. 458.)

"18. If r=/(.r, y, z) is a solution of Laplace's equation, shew that

Y 1 / r -a r +gg az \

~( \, )i-' V2(.'--i ' i x-iyy x-iy)

is another solution.

(Bateman, Proc. London Math. Soc. (2) vii. (1909), p. 77.)

19. If U=f x, y, z, t) is a solution of the equation of wave motions,
shew that another solution is

rj 1 .( X y \ r2-l rHl \

z-ct-'Xz-ct'' z-ct" z-cty 2c z-ct))'

(Bateman, Proc. London Math. Soc. (2) vii. (1909), p. 77.)

20. If l=x-iy, m = z + hv, n = . : - + y' + z - + iv%

\ = j:+iy, fji = z-uv, p= - \, so that l\ + 7nfi + nv=0,

shew that any homogeneous solution, of degree zero, of

cHT cH[ dH/ c U Q dx' dy cz dw

satisfies +Z£+ =0-

dldX dmdfi dndv '

and obtain a solution of this equation in the form

j', b, c \

U', ', y' )

where = ( -c) (f-a),. ? /Li = (c-a) (f-6), np = (a- b) ((-c).

(Bateman, Proc. London Math. Soc. (2) vii. (1909), pp. 78-82.)

%
% 403
%

21*. If (r, 6, (f)) are spheroidal coordinates, defined by the
equations

jr = c (r + iy sin cos<, y=c (r2-|-l) sin sin(, z=crcosd,

where x, y, z are rectangular coordinates and c is a constant, shew
that, when n and m are integers,

('" /. cos + y sin -f i2\ cos, (n - in)\ \,., cos

Pn\ -] mtdt = 27ry- - P,r tr)Pn'" cos 6) . md).

j -n- \ c /Sin n+m)l " sin

(Blades, Proc. Edinburgh Math. Soc. xxxiii.) 22. With the notation of
example 21, shew that, if 2 =t= 0,

/ /cPcos + y sin +i'2\ cos,, (n - m)l, . s -r, / cos Qn - - ) intdt
= 277 )--- -fj § ' ir) P ' cos e) . m4>. -r \ c J Sin (n+m) i " -' " '
sin

(Jeffery, Proc. Edinburgh Math. Soc. xxxiil.)

* The functions introduced in examples 21 and 22 are known as internal
and external spheroidal harmonics respectively.

26-2


\section{Momentum Equilibrium and Elbow Angle Optimization}
\label{sec:72methodology}

\minitoc[-7mm]{70mm}{4}

\noindent
In this section, we give an overview of the methodology of our approach.
We continue following the presentation of \cite{Valentin18Gradient}.

\subsection{From Muscle Forces to Equilibrium Angles}
\label{sec:721equilibrium}

\paragraph{Model inputs and outputs}

In the following, we regard simulations of the
human upper limb model described in \cref{sec:71model} as a black box,
which receives as its input
the elbow angle $\elbang \in \clint{\ang{10}, \ang{150}}$
and the activation parameters
$(\actT, \actB) \in \clint{\*0, \*1} = \clint{0, 1}^2$
of triceps and biceps.%
\footnote{%
  Here and in the following, the subscripts T, B, and L stand for
  triceps, biceps, and load, respectively.%
}
The outputs of the black box simulation are the forces
$\forceT(\elbang, \actT)$ and $\forceB(\elbang, \actB)$
that triceps and biceps exert.
These forces depend on the elbow angle as well as on the respective
activation parameter.
Gravitational forces due to the masses of bones or muscles
are neglected in this context.
However, we allow the specification of an external load $\forceL$,
which is applied to the end of the forearm.
This load may be the weight force of some object
that the arm is supposed to keep in position.

\paragraph{Moments and lever arms}

Each force exerts a \term{moment} (or \term{torque}) on the elbow joint.
The moments are the products of the forces $\forceX$
with the respective lever arms $\armX$
($X \in \{\mathrm{T}, \mathrm{B}, \mathrm{L}\}$).
The lever arms are approximated as in
\multicite{Roehrle16Two,Valentin18Gradient} by using
the tendon-displacement method of \cite{An84Determination}:
\begin{subequations}
  \begin{align}
    \armT(\elbang)
    &\ceq (-0.0009399 \{\elbang\}^2 + 0.1126 \{\elbang\} + 22.21)\;
    \si{\milli\meter},\\
    \armB(\elbang)
    &\ceq (-0.001482 \{\elbang\}^2 + 0.1776 \{\elbang\} + 35.02)\;
    \si{\milli\meter},\\
    \armL(\elbang)
    &\ceq \sin(\elbang) \cdot \SI{282.5}{\milli\meter},
  \end{align}
\end{subequations}
where $\{\elbang\}$ denotes the dimensionless value of $\elbang$
in degrees.
The lever arms are non-negative and the forces are signed, i.e.,
positive forces pull the forearm downwards and
negative forces pull it upwards.
In general, $\forceT, \forceL \ge \SI{0}{\newton}$ and
$\forceB \le \SI{0}{\newton}$.

\paragraph{Total moment and equilibrium elbow angle}

The \term{total moment} of the system is given by the function
\begin{subequations}
  \label{eq:totalMoment}
  \begin{gather}
    \moment_{\forceL,\actT,\actB}\colon
    \clint{\ang{10}, \ang{150}} \to \real,\\
    \moment_{\forceL,\actT,\actB}(\elbang)
    \ceq \forceT(\elbang, \actT) \armT(\elbang) +
    \forceB(\elbang, \actB) \armB(\elbang) +
    \forceL \armL(\elbang),
  \end{gather}
\end{subequations}
cf.\ \cite{Valentin18Gradient}.
The system is in \term{equilibrium}
if the total moment vanishes, i.e.,
$\moment_{\forceL,\actT,\actB}(\elbang) = \SI{0}{\newton\meter}$.
We call the corresponding angle $\elbang$ the
\term{equilibrium elbow angle}
for the load $\forceL$ and the activation parameters $\actT, \actB$.
To find this angle for a given load $\forceL$ and activation parameters
$\actT$ and $\actB$, we first note that
$\moment_{\forceL,\actT,\actB}$ may have zero, exactly one,
or multiple zeros in $\clint{\ang{10}, \ang{150}}$.
Hence, the inverse function evaluated at $\SI{0}{\newton\meter}$
is partially defined depending on the load and the activation parameters:
\begin{equation}
  \label{eq:equilibriumAngle}
  \equielbang{\forceL}\colon \actdomain{\forceL} \!\to
  \clint{\ang{10}, \ang{150}},\quad
  \actdomain{\forceL} \subset \clint{\*0, \*1},\quad
  \equielbang{\forceL}(\actT,\actB)
  \ceq (\moment_{\forceL,\actT,\actB})^{-1}(\SI{0}{\newton\meter}),
\end{equation}
which is well-defined whenever $\moment_{\forceL,\actT,\actB}$
has a unique root.
We approximate $\equielbang{\forceL}(\actT,\actB)$ with the Newton method
\multicite{Roehrle16Two,Valentin18Gradient}:
\begin{equation}
  \label{eq:newtonAngle}
  \elbang^{(j+1)}
  \ceq \elbang^{(j)} -
  \frac{
    \moment_{\forceL,\actT,\actB}(\elbang^{(j)})
  }{
    \partialderiv{\partialdiff{} \elbang}{\moment_{\forceL,\actT,\actB}}
    (\elbang^{(j)})
  },\quad
  j \in \nat,
\end{equation}
with an initial value
$\elbang^{(0)} \in \clint{\ang{10}, \ang{150}}$
and the stopping criterion of
$\abs{\moment_{\forceL,\actT,\actB}(\elbang^{(j)})} <
\SI{e-9}{\newton\meter}$.
We repeat the Newton method for the initial values
$\elbang^{(0)} = \ang{80}, \ang{40}, \ang{120}$
and use the first converged result
(i.e., we check if $\elbang^{(0)} = \ang{80}$ converges;
if not, we proceed with $\elbang^{(0)} = \ang{40}$, and so on).
If all three initial values do not converge,
we conclude that $(\actT, \actB) \notin \actdomain{\forceL}$.

\subsection{Optimization Problems}
\label{sec:722optimization}

\paragraph{General problem}

The general problem in our setting is as follows:
For a given external load $\forceL$ and a target elbow angle $\tarelbang$,
find activation parameters $(\actT, \actB) \in \clint{\*0, \*1}$
such that the target elbow angle is attained in the equilibrium,
i.e., $\equielbang{\forceL}(\actT,\actB) = \tarelbang$.
Example applications of such a scenario are medicine and robotics,
when a specific movement should be carried out.

\paragraph{List of optimization problems}

As discussed in \cref{sec:711models},
musculoskeletal systems with an antagonistic muscle pair
such as our human upper limb model are usually overdetermined.
This means that there are multiple solutions to this general problem.
As a remedy, one may solve one of the following two
optimization problems \cite{Valentin18Gradient}:

\begin{enumerate}[label=O\arabic*.,ref=O\arabic*,leftmargin=2.7em]
  \item
  \label{item:biomech2MinSum}
  For a given external load $\forceL$ and a target angle
  $\tarelbang \in \clint{\ang{10}, \ang{150}}$,
  find the activation parameters $(\actT, \actB) \in \clint{\*0, \*1}$
  such that $\actT + \actB$ is minimized under the constraint
  $\equielbang{\forceL}(\actT, \actB) = \tarelbang$.

  \item
  \label{item:biomech2MinDist}
  For a given external load $\forceL(t_2)$ for a time $t_2 > t_1$,
  a target angle $\tarelbang(t_2) \in \clint{\ang{10}, \ang{150}}$,
  and initial activation parameters
  $(\actT(t_1), \actB(t_1)) \in \clint{\*0, \*1}$,
  find new activation parameters
  $(\actT(t_2), \actB(t_2)) \in \clint{\*0, \*1}$ such that
  $(\actT(t_2) - \actT(t_1))^2 + (\actB(t_2) - \actB(t_1))^2$
  is minimized under the constraint
  $\equielbang{\forceL(t_2)}(\actT(t_2), \actB(t_2)) = \tarelbang(t_2)$.
\end{enumerate}

\noindent
The motivation of both problems is that the human body tries to
achieve a given movement with minimal energy effort.

\paragraph{Motivation of problem \ref{item:biomech2MinSum}}

For the first problem \ref{item:biomech2MinSum},
this effort is quantified by $\actT + \actB$,
i.e., the energy effort for each muscle is assumed to be proportional
to its activation parameter.

\paragraph{Motivation of problem \ref{item:biomech2MinDist}}

The second problem \ref{item:biomech2MinDist} is motivated as follows:
Before time $t = t_1$, the musculoskeletal system is in equilibrium for
the external load $\forceL(t_1)$,
activation parameters $\actT(t_1), \actB(t_1)$, and elbow angle
$\tarelbang(t_1) \ceq \equielbang{\forceL(t_1)}(\actT(t_1), \actB(t_1))$, i.e.,
$\moment_{\forceL(t_1),\actT(t_1),\actB(t_1)}(\tarelbang(t_1))
= \SI{0}{\newton\meter}$.
Directly after $t = t_1$,
the external force and/or the target angle is suddenly changed
to $\forceL(t_2)$ and $\tarelbang(t_2)$, respectively.
Consequently, triceps and biceps adapt their activation parameters
such that the musculoskeletal system returns to equilibrium
at some time $t = t_2 > t_1$.
Hence, we have to determine the new activation parameters
$\actT(t_2), \actB(t_2)$ such that
$\moment_{\forceL(t_2),\actT(t_2),\actB(t_2)}(\tarelbang(t_2))
= \SI{0}{\newton\meter}$.
Again, these parameters
$\actT(t_2)$ and $\actB(t_2)$ are not uniquely determined.
Therefore, we want to find the pair of activation parameters
that is closest (in terms of the Euclidean norm) to the initial
activation parameters $\actT(t_1), \actB(t_1)$.

\paragraph{Optimization method}

Problems \ref{item:biomech2MinSum} and \ref{item:biomech2MinDist}
are both constrained optimization problems.
For their solution, we employ the augmented Lagrangian method as
described in \cref{sec:513gradientBasedConstrained}
using an adaptive gradient descent algorithm
for the gradient-based optimization of the penalized objective function
(see \cref{sec:512gradientBasedUnconstrained}).

\subsection{B-Spline Surrogates on Sparse Grids}
\label{sec:723surrogates}

\paragraph{Complexity}

To solve optimization problems
\ref{item:biomech2MinSum} and \ref{item:biomech2MinDist},
the optimization method needs to evaluate the objective
and constraint functions multiple times during the algorithm.
This requires the evaluation of $\equielbang{\forceL}$,
which in turn has to be approximated with the Newton method.
As we see in \cref{eq:newtonAngle},
each iteration of the Newton method needs not only the values of the
muscle forces $\forceT$ and $\forceB$, but also their
partial derivatives with respect to $\elbang$.
These partial derivatives have to be approximated with finite differences.

Unfortunately, simulations of continuum-mechanical models are
computationally expensive.
One evaluation of the muscle force pair $\forceT, \forceB$
requires the solution of a solid mechanics model
with a complex constitutive law, pre-stretch, and contact between
bone and muscles \cite{Valentin18Gradient}.
On average, a single evaluation of $\forceT$ and $\forceB$ takes
about half an hour on current desktop computers.
%
If we assume that we need four Newton iterations on average,
then a single iteration of the optimization algorithm to solve
problems \ref{item:biomech2MinSum} and \ref{item:biomech2MinDist}
will take four hours to complete
(assuming one evaluation of objective and constraint functions
per optimizer iteration and
two evaluations of the muscle force pair
per Newton iteration to approximate the missing derivative).
Consequently, the whole optimization process takes
two weeks to complete, if the optimizer converges after 100 iterations.

\paragraph{Sparse grid surrogates}

A popular way to reduce complexity is to employ surrogates.
In this case, the idea is to replace the muscle force functions
$\forceT, \forceB$ with surrogates $\forceTintp, \forceBintp$
\cite{Valentin18Gradient}, e.g., by interpolation.
We then automatically obtain a surrogate
\begin{subequations}
  \label{eq:totalMomentSurrogate}
  \begin{gather}
    \momentintp_{\forceL,\actT,\actB}\colon
    \clint{\ang{10}, \ang{150}} \to \real,\\
    \momentintp_{\forceL,\actT,\actB}(\elbang)
    \ceq \forceTintp(\elbang, \actT) \armT(\elbang) +
    \forceBintp(\elbang, \actB) \armB(\elbang) +
    \forceL \armL(\elbang),
  \end{gather}
\end{subequations}
for the total moment (cf.\ \cref{eq:totalMoment}) and,
consequently, a surrogate
\begin{equation}
  \label{eq:equilibriumAngleSurrogate}
  \equielbangintp{\forceL}\colon \actdomainintp{\forceL} \!\to
  \clint{\ang{10}, \ang{150}},\quad
  \actdomainintp{\forceL} \subset \clint{\*0, \*1},\quad
  \equielbangintp{\forceL}(\actT,\actB)
  \ceq (\momentintp_{\forceL,\actT,\actB})^{-1}(\SI{0}{\newton\meter}),
\end{equation}
for the equilibrium elbow angle function (cf.\ \cref{eq:equilibriumAngle}).
Since the surrogates are much cheaper to evaluate,
the computation time is decreased by up to seven orders of magnitude,
as experiments show.

The approach in \cite{Valentin18Gradient} and in this thesis is
to determine surrogates
$\forceXintp\colon \clint{\*0, \*1} \to \real$
($X \in \{\mathrm{T}, \mathrm{B}\}$) by sparse grid interpolation.
Compared to surrogate construction techniques based on full grids,
sparse grids help to reduce the number of samples that
are necessary to build ``reasonably'' accurate surrogates,
especially if the number of dimensions is moderately large
($d \ge 4$, \term{curse of dimensionality}).

The present model only has $d = 2$ dimensions ($\actT$ and $\actB$),
since the model contains only two muscles.
However, as we will see,
already for this low-dimensional problem,
sparse grids outperform conventional full grid interpolation.
The results have to be seen as a proof of concept.
One will be able to handle higher dimensionalities
(i.e., models with a larger number of muscles) similarly with little
or even no adjustments at all.
The low dimensionality of the model in this thesis
enables us to compute and compare against reference solutions,
which would not be possible in a higher-dimensional setting.

\paragraph{Benefiting from B-splines}

As in \cite{Valentin18Gradient},
we use higher-order hierarchical B-splines as basis functions
for the sparse grid surrogates.
This has three advantages when compared with conventional
sparse grid bases such as piecewise linear functions:
%
First, the partial derivative
$\partialderiv{\partialdiff{} \elbang}{\momentintp}$ needed
for the Newton method in \cref{eq:newtonAngle} is continuous and
explicitly known.
There is no need to approximate the derivative with
finite differences, reducing both error and computation time.
%
Second, we can use gradient-based optimization methods
for the solution of the optimization problems \ref{item:biomech2MinSum} and
\ref{item:biomech2MinDist},
which involve the equilibrium elbow angle function
$\equielbangintp{\forceL}\colon \clint{\*0, \*1} \to \real$.
With the implicit function theorem \cite{Kudryavtsev95Implicit},
we obtain for the derivative of $\equielbangintp{\forceL}$
\begin{equation}
  \gradient{\actT,\actB}{\equielbangintp{\forceL}}
  = -\,(\gradient{\actT,\actB}{\momentintp}) \cdot
  (\gradient{\elbang}{\momentintp})^{-1}
  = -\,\frac{
    \gradient{\actT,\actB}{\momentintp}
  }{
    \partialderiv{\partialdiff{} \elbang}{\momentintp}
  },
\end{equation}
where $\gradient{\actT,\actB}{}$ is the transposed Jacobian
with respect to $\actT$ and $\actB$.%
\footnote{%
  For example, the first column is the gradient with respect to $\actT$
  and the second column is the gradient with respect to $\actB$.%
}
For B-splines,
both the transposed Jacobian $\gradient{\actT,\actB}{\momentintp}$ and
the partial derivative $\partialderiv{\partialdiff{} \elbang}{\momentintp}$
are continuous, explicitly known, and can be evaluated fast.
%
Third and finally,
the usage of higher-order B-splines as basis functions
increases the order of convergence of interpolation errors
as shown for test functions in \cref{sec:541interpolation}.
Thus, fewer interpolation points are necessary to construct a surrogate
with the same error as for piecewise linear functions.


%!TEX root = maths.tex
\newcommand{\adj}{\text{adj}\,}
\newcommand{\identitymatrix}{\begin{bmatrix*}[c]1&0&0\\0&1&0\\0&0&1\end{bmatrix*}}
\begin{document}
\chapter{Matrices II}
\section{Determinant of a 3x3 Matrix}
The determinant of a 3x3 matrix is calculated by extracting a row of 2x2 determinants from the given 3x3 matrix. These 2x2 determinants are referred to as minors.

\begin{example}
	Find the determinant of the matrix $\mathbf A = \left(\begin{smallmatrix*}[r]
	2 &-1 &4\\
	3 &0 &-3\\
	4 &5 &6
	\end{smallmatrix*}\right)$
\end{example}
\section{[Parentheses about vector product]}
Consider the vectors $\mathbf{a} = x_1\mathbf{i} + y_1\mathbf{j} + z_1\mathbf{k}$ and b $\mathbf{b} = x_2\mathbf{i} + y_2\mathbf{j} + z_2\mathbf{k}$.\\

Since vector product is distributive across addition:\\

\begin{align*}
	\mathbf{a} \times \mathbf{b} & = \left(  x_1\mathbf{i} + y_1\mathbf{j} + z_1\mathbf{k} \right) \times \left( x_2\mathbf{i} + y_2\mathbf{j} + z_2\mathbf{k} \right)\\
	&+\cancel{x_1x_2(\mathbf i \times \mathbf i)} + x_1y_2(\mathbf i \times \mathbf j) + x_1z_2(\mathbf i \times \mathbf k)\\
	&+ y_1x_2(\mathbf j \times \mathbf i) + \cancel{y_1y_2(\mathbf j \times \mathbf j)} + y_1z_2(\mathbf j \times \mathbf k)\\
	&+z_1x_2(\mathbf k \times \mathbf i) + z_1y_2(\mathbf k \times \mathbf j) + \cancel{z_1z_2(\mathbf k \times \mathbf k)}\\
	&=x_1y_2\mathbf k - x_1z_2\mathbf j - y_1x_2 \mathbf k + y_1z_2\mathbf i +z_1x_2\mathbf j -z_1y_2\mathbf i\\
	&=(y_1z_2-z_1y_2)\mathbf i - (x_1z_2 - z_1 x_2)\mathbf j + (x_1y_2-y_1x_2)\mathbf k
\end{align*}

\section{Some properties of determinant}
The value of the determinant is unaltered if all the rows and columns of a given matrix are interchanged. If the above happens, the resulting determinant will be of opposite sign.\\
 If one row/column of a determinant $D$ is multiplied by $\lambda$, the resulting determinant is equal to $\lambda D$

\section{The Inverse of a 3x3 matrix}

\subsection{Matrix of cofactors}
Consider the matrix $\mathbf A = \begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix}$\\

\noindent For each element of any given matrix $\mathbf A$:
	\begin{itemize}
\item{Ignore the values of the current row and column.}
\item{Calculate the determinant of the remaining values.}
\item{Apply alternating signs starting from $+$.}
\item{Input this determinant into a new matrix}
	\end{itemize}1
The result would be the below matrix referred to as \emph{the matrix of co-factors}.

\[
\mathbf C=
\begin{bmatrix*}[r]
	\begin{vmatrix}e&f\\h&i\end{vmatrix}&&-\begin{vmatrix}d&g\\f&i\end{vmatrix}&&\begin{vmatrix}d&e\\g&h\end{vmatrix}\phantom{-}\\\\
	-\begin{vmatrix}e&f\\h&i\end{vmatrix}&&\begin{vmatrix}d&g\\f&i\end{vmatrix}&&-\begin{vmatrix}d&e\\g&h\end{vmatrix}\phantom{-}\\\\
	\begin{vmatrix}e&f\\h&i\end{vmatrix}&&-\begin{vmatrix}d&g\\f&i\end{vmatrix}&&\begin{vmatrix}d&e\\g&h\end{vmatrix}\phantom{-}
\end{bmatrix*}
\]
\subsection{Adjugate matrix}
The next step of finding the inverse matrix of $\mathbf A$ is finding the \emph{adjugate} matrix of $\mathbf A$. This is done by obtaining the \emph{transpose} of the matrix of cofactors, in our case, $\mathbf C$.
\[
\adj A =
\begin{bmatrix*}[r]
\begin{vmatrix}e&f\\h&i\end{vmatrix}&&-\begin{vmatrix}e&f\\h&i\end{vmatrix}&&\begin{vmatrix}e&f\\h&i\end{vmatrix}\phantom{-}\\\\
-\begin{vmatrix}d&g\\f&i\end{vmatrix}&&\begin{vmatrix}d&g\\f&i\end{vmatrix}&&-\begin{vmatrix}d&g\\f&i\end{vmatrix}\phantom{-}\\\\
\begin{vmatrix}d&e\\g&h\end{vmatrix}&&-\begin{vmatrix}d&e\\g&h\end{vmatrix}&&\begin{vmatrix}d&e\\g&h\end{vmatrix}\phantom{-}
\end{bmatrix*}
\]
\subsection{Inverse matrix}
Let the inverse of a matrix $A$ be $A^{-1}$. It is defined as a matrix of the same size of $A$ such that \[AA^{-1} = A^{-1}A = I\]
This same matrix $A^{-1}$ is defined more particularly as \[A^{-1} = \frac{1}{\det A}\quad\text{adj }A\]
\begin{example}
	Find the inverse of the matrix $A = \begin{pmatrix*}
										2&3&1\\
										1&1&1\\
										5&-1&0
										\end{pmatrix*}$
	\end{example}
\begin{example}
Solve using the inverse matrix method the system of equations:\\
$x+y+z=7$\\
$x-y+2z=9$\\
$2x+y-z=1$
\end{example}
\newpage
\section{Transformation Matrices in 3D}
\subsection{Reflection along the xy plane}

\begin{center}
\begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
% The axes
\draw[->] (xyz cs:x=-5) -- (xyz cs:x=5) node[above] {$x$};
\draw[->] (xyz cs:y=-5) -- (xyz cs:y=5) node[right] {$y$};
\draw[->] (xyz cs:z=-5) -- (xyz cs:z=5) node[above] {$z$};

\foreach \coo in {-4,-3,...,4}
{
	\draw (\coo,-1.5pt) -- (\coo,1.5pt);
	\draw (-1.5pt,\coo) -- (1.5pt,\coo);
	\draw (xyz cs:y=-0.15pt,z=\coo) -- (xyz cs:y=0.15pt,z=\coo);
}
%\draw (xyz cs:y=3,z=2);
\end{tikzpicture}
\end{center}

\begin{align*}
\begin{bmatrix*}[c]1&0&0\\0&1&0\\0&0&1\end{bmatrix*} \rightarrow \begin{bmatrix*}[c]1&0&0\\0&1&0\\0&0&-1\end{bmatrix*}
\end{align*}

\subsection{Rotation along the y-axis}

\begin{align*}
\begin{bmatrix*}[c]1&0&0\\0&1&0\\0&0&1\end{bmatrix*} \rightarrow \begin{bmatrix*}[c]\cos\theta&0&-\sin\theta\\0&1&0\\\sin\theta&0&\cos\theta\end{bmatrix*}
\end{align*}
\subsection{Rotation along the z-axis}

\begin{align*}
\begin{bmatrix*}[c]1&0&0\\0&1&0\\0&0&1\end{bmatrix*} \rightarrow \begin{bmatrix*}[c]\cos\theta&-\sin\theta&0\\\sin\theta&\cos\theta&0\\0&0&1\end{bmatrix*}
\end{align*}
\subsection{Rotation along the z-axis}

\begin{align*}
\begin{bmatrix*}[c]1&0&0\\0&1&0\\0&0&1\end{bmatrix*} \rightarrow \begin{bmatrix*}[c]1&0&0\\0&\cos\theta&-\sin\theta\\0&\sin\theta&\cos\theta\end{bmatrix*}
\end{align*}
\subsection{Enlargement}
When we enlarge (or conversely, reduce) by scale factor $n$, the unit base vector is multiplied by $n$.\\
Thus the matrix representing an enlargement by scale factor n is given by:
\begin{align*}
n\identitymatrix = \begin{bmatrix*}[c]n&0&0\\0&n&0\\0&0&n\end{bmatrix*}
\end{align*}
\section{Geometric Interpretation of the Determinant}
Consider an object with volume $V$ transformed by the matrix $\mathbf A$ with determinant $|\mathbf A|$.
The volume of the image is given by $|\mathbf A|V$. Thus, the determinant of the transformation matrix denotes the number of times by which th volume of the object increases or decreases.
\begin{example}
	Describe the effect on volume in $3$D space of the transformation given by $\mathbf{A} = \begin{bmatrix*}[r]1&2&3\\5&0&-1\\2&4&-3\end{bmatrix*}$
\end{example}

\begin{example}
	Find the images of $P(4,5,1)$, $Q(3,-1,-2)$, $R(6,-2,0)$ under the transformation given by \\$\mathbf A = \left(\begin{smallmatrix*}[r]4&3&2\\-1&5&0\\6&2&-3\end{smallmatrix*}\right)$
\end{example}
\begin{example}
	Find the equation of the line which is the image of the line $\mathbf r = 3\mathbf i +\mathbf j +\mathbf k + \lambda(2\mathbf i + \mathbf j - 5\mathbf k)$ under the transformation given by $\mathbf A =\begin{bmatrix}2&3&1\\-1&2&4\\0&6&1\end{bmatrix}$
\end{example}
Find two points on the line.
Find images of points.
Find equation of the image line

\begin{example}
	Find the image of the plane $x+2y-7z=2$ under the transformation defined by $\mathbf A = \begin{smallmatrix}-1&2&1\\-3&1&4\\0&1&2\end{smallmatrix}$
\end{example}
\end{document}