When is energy conserved in a collision and not momentum? Consider the following example:

A bullet of mass 45g is fired at a speed of 220 m/s into a 5.0 kg sandbag hanging from a string from the ceiling. The sandbag absorbs the bullet and begins to swing. To what maximum vertical height will it rise? (Assuming negligent air resistance and heat loss due to friction)

The way to solve this would be to calculate the kinetic energy of the bullet and then convert it to gravitational potential energy of the bullet + sandbag.
$$E_{k} = \frac12 * 0.045\,{\rm kg} * (220\,{\rm m/s})^2=1089\,{\rm J}$$
We could then find the gravitational potential energy here by substituting in $E_{p} = E_{k}$.
But, what I'm curious about here is, what would be the speed immediately after the bullet impacts the sandbag? Either the kinetic energy, or the momentum could be conserved, but not both.
$$P = 0.045\,{\rm kg} * 220 \,{\rm m/s} = 9.9 \,{\rm kg} \cdot \,{\rm m/s}$$
Then we find the speed after the collision of the sandbag + bullet to be:
$$9.9 \,{\rm kg} \cdot \,{\rm m/s} = 5.0\,{\rm kg} + 0.045\,{\rm kg} * X \,{\rm m/s}\to 1.96234 \,{\rm m/s} = X$$
So if momentum is conserved then the kinetic energy would be:
$$E_{k} = \frac12(5.0\,{\rm kg} + 0.045\,{\rm kg}) * (1.96324 \,{\rm m/s})^2=9.72\,{\rm J}$$
Should this question specifically state whether momentum or energy was conserved? How can you tell which one will be conserved?
 A: Total momentum is always conserved, in both elastic and inelastic collisions, but total kinetic energy is only conserved in elastic collisions. This example seems to be a completely inelastic collision, because at the end the objects merge. There is a formula to calculate the final velocity $v$ of two object with speed $u_1$ and $u_2$ and mass $m_1$ and $m_2$ in a completely inelastic collision, which is:
$$v=\frac{m_1u_1+m_2u_2}{m_1+m_2}$$
Here's a simple derivation:


*

*since momentum is always conserved, the sum of momenta at the beginning is the same as the end:
$$p_{i1}+p_{i2}=p_{f1}+p_{f2}$$

*However, since this is a completely inelastic collision, at the end the two objects will merge, and so there will be only one final momentum. The final momentum is simply the sum of initial momenta, like final mass is the sum of initial masses:
$$p_{1}+p_{2}=p_f\qquad m_1+m_2=m_f$$

*Then:
$$v=\frac{p_f}{m_f}\qquad v=\frac{p_1+p_2}{m_1+m_2}\qquad v=\frac{m_1u_1+m_2u_2}{m_1+m_2}$$
Total kinetic energy however is not conserved, as you can see summing initial kinetic energies and comparing with the final kinetic energy.
A: No the question does not need to specify that whether kinetic energy or momentum is conserved. It can be mathematically proven that during an ineleastic collision (like the one that happens in your question) mechanical energy is not conserved as it is spent when another body sticks to the target and gets converted into elastic and heat energy.
The lost kinetic energy in case of perfectly ineleastic case is given as 

$\Delta KE = \frac{m_1m_2 {v_0}^2}{2 (m_1 + m_2)} $

Here $m_1$ and $m_2$ are masses of bodies, and $v_o$ is velocity of approach i.e. relative velocity before collison. If you put the values you will find that $1079.286422 J$ energy is getting wasted and therefore finally just after collision the kinetic energy is $9.7135778 J$
A: This is an example of perfectly inelastic collision. In such collisions, relative velocity of separation of the two bodies is 0. (The two bodies stick to each other as if they were a single body and move together with the same velocities).
In such cases, kinetic energy is not conserved. The question need not state whether momentum or kinetic energy is conserved as it can be observed that the collision is perfectly inelastic.
And as pointed out by Kyle, momentum is always conserved when there are no external forces.
