To find the angle between two vectors \( \mathbf{a} \) and \( \mathbf{b} \), we use the formula:
\[
\cos \theta = \frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}| |\mathbf{b}|}
\]
Where:
- \( \theta \) is the angle between the vectors
- \( \mathbf{a} \cdot \mathbf{b} \) is the dot product of the vectors
- \( |\mathbf{a}| \) and \( |\mathbf{b}| \) are the magnitudes of the vectors.
Step 1: Compute the dot product \( \mathbf{a} \cdot \mathbf{b} \)
Given vectors:
\[
\mathbf{a} = \hat{i} + \hat{j} - 2\hat{k}, \quad \mathbf{b} = 3\hat{i} - \hat{j} + 2\hat{k}
\]
The dot product is:
\[
\mathbf{a} \cdot \mathbf{b} = (1 \times 3) + (1 \times -1) + (-2 \times 2)
\]
\[
\mathbf{a} \cdot \mathbf{b} = 3 - 1 - 4 = -2
\]
Step 2: Compute the magnitudes of \( \mathbf{a} \) and \( \mathbf{b} \)
The magnitude of vector \( \mathbf{a} \) is:
\[
|\mathbf{a}| = \sqrt{1^2 + 1^2 + (-2)^2} = \sqrt{1 + 1 + 4} = \sqrt{6}
\]
The magnitude of vector \( \mathbf{b} \) is:
\[
|\mathbf{b}| = \sqrt{3^2 + (-1)^2 + 2^2} = \sqrt{9 + 1 + 4} = \sqrt{14}
\]
Step 3: Calculate the angle \( \theta \)
Now, we can find \( \cos \theta \):
\[
\cos \theta = \frac{-2}{\sqrt{6} \times \sqrt{14}} = \frac{-2}{\sqrt{84}} = \frac{-2}{2\sqrt{21}} = \frac{-1}{\sqrt{21}}
\]
Thus, \( \theta = \cos^{-1}\left(\frac{-1}{\sqrt{21}}\right) \).
By calculating the inverse cosine, we get:
\[
\theta \approx 60^\circ
\]
Thus, the angle between the vectors is \( 60^\circ \).