Finding the orthogonal projection of a vector

I can't figure this out. How the book explains to do this problem doesn't make sense to me. I'm hoping someone can simplify this so I can understand how to do this step by step.

Let $L$ be the line in $\mathbb{R}^3$ that consists of all scalar multiples of $$\left[ \begin{array}{ccc} 2\\ 1\\ 2\\ \end{array} \right]$$ Find the reflection of the vector

$$\left[ \begin{array}{ccc} 1\\ 4\\ 1\\ \end{array} \right]$$ onto $L$

• Are you asking for reflection (as in the body of the question) or projection (as in the subject)? – Thomas Jul 11 '16 at 17:38

Let $L$ be the line spanned by some non-zero vector $\mathbf{v} \in \mathbb{R}^3$, so that $L = \{a\mathbf{v} \mid a \in \mathbb{R}\}$ is the space of all scalar multiples of $\mathbf{v}$. Then the orthogonal projection of a vector $\mathbf{x} \in \mathbb{R}^3$ onto the line $L$ can be computed as $$\operatorname{Proj}_L(\mathbf{x}) = \frac{\mathbf{v} \cdot \mathbf{x}}{\mathbf{v}\cdot\mathbf{v}} \mathbf{v}.$$ So, in this case, we have $$\mathbf{v} = \begin{pmatrix}2\\1\\2\end{pmatrix}, \quad \mathbf{x} = \begin{pmatrix}1\\4\\1\end{pmatrix},$$ so that $$\mathbf{v} \cdot \mathbf{x} = 2 \cdot 1 + 1 \cdot 4 + 2 \cdot 1 = 8, \quad \mathbf{v} \cdot \mathbf{v} = 2^2 + 1^2 + 2^2 = 9,$$ and hence $$\operatorname{Proj}_L(\mathbf{x}) = \frac{8}{9}\begin{pmatrix}2\\1\\2\end{pmatrix}.$$
Now, you probably wanted to compute the orthogonal projection of some vector $\mathbf{x}$ onto the line $L$ spanned by some non-zero vector $\mathbf{v}$. But what if you did want to compute the reflection of $\mathbf{x}$ in the line $L$? What would this mean? Well, in general, suppose that $S$ is a subspace of $\mathbb{R}^3$ (e.g., a line through the origin or a plane through the origin), so that for any vector $\mathbf{x} \in \mathbb{R}^3$, we have $$\mathbf{x} = \operatorname{Proj}_S(\mathbf{x}) + \operatorname{Proj}_{S^\perp}(\mathbf{x}),$$ where $\operatorname{Proj}_S(\mathbf{x})$ is the orthogonal projection of $\mathbf{x}$ onto $S$ and $\operatorname{Proj}_{S^\perp}(\mathbf{x})$ is the orthogonal projection of $\mathbf{x}$ onto the orthogonal complement $$S^\perp = \{\mathbf{y} \in \mathbb{R}^3 \mid \text{for every \mathbf{z} \in S}, \; \mathbf{y} \cdot \mathbf{z} = 0\}$$ of $S$; in particular, observe that $$\operatorname{Proj}_{S^\perp}(\mathbf{x}) = \mathbf{x} - \operatorname{Proj}_S(\mathbf{x}).$$ Then, geometrically, the reflection $\operatorname{Refl}_S(\mathbf{x})$ of $\mathbf{x}$ in $S$ is given by fixing the component of $\mathbf{x}$ in $S$ and flipping the direction of the component of $\mathbf{x}$ in $S^\perp$, i.e., $$\operatorname{Refl}_S(\mathbf{x}) = \operatorname{Proj}_S(\mathbf{x}) - \operatorname{Proj}_{S^\perp}(\mathbf{x}) = \operatorname{Proj}_S(\mathbf{x}) - \left( \mathbf{x} - \operatorname{Proj}_S(\mathbf{x})\right) = 2\operatorname{Proj}_S(\mathbf{x}) - \mathbf{x}.$$ So, suppose that $L$ is the line spanned by some non-zero vector $\mathbf{v} \in \mathbb{R}^3$. On the one hand, the reflection of $\mathbf{x}$ in $L$ is given by $$\operatorname{Refl}_L(\mathbf{x}) = 2\operatorname{Proj}_L(\mathbf{x}) - \mathbf{x} = 2\frac{\mathbf{v} \cdot \mathbf{x}}{\mathbf{v}\cdot\mathbf{v}} \mathbf{v} - \mathbf{x},$$ which in your case yields $$\operatorname{Refl}_L(\mathbf{x}) = 2 \cdot \frac{8}{9}\begin{pmatrix}2\\1\\2\end{pmatrix} - \begin{pmatrix}1\\4\\1\end{pmatrix} = \frac{1}{9}\begin{pmatrix}23\\-20\\23\end{pmatrix}.$$ On the other hand, the reflection of $\mathbf{x}$ in the plane $$L^\perp = \{\mathbf{y} \in \mathbb{R}^3 \mid \mathbf{v} \cdot \mathbf{y} = 0\}$$ with normal vector $\mathbf{v}$ is given by $$\operatorname{Refl}_{L^\perp}(\mathbf{x}) = 2\operatorname{Proj}_{L^\perp}(\mathbf{x}) - \mathbf{x} = 2\left(\mathbf{x} - \operatorname{Proj}_L(\mathbf{x})\right) - \mathbf{x} = \mathbf{x} - 2\operatorname{Proj}_L(\mathbf{x}) = \mathbf{x} - 2\frac{\mathbf{v} \cdot \mathbf{x}}{\mathbf{v}\cdot\mathbf{v}} \mathbf{v},$$ which in your case yields $$\operatorname{Refl}_{L^\perp}(\mathbf{x}) = \begin{pmatrix}1\\4\\1\end{pmatrix} - 2 \cdot \frac{8}{9}\begin{pmatrix}2\\1\\2\end{pmatrix} = -\frac{1}{9}\begin{pmatrix}23\\-20\\23\end{pmatrix}.$$ One last cultural note: the reflection $\operatorname{Refl}_{L^\perp}(\mathbf{x})$ of $\mathbf{x}$ in the plane $L^\perp$ with normal vector $\mathbf{v}$ is better known in more advanced contexts by another name, namely as the image $$H_{\mathbf{v}}(\mathbf{x}) := \operatorname{Refl}_{L^\perp}(\mathbf{x}) = \mathbf{x} - 2\frac{\mathbf{v} \cdot \mathbf{x}}{\mathbf{v}\cdot\mathbf{v}} \mathbf{v}$$ of $\mathbf{x}$ under the Householder transformation $H_\mathbf{v}$ corresponding to $\mathbf{v}$. So, in your case, as we just saw, $$H_{\mathbf{v}}(\mathbf{x}) = -\frac{1}{9}\begin{pmatrix}23\\-20\\23\end{pmatrix}.$$
Suppose you mean a vector ($\mathbf{v}$) "specular" to the given one ($\mathbf{u}$) with respect to the line $L$. Since the line is passing through the origin, let's fix our mind on taking the vectors as orientated segments from the origin.
If you do the cross product $\mathbf{w} = \mathbf{u} \times \mathbf{L}$ you get a vector which is orthogonal either to the line and to $\mathbf{u}$, i.e. it is normal to the plane containing the line and $\mathbf{u}$. Then $\mathbf{v} \times \mathbf{L}$ shall be equal to $-\mathbf{w}$ : solve such a linear system of three equations in three unknowns. Hope that is of help to you.