A 2.70kg mass is pushed against a horizontal spring of force constant 25.0 N/cm on a frictionless air table. The spring is attached to the tabletop, and the mass is not attached to the spring. When the spring has been compressed enough to store 12.0 J of potential energy, the mass is suddenly released from rest. What is the greatest speed the mass reaches?
Conservation of Energy
Hooke's Law (F = -kx)
The Attempt at a Solution
As soon as they put a spring in the conservation of energy problems, I become confused. First, I don't understand why it's 1/2kx^2 (which doesn't apply to this problem I don't think), and second, I have a hard time determining if it's positive or negative. Here is what I come up with for this problem, there are more parts to it and I was hoping that you guys could help me work through my spring-a-phobia.
Edit: I see a mistake already, fixing the image I posted.