A way to get directly to the answer in the book is as follows:
Set the equations equal to each other and simplify:
Let . Thus,
and . To find z we need to sub back into one of the equations; we'll use the first one:
So the (parametric) equation of the line is:
(which, in my opinion, is a better way to write it, because it gives you the direction vector of the line).