I am confused as to when each should be used to solve problems.I am not looking for the answer to this question, but I will include it here so you have all the information about what I am asking about. 

> 
> A 15.0 kg block is attached to a very light horizontal spring of force
>  constant 400.0 N/m and is resting on a frictionless horizontal table.
>  (See (Figure 1) .) Suddenly it is struck by a 3.00 kg stone traveling
>  horizontally at 8.00 m/s to the right, whereupon the stone rebounds at
>  2.00 m/s horizontally to the left. Find the maximum distance that the block will compress the spring after the collision.
> 
> 
> 

I see that the idea suggested [here (at Yahoo Answers)](https://answers.yahoo.com/question/index?qid=20091121153754AAUv9l1) is to use conservation of momentum to solve this problem. But I wanted to solve using conservation of energy in the following way: 

$K.E =\frac{mv^2}{2}$

$Spring-P.E=\frac{kx^2}{2}$

$KE\_i = KE\_f + PE\_f$

$KE\_i - KE\_f = PE\_f$

Solving the equations, you get

$x = 0.670m$

The correct answer given is 0.387m.