### Instruction: A line is parameterized by
\[\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 5 \\ -1 \end{pmatrix} + t \begin{pmatrix} 2 \\ 1 \end{pmatrix}.\]A second line is parameterized by
\[\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} -7 \\ 3 \end{pmatrix} + u \begin{pmatrix} -1 \\ 1 \end{pmatrix}.\]If $\theta$ is the acute angle formed by the two lines, then find $\cos \theta.$.### Response: The cosine of the angle between two lines is equal to the dot product of their direction vectors divided by the product of their magnitudes.
So I need to find the direction vectors and their magnitudes for the two lines.
The direction vector for the first line is $\begin{pmatrix} 2 \\ 1 \end{pmatrix}$ and its magnitude is $\sqrt{2^2 + 1^2} = \sqrt{5}$.
The direction vector for the second line is $\begin{pmatrix} -1 \\ 1 \end{pmatrix}$ and its magnitude is $\sqrt{(-1)^2 + 1^2} = \sqrt{2}$.
The dot product of the two direction vectors is $(2)(-1) + (1)(1) = -1$.
So the cosine of the angle between the two lines is \[\frac{-1}{\sqrt{5} \sqrt{2}} = -\frac{1}{\sqrt{10}}.\]