You have found the dot product x.d correctly. But the answer to the question should be a vector, not a scalar. The component of A in the direction of B is the vector (x.d)d (its magnitude is x.d and its direction is given by the direction of d). So the answer should be .