A force of $40 \mathrm{~N}$ is required to hold a spring that has been stretched from its natural length of $10 \mathrm{~cm}$ to a length of $15 \mathrm{~cm}$. How much work is done in stretching the spring from $15 \mathrm{~cm}$ to $18 \mathrm{~cm}$ ?
According to Hooke's Law, the force required to hold the spring stretched $x$ meters beyond its natural length is $f(x)=k x$. When the spring is stretched from $10 \mathrm{~cm}$ to $15 \mathrm{~cm}$, the amount stretched is $5 \mathrm{~cm}=0.05 \mathrm{~m}$. This means that $f(0.05)=40$, so
$$
0.05 k=40 \quad k=\frac{40}{0.05}=800
$$
Thus $f(x)=800 x$ and the work done in stretching the spring from $15 \mathrm{~cm}$ to $18 \mathrm{~cm}$ is
$$
\begin{aligned}
W & \left.=\int_{0.05}^{0.08} 800 x d x=800 \frac{x^2}{2}\right]_{0.05}^{0.08} \\
& =400\left[(0.08)^2-(0.05)^2\right]=1.56 \mathrm{~J}
\end{aligned}
$$