Sub topic 3
Hooke's law for springs
Prerequisites and scope
This chapter assumes you know Newton's second law (F = ma), can read a vector sign convention along one axis, and are comfortable with basic energy ideas. It follows the chapter on restoring forces and equilibrium. It stops before the SHM equation itself, which is the next step. Here the goal is to state Hooke's law precisely, measure the spring constant, and know where the law stops being true.
The law
A spring has a natural length, the length it has when nothing pulls or pushes on it. If you stretch or compress it by a small amount, it pushes back toward that length. Hooke's law says the push is proportional to the displacement:
F = -k x
Here x is the displacement of the free end from its natural position, measured along the spring's axis. F is the force the spring exerts on whatever is attached to it. k is the spring constant, in newtons per metre (N/m). The minus sign says the force points opposite to the displacement.
The sign is the whole point. Pull the end to x > 0 and the force is negative, back toward x = 0. Push it to x < 0 and the force is positive, again back toward x = 0. This is a restoring force, and because its size grows linearly with |x|, it is the kind of force that produces simple harmonic motion.
What k means
k measures stiffness. A spring with k = 200 N/m needs 200 N to stretch it by one metre, or 2 N to stretch it by one centimetre. A larger k means a stiffer spring.
Two points are easy to miss:
- k belongs to the spring, not to the mass attached to it. It depends on the wire material, wire diameter, coil radius, and number of coils.
- For a given spring, k is the same for stretching and compressing, as long as the spring stays in its linear range.
Force by the spring versus force on the spring
Two forces are in play. The spring pulls on the mass with F = -kx. The hand or weight that stretches the spring exerts F = +kx on the spring when it holds the spring still. Keeping track of which one you mean avoids sign errors later. In a free-body diagram for the attached mass, use the force the spring exerts on the mass: -kx.
A worked measurement
You can find k from a static experiment. Hang a spring vertically and add a known mass. At rest, the net force is zero, so the spring force balances the weight:
k Δx = m g
where Δx is the extra stretch caused by the mass. The following code fits k from several measurements, using a least-squares line through the origin.
g = 9.81 # m/s^2
masses = [0.100, 0.200, 0.300, 0.400] # kg
stretches = [0.049, 0.099, 0.147, 0.197] # m, measured extension
forces = [m * g for m in masses]
# Least-squares slope for F = k * x (line through the origin)
k = sum(f * x for f, x in zip(forces, stretches)) / sum(x * x for x in stretches)
print(f"k = {k:.2f} N/m")The slope of force against extension is k. Fitting through the origin is justified here because zero extension must give zero force. If your data show a clear intercept, you probably measured the extension from the wrong reference length, or the spring was pre-loaded (see the edge cases below).
Elastic potential energy
Hooke's law implies a potential energy. The work you do to stretch a spring from 0 to x is the area under the F = kx line:
U = ∫₀ˣ k x′ dx′ = ½ k x²
The energy is quadratic in x. Doubling the stretch quadruples the stored energy. This formula returns in the energy chapter, where it trades off with kinetic energy. For now, note that U is always zero or positive and is zero only at the natural length.
Why a linear force law is so common
Most smooth restoring forces are approximately linear for small displacements. If a force F(x) is zero at equilibrium and varies smoothly, a Taylor expansion gives
F(x) ≈ F′(0) x + ½ F″(0) x² + …
For small x the first term dominates. Setting k = -F′(0) recovers Hooke's law. This explains why the same mathematics shows up for springs, pendulums, molecules, and bridges. It also tells you where to expect failure: when x is large enough that the quadratic term matters.
Where Hooke's law fails
Hooke's law is a model with a limited range. The common failure modes:
- Elastic limit. Stretch a spring far enough and the wire deforms permanently. After that, the spring does not return to its original length, and F = -kx no longer describes it.
- Nonlinear region. Before the elastic limit, a real spring can already show a force that grows faster or slower than linear. Some springs stiffen as they extend, and some soften.
- Coil contact. A compression spring has a minimum length when its coils touch. Below it, the force rises very steeply, so a linear model underestimates it.
- Pre-tension. Many extension springs are wound with their coils pressed together, so they need a minimum force before they start to extend. The force law is then F = F₀ + kx for x > 0, not a pure proportion. Your plot of F against x has a nonzero intercept.
- Spring mass. The model treats the spring as massless. For a real spring, part of its own mass moves, which slightly changes the dynamics. The approximation is good when the spring mass is much smaller than the attached mass.
- Non-axial motion. Hooke's law as written is one-dimensional. Large sideways motion, buckling of long compression springs, and twisting all involve other forces.
| Situation | Effect on F versus x | Consequence |
|---|---|---|
| Small stretch, ideal spring | Straight line through origin | Hooke's law holds |
| Pre-tensioned extension spring | Line with nonzero intercept | Fit F₀ + kx, not kx |
| Stiffening spring | Curve bends upward | Effective k grows with x |
| Beyond elastic limit | Permanent set | Law fails entirely |
Checking linearity in code
The test of Hooke's law is whether force over extension stays constant. The code below flags the stiffening of a spring whose force has a small cubic term.
def force(x, k=50.0, c=2000.0):
"""Spring force magnitude with a small nonlinear stiffening term."""
return k * x + c * x**3
for x in (0.01, 0.05, 0.10, 0.20):
effective_k = force(x) / x
print(f"x = {x:.2f} m: F = {force(x):6.3f} N, F/x = {effective_k:6.2f} N/m")At x = 0.01 m, F/x is about 50.2 N/m, almost the linear value. At x = 0.20 m, it is 130 N/m. The same spring behaves as Hooke's law spring at small displacements and as a much stiffer one at large displacements. A constant ratio F/x is the practical signature of the linear range.
Unit and sign checks
When you use Hooke's law in a problem, run these checks:
- k has units N/m, which equal kg/s². If your k has other units, you have converted something wrongly. Centimetres are the usual culprit.
- Choose the positive direction first, then write F = -kx with that choice. Flipping the axis flips the sign of x but not the form of the law.
- Measure x from the natural length for a horizontal spring. For a vertical spring with a hanging mass, the equilibrium position moves, and the next chapters on vertical springs handle it. Do not mix the two reference points in one equation.
Summary of the working model
- F = -kx: the force is proportional to displacement and opposite in direction.
- k in N/m measures stiffness and belongs to the spring.
- U = ½kx² is the stored energy.
- The law is a small-displacement approximation, and real springs deviate from it near their limits.
Exercise
A spring hangs vertically. Adding a 0.250 kg mass stretches it by 0.050 m once the mass is at rest. (a) What is k? (b) How much extra force is needed to stretch the same spring a further 0.020 m? (c) How much elastic energy is stored in that further stretch alone, measured from the 0.050 m position? Use g = 9.81 m/s².
Show answer
(a) At rest kΔx = mg, so k = (0.250 × 9.81) / 0.050 = 49.05 N/m, about 49 N/m. (b) The extra force is kΔx = 49.05 × 0.020 = 0.981 N, about 0.98 N. (c) The energy is the difference ½k(0.070²) − ½k(0.050²) = ½ × 49.05 × (0.0049 − 0.0025) = 0.0589 J, about 0.059 J. This is the change in the spring's elastic energy alone, and it is not the same as ½k(0.020²), which would be 0.0098 J, because the energy depends on the total stretch from the natural length.
Exercise
A student plots force against extension for an extension spring and gets a straight line that crosses the force axis at 0.8 N instead of passing through the origin. Name the likely cause and say what model should be fitted.
Show answer
The spring is pre-tensioned: its coils were wound pressed together, so it needs about 0.8 N before it starts to extend. Fit F = F₀ + kx with F₀ ≈ 0.8 N. The slope of the line is still k, and Hooke's law applies to the force above the initial tension.