cos(a,b) = (a*b) / (|a||b|) where |a| and |b| are the lengths of the vectors and a*b is the dot product of a and b. Cos(a,b) means the angle between vectors a and b.
2) We have vectors c= -i - 2j + 2k and u = -i + wk . The angle wanted here is 45°, and cos (45°) = 1/sqrt(2).
c*u = (-1)(-1) + -2*0 + 2*w = 1 + 2w
|c| = sqrt(1 +4 +4) = sqrt(9) = 3
|u] = sqrt(1² + w²)
Then we use the definition of the dot product cos(a,b) = (a*b) / (|a||b|)
to get an equation where we can solve w:
1/sqrt(2) = (1+2w) / 3*sqrt(1+w²)
And we'll get w = 1 or w = 7.
I can't seem to get 4/3 ( I get -2/3, I might have calculated something wrong) in 1) , but the idea is similar: vectors u and v can only be orthogonal to each other (= the angle between them is 90°) when the dot product u*v = cos(90°) = 0