What work is required to stretch a spring of spring constant 500N/m from x1=.2m to x2=.25m? Assume the unstreched position is at x=0.

W=Fd
so w=(500)(.25-.2)
=500(.05)
=25J
is this correct?

Calculate the work required to compress an initially uncompressed spring with a spring constant of 25 N/m by 10 cm.

This is the same type of problem so would this be correct:
W=Fd
=25(.1)
=2.5J

No on the first.

If you are in calculus, work= INT fdx=INT kxdx= 1/2 k x^2 eval at the limits .2 to .25
Same thing on the second.

If you are not in calculus, the energy stored in a spring is 1/2 kx^2. You have to evaluate the stored energy at each point, and take the difference.

To calculate the work required to stretch a spring from one position to another, you can use the formula:

W = (1/2)k(x2^2 - x1^2)

where W is the work done, k is the spring constant, x2 is the final position, and x1 is the initial position.

In your first example, you have a spring constant of 500 N/m, initial position x1 = 0.2 m, and final position x2 = 0.25 m. Plugging these values into the formula, we get:

W = (1/2)(500)(0.25^2 - 0.2^2)
= (1/2)(500)(0.0625 - 0.04)
= (1/2)(500)(0.0225)
= 500 * 0.01125
= 5.625 J

So, the correct answer is 5.625 J, not 25 J.

In your second example, you have a spring constant of 25 N/m and a compression distance of 10 cm, which is equal to 0.1 m. Plugging these values into the formula, we get:

W = (1/2)(25)(0.1^2)
= (1/2)(25)(0.01)
= 0.5 J

So, the correct answer for the second example is 0.5 J, not 2.5 J.