How do I find a vector which is along the direction of another vector? Can I just make it a scalar multiple of the given vector?
To be precise, the question gives two vectors, $a=[1,1,2]^T$ and $b=[1,2,5]^T$, and asks to express $b=\alpha+\beta$, where $\alpha$ is along the direction of $a$, while $\beta$ is orthogonal to $a$.
What I attempted was make $\alpha=ca$, where $c$ is a constant, since it is in the same direction? And then to obtain $\beta$, I calculated $a\cdot\beta=0$. But there are many possible vectors for $\beta$. Which vector should I use? I picked a couple random ones but couldn't find any which works. So now I'm stuck. How do I solve this? Thanks.
You are on the right track. Let the vector $\beta$ be $[x,y,z]^T$ and the vector $\alpha$, as you correctly figured out is $[c,c,2c]^T$. So you have the vector equality $$[1,2,5]^T = [c,c,2c]^T + [x,y,z]^T$$
Also, as you have mentioned $a \cdot \beta = 0 \implies x+y+2z=0 \ \ \ \ \ -----------(1)$.
And from the vector equality mentioned above, you have
$$1 = c+x \ \ \ \ \ -----------(2)$$ $$2 = c+ y \ \ \ \ \ -----------(3)$$ $$5 = 2c+z \ \ \ \ \ -----------(4)$$
There are $4$ unknowns $x,y,x,c$ and $4$ relations, can you solve the system to get the answer?