(a) Since Q is the midpoint of PR, we have:
\(\mathbf{q} = \frac{\mathbf{p} + \mathbf{r}}{2}\)
Solving for \(\mathbf{r}\):
\(2\mathbf{q} = \mathbf{p} + \mathbf{r}\)
\(\mathbf{r} = 2\mathbf{q} - \mathbf{p}\)
(b) The magnitude of the vector \(6\mathbf{i} + a\mathbf{j} + b\mathbf{k}\) is 21, so:
\(6^2 + a^2 + b^2 = 21^2\)
\(36 + a^2 + b^2 = 441\)
\(a^2 + b^2 = 405\)
The vector is perpendicular to \(3\mathbf{i} + 2\mathbf{j} + 2\mathbf{k}\), so:
\(6 \times 3 + a \times 2 + b \times 2 = 0\)
\(18 + 2a + 2b = 0\)
\(2a + 2b = -18\)
\(a + b = -9\)
Substitute \(b = -9 - a\) into \(a^2 + b^2 = 405\):
\(a^2 + (-9-a)^2 = 405\)
\(a^2 + (81 + 18a + a^2) = 405\)
\(2a^2 + 18a + 81 = 405\)
\(2a^2 + 18a - 324 = 0\)
\(a^2 + 9a - 162 = 0\)
Solving the quadratic equation:
\(a = \frac{-9 \pm \sqrt{9^2 + 4 \times 162}}{2}\)
\(a = 9 \text{ or } a = -18\)
Thus, \(b = -18 \text{ or } b = 9\).