Work Done by a Variable Force

MathJax TeX Test Page
The force isn't always constant, so if you're moving an object from a to b, and the force = f(x), then the work required equals
$$\int_{a}^{b}\mathrm{f(x)}\, \mathrm{d}x$$

Compressing a Spring

MathJax TeX Test Page
Hooke's Law states that the force required to compress (or stretch) a spring is proportional to the distance, so $F = kd$.
Now, the question:
$$\text{A force of 5 pounds compresses a 15-inch spring a total of 4 inches. How much work is done in compressing the spring 7 inches?}$$ $$\text{(Sec. 7.7 Problem 9 from Larson Calculus ETF 4e)}$$
$$\text{First, we have to calculate k, so F(4) = 4k = 5, } k = \frac{5}{4}$$
$$F(x) = \frac{5}{4}x$$
$$\text{To find work, we have to take the total Force} \times \text{ distance}$$
$$=\int_{0}^{7}\mathrm{\frac{5}{4}x}\, \mathrm{d}x$$
$$=\frac{5}{8}x^2 |_{0}^{7}$$
$$=\frac{5}{8}*49 = 30.625 \text{ft-lbs}$$

Propulsion

MathJax TeX Test Page
A lunar module weighs 12 tons on the surface of Earth. How much work is done in propelling the module from the surface of the moon to a height of 50 miles? Consider the radius of the moon to be 1100 miles and its force of gravity to be one-sixth that of Earth. (Larson Calculus ETF 4e 7.5 #20)
First, we need to calculate how much it weighs on the moon, which is ${1}{6}*12$ tons $= 2$ tons.
$$\text{The force exerted by gravity varies inversely with the square of the distance from the center of the body,} F(x) = \frac{C}{x^2}$$
$$2 = \frac{C}{1100^2}, C = 2,420,000$$
If you move the module a VERY small amount, it's basically linear, so you could say
$$\Delta{}W = \frac{2,420,000}{x^2}*\Delta{}x$$
You must integrate it with bounds from the center.
$$\int_{1100}^{1150}\mathrm{\frac{2,420,000}{x^2}}\, \mathrm{d}x = -\frac{1,210,000}{x}|_{1100}^{1150} = 95.652 \text{ ton-miles}$$

Lifting a Chain

Let's say you have a 20 foot chain that weighs 5 pounds/foot. How much work is required to raise one end of the chain to a height of 30 feet, so it's 10 feet off the ground.

MathJax TeX Test Page
$$\Delta{}F = \text{weight} = \frac{5 \text{pounds}}{\text{foot}}(\text{length}) = 5\Delta{}y$$
$$\Delta{}W = \Delta{}F * d = 5y\Delta{}y$$
The total work to get to 20 is the sum of all the work increments
$$\int_{0}^{20}\mathrm{5y}\, \mathrm{d}y = \frac{5}{2}y^2 |_{0}^{20} = 1000$$
The last part to get to 30 feet is constant, and it equals
$$100 \text{(weight of the chain)} * 10 = 1000$$
$$\text{The total work equals } 1000 + 1000 = 2000 \text{ft-lbs}$$