\section{Vectors, Dot Products, and Projections}

\begin{enumerate}[1.]



\item {\it What is the distance from the point $(1,2,3)$ in $\mathbb{R}^3$ to the nearest point on the 
$x$-axis?}

\medskip

The nearest point  on the $x$-axis is $(1,0,0)$. (This can be found using vector projections, but here the projection is easy enough to find by inspection.) The distance is $\sqrt{4+9}=\sqrt{13}$.



\bigskip




\item {\it  Express the vector ${\ii} +2{\bf j}-{\bf k}$ as a sum of vectors ${\bf u}$ and ${\bf v}$, where
${\bf u}$ is parallel to the vector ${\bf i}-{\bf j}$ and ${\bf v}$ is perpendicular to ${\bf u}$.}


\medskip
The vector $\bf u$ is the vector projection of ${\ii} +2{\bf j}-{\bf k}$ on ${\bf i}-{\bf j}$. We find it from the formula
$$
{\bf u}=\frac{({\ii} +2{\bf j}-{\bf k})\cdot ({\bf i}-{\bf j})}{|{\bf i}-{\bf j}|^2}({\bf i}-{\bf j})
=\frac{1-2}{2}({\bf i}-{\bf j})=-\frac{1}{2}\ii+\frac{1}{2}\jj.
$$
Then ${\bf v}=({\ii} +2{\bf j}-{\bf k})-(-\frac{1}{2}\ii+\frac{1}{2}\jj)=\frac{3}{2}\ii + \frac{3}{2}\jj -\kk$.

\bigskip



\item 
{\it Let ${\bf u}=5\ii +7\kk$. Find vectors ${\bf v}$ and ${\bf w}$ such that:
${\bf u} = {\bf v} + {\bf w}$,
 ${\bf v}$ is parallel to the vector $\ii +2\jj -2\kk$,
and ${\bf w}$ is perpendicular to the vector $\ii +2\jj -2\kk$.}


\medskip
We need ${\bf v}$ to be the vector projection of ${\bf u}$ in the direction of
the vector $\ii +2\jj -2\kk$. Applying the formula from class, we get
\begin{align*}
{\bf v} &= \frac{(5\ii +7\kk)\cdot (\ii +2\jj -2\kk)}{| \ii +2\jj -2\kk|^2}
(\ii +2\jj -2\kk)
\\
&= \frac{5-14}{1+4+4} (\ii +2\jj -2\kk) = \frac{-9}{9} (\ii +2\jj -2\kk) = -\ii
-2\jj +2\kk.
\end{align*}
Then
$${\bf w} = {\bf u} - {\bf v} = (5\ii + 7\kk) - (-\ii -2\jj +2\kk)  = 6\ii
+2\jj +5\kk.$$
Optional: we can  check that ${\bf w}$ is perpendicular to $\ii +2\jj -2\kk$ by
checking the dot product,
$$
(6\ii +2\jj +5\kk) \cdot (\ii +2\jj -2\kk)=6 + 4 -10 = 0.
$$



\bigskip


\item {\it Find all values of $t$ for which the vector ${\bf v}=(t-2){\bf i} +2{\bf j}+ (2t+1){\bf k}$ is
perpendicular to the vector ${\bf w}=2t{\bf i} +(3-4t){\bf j}+ 2{\bf k}$.}

\medskip

We need ${\bf v}\cdot {\bf w}=0$. This means
\begin{align*}
0&=(t-2)(2t)+2(3-4t)+2(2t+1)=2t^2-4t+6-8t+4t+2
\\
&=2t^2-8t+8=2(t^2-4t+4)=2(t-2)^2
\end{align*}
Hence the only solution is $t=2$.

\bigskip





\item {\it  Let $Q=(1,0,-1)$. The set of points $P=(x,y,z)$ such that the vector $\vec{PQ}$ makes
equal angles with the vectors 
${\bf u}=2 {\bf i} -{\bf j}$ and ${\bf v}={\bf i}+ {\bf j}+3 {\bf k}$ can be described by an equation in $x,y,z$.
Find that equation. 
}
%
\bigskip

