To find the unit vector \( \hat{u} \) in the direction of a given vector \( \mathbf{u} \), we use the formula:
\( \hat{u} = \frac{\mathbf{u}}{|\mathbf{u}|} \)
In this case, the vector \( \mathbf{u} \) is given as \( -\mathbf{i} + 2\mathbf{j} \), which can also be expressed as \( -1\mathbf{i} + 2\mathbf{j} \). To calculate the unit vector, we first need to determine the magnitude of \( \mathbf{u} \).
The magnitude \( |\mathbf{u}| \) is calculated using the formula:
\( |\mathbf{u}| = \sqrt{x^2 + y^2} \)
Here, the x-component is \(-1\) and the y-component is \(2\). Thus, we compute:
\( |\mathbf{u}| = \sqrt{(-1)^2 + (2)^2} = \sqrt{1 + 4} = \sqrt{5} \)
Now that we have the magnitude, we can substitute it back into the unit vector formula:
\( \hat{u} = \frac{-1\mathbf{i} + 2\mathbf{j}}{\sqrt{5}} \)
This simplifies to:
\( \hat{u} = \left(-\frac{1}{\sqrt{5}}\right)\mathbf{i} + \left(\frac{2}{\sqrt{5}}\right)\mathbf{j} \)
To eliminate the square root in the denominator, we rationalize it by multiplying the numerator and denominator by \( \sqrt{5} \):
\( \hat{u} = \left(-\frac{1 \cdot \sqrt{5}}{5}\right)\mathbf{i} + \left(\frac{2 \cdot \sqrt{5}}{5}\right)\mathbf{j} \)
Thus, the final expression for the unit vector \( \hat{u} \) is:
\( \hat{u} = -\frac{\sqrt{5}}{5}\mathbf{i} + \frac{2\sqrt{5}}{5}\mathbf{j} \)
This result represents the unit vector in the direction of the original vector \( \mathbf{u} \).