I have a rather straightforward Physics problem to solve, only I can't for the life of me simplify the answer to what it needs to be. What am I doing wrong?

$\displaystyle

v_1=\frac{m}{m+M}v_o

$

$\displaystyle \frac{1}{2}mv_o^2=\frac{1}{2}mv_1^2+\frac{1}{2}Mv_ 1^2+\frac{1}{2}kd^2$

The answer is in the form $\displaystyle d=$ and it's a simplification of the information I provided here in the post.

I get as far as $\displaystyle d=\sqrt{\frac{1}{k}(mv_o^2-(m+M)v_1^2)}$

The book plugs in $\displaystyle v_1$

and simplifies to $\displaystyle d=\sqrt{\frac{mM}{k(m+M)}}\times{v_o}$

How?