For vectors ${\bf a}$ and ${\bf b}$ we have ${\bf a}\cdot{\bf b}=|{\bf a}||{\bf b}| \cos\theta$, where $\theta$ is the angle between ${\bf a}$ and ${\bf b}$. Thus a vector $\vec{PQ}$ makes equal angles with the vectors ${\bf u}$ and ${\bf v}$ if and only if
\begin{equation}\label{q2_eqn}
\frac{\vec{PQ}\cdot{\bf u}}{|\vec{PQ}||{\bf u}|}=\frac{\vec{PQ}\cdot{\bf v}}{|\vec{PQ}||{\bf v}|}
\end{equation}
We will simplify this equation to give our equation in $x,y,z$. First, we calculate
\begin{align*}
\vec{PQ}&=(1-x,-y,-1-z)\ ,\\
\vec{PQ}\cdot{\bf u}&=2(1-x)+y\\
&=-2x+y+2\ ,\\
\vec{PQ}\cdot{\bf v}&=(1-x)-y+3(-1-z)\\
&=-x-y-3z-2\ ,\\
|{\bf u}|&=\sqrt{5}\ ,\\
|{\bf v}|&=\sqrt{11}\ .
\end{align*}
Substituting these into equation (\ref{q2_eqn}) gives us
\begin{align*}
(|\vec{PQ}||{\bf v}|)(\vec{PQ}\cdot{\bf u})&=(|\vec{PQ}||{\bf u}|)(\vec{PQ}\cdot{\bf v})\\
\iff |{\bf v}|(\vec{PQ}\cdot{\bf u})&=|{\bf u}|(\vec{PQ}\cdot{\bf v})\\
\iff \sqrt{11}(-2x+y+2)&=\sqrt{5}(-x-y-3z-2)
\end{align*}
\[\iff (-2\sqrt{11}+\sqrt{5})x+(\sqrt{11}+\sqrt{5})y+3\sqrt{5}z=-2\sqrt{5}-2\sqrt{11}\ .\]


\bigskip


\item{\it 
Let ${\bf u}$ and ${\bf v}$ be two non-zero vectors in $\rr^2$ that are not
parallel and not perpendicular to each other. Consider the following sequence
of vectors ${\bf w}_1, {\bf w}_2,\dots$ in $\rr^2$:
\begin{itemize}
\item ${\bf w}_1$ is the vector projection of ${\bf u}$ in the direction of
${\bf v}$,
\item ${\bf w}_2$ is the vector projection of ${\bf w_1}$ in the direction of
${\bf u}$,
\item ${\bf w}_3$ is the vector projection of ${\bf w_2}$ in the direction of
${\bf v}$,
\item ${\bf w}_4$ is the vector projection of ${\bf w_3}$ in the direction of
${\bf u}$),
\item continue in this manner, alternating projections in the directions of
${\bf u}$ and ${\bf v}$.
\end{itemize}
Find the general formula for the length of ${\bf w}_n$ for $n=1,2,\dots$, in
terms of $|{\bf u}|$, $|{\bf v}|$, and the angle $\theta$ between ${\bf u}$ and
${\bf v}$. What happens as $n\to\infty$? (Optional: you may want to draw a
picture.)
}

\medskip
We have
$$
| {\bf w}_1| = \left| \frac{{\bf u}\cdot{\bf v}}{|{\bf v}|}\right|  =
 \frac{|{\bf u}|\, |{\bf v}|\, |\cos\theta|}{|{\bf v}|}=
| {\bf u}|\, |\cos\theta|.
$$
Since ${\bf w}_1$ is parallel to ${\bf v}$, the angle between ${\bf w}_1$ and
${\bf u}$ is either $\theta$ or $\pi-\theta$. Since
$|\cos(\pi-\theta)|=|\cos\theta|$, in either case we get
$$
| {\bf w}_2| = \left| \frac{{\bf w}_1\cdot{\bf u}}{|{\bf u}|}\right|  =
\frac{|{\bf w}_1|\, |{\bf u}|\, |\cos\theta|}{|{\bf u}|}=
| {\bf w}_1|\, |\cos\theta|.
$$
Taking into account the formula we already have for $|{\bf w}_1|$, we get that
$$
| {\bf w}_2| = (|{\bf u}|\, |\cos\theta|)\, |\cos\theta|= |{\bf u}|\,
| |\cos\theta|^2.
$$
Repeating the argument, we get that for general $n$,
$$
| {\bf w}_n| = |{\bf u}|\, |\cos\theta|^n.
$$
Finally, since $|\cos\theta|<1$ by assumption, we have that $|{\bf w}_n|\to 0$
as $n\to\infty$.

\end{enumerate}
