What is the initial velocity of an object, given a change in mass, and an exerted force [closed]

An 8.0-g bullet is shot into a 4.0-kg block, at rest on a frictionless horizontal surface (see the figure). The bullet remains lodged in the block. The block moves into an ideal massless spring and compresses it by 8.7 cm. The spring constant of he spring is 2400 N/m. The initial velocity of the bullet is closest to..."

What I did first was find the amount of force the bullet+block exert on the spring ($208.8 \text{ N}$). I don't know what to do after that. I know I have to find final velocity, and then do $m_1v_1 = (m_1+m_2)v_2$, and solve for $v_1$, but how would I do that? At first I thought I could do $F = ma$, but that didn't work. Then I tried to do $F = \frac{dm}{dt} + \frac{d}{dt}(mv)$, but I don't know the time of the collision, so I wouldn't be able to use that, correct?

closed as off-topic by ACuriousMind♦, Kyle Kanos, John Rennie, Bill N, Ryan UngerOct 26 '15 at 23:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Homework-like questions should ask about a specific physics concept and show some effort to work through the problem. We want our questions to be useful to the broader community, and to future users. See our meta site for more guidance on how to edit your question to make it better" – ACuriousMind, Kyle Kanos, John Rennie, Bill N, Ryan Unger
If this question can be reworded to fit the rules in the help center, please edit the question.

• Note that you appear to try to use Newton's second law in this form: $F = dp/dt$. Two comments for you to keep in mind for the future. First, you did the derivative incorrectly. But more importantly: Newton's second law does not apply to systems whose mass is changing. $dm/dt$ must be zero. This little fact is often not given enough emphasis. – garyp Oct 26 '15 at 14:32
• This is a standard momentum-energy drill problem. Try energy conservation after the collision, and solve the process "backward" (compression, collision, shooting). – Bill N Oct 26 '15 at 20:52

In general, the force on the spring isn't going to be a helpful quantity. However, you can calculate how much energy is stored in the spring when it is compressed. From this energy, you should be able to calculate the energy of the block bullet system after impact, and then the velocity $v_2$.