ï»¿ >> So here's a spring. I've got a box on it at X equals zero. And let's stretch it out to a position X equals A. And we know to do this we have too apply some force. We have to pull on that box to the right to get it to stretch out that distance delta X. So, we can't just write this. Work is not F pull cosine theta delta X. Why can't we do that? We can't do that because as you pull on the spring it gets harder and harder to pull on the spring. Okay, the force varies as you go. And so we can't just write that, we have to in fact do the integral. Okay, where this is our good old dot product right there. Alright. Let's do the integral. So we've got integral of F pull cosine theta D X. But we know that F pull just has to be as big as the spring force itself; KX . And so this whole thing becomes integral of KX cosine of the angle between them. What's the angle between F pull and delta X? Zero. Cosine of zero is 1. And so we get work is equal to the integral of KX DX . And we've gone from X equals zero to X equals A. K is a constant so that comes out in front of the integral. We know how to integrate XDX, we just get X squared over 2. We're going to evaluate that between zero and A. The zero is going to go away and we just get 1 half KA squared. That was the work that you did stretching out the spring and therefore it is also the stored energy in the spring. And you did work stretching it out, which means that energy had to go somewhere. Where did it go? It went into the stretched spring itself. And we know what this is in general, the work is 1 half KX squared. Alright. And we saw that before. That's the energy in a spring. Where did it come from? It came from doing this integral. That's how you end up with the X squared over 2.