Tutorials › Calculus III › Spring Force Work Along Curved Paths

Work and Vector Line Integrals · Tutorial 762 of 999

Spring Force Work Along Curved Paths

Use the spring force law and a path parametrization to compute work, including when the spring’s stiffness varies with position.

Intermediate 10 min read

What You'll Learn

  • Write the Hooke-type force law for a spring with a fixed anchor point.
  • Set up spring work as a vector line integral along a parametrized path.
  • Compute work for a fixed-stiffness spring on a curved two-dimensional path.
  • Handle position-dependent stiffness in two and three dimensions.
  • Check work calculations using signs, units, and endpoint values.

Spring Force Along a Path

A spring force depends on how far an object is displaced from the spring’s anchor point. If the object moves along a curved path, the force may change direction throughout the motion. Work must therefore account for both the force and the direction of each small piece of displacement.

The vector line integral gives a direct way to do this. The same setup works in two or three dimensions, and it can also handle an idealized spring whose stiffness varies with position.

Definition: For a force field \(\mathbf{F}\) and an oriented, piecewise-smooth path \(\mathbf{r}(t)\), \(a\le t\le b\), the work along the path is
$$ W=\int_a^b \mathbf{F}(\mathbf{r}(t))\cdot\mathbf{r}'(t)\,dt. $$
Here, \(\mathbf{r}'(t)\,dt\) represents a small displacement along the path. Work is measured in joules when force is in newtons and distance is in metres.

The Hooke-Type Spring Model

Let \(\mathbf{a}\) be a fixed anchor point and \(\mathbf{r}\) the object’s position. The displacement from the anchor is \(\mathbf{r}-\mathbf{a}\). For a spring with constant stiffness \(k>0\), Hooke’s law in vector form is

$$ \mathbf{F}(\mathbf{r})=-k(\mathbf{r}-\mathbf{a}). $$

The minus sign is essential: the force points back toward the anchor. Stiffness has units of newtons per metre, so multiplying it by a displacement gives a force.

For a position-varying scalar stiffness, we will use the specified force law

$$ \mathbf{F}(\mathbf{r})=-k(\mathbf{r})(\mathbf{r}-\mathbf{a}), $$

where \(k(\mathbf{r})\ge 0\) is a given function with units of newtons per metre. This is an idealized Hooke-type model: the stiffness at the object’s current position multiplies its displacement from the fixed anchor. To compute work, substitute this force and the path into the line integral. Unless the stiffness is constant, do not use the constant-stiffness endpoint formula derived below.

Why the Constant-Stiffness Formula Works

For fixed \(k\), the work on a parametrized path is

$$ W=-k\int_a^b \bigl(\mathbf{r}(t)-\mathbf{a}\bigr)\cdot\mathbf{r}'(t)\,dt. $$

The key observation is that the integrand is related to the rate of change of the squared distance from the anchor. Differentiating that squared distance gives

$$ \frac{d}{dt}\left|\mathbf{r}(t)-\mathbf{a}\right|^2 =2\bigl(\mathbf{r}(t)-\mathbf{a}\bigr)\cdot\mathbf{r}'(t). $$

Substituting this identity into the work integral and applying the one-variable fundamental theorem of calculus yields the result:

Result for constant stiffness: If the spring has fixed anchor \(\mathbf{a}\), constant stiffness \(k\), and the path runs from \(\mathbf{r}(a)\) to \(\mathbf{r}(b)\), then
$$ W=-\frac{k}{2}\left( \left|\mathbf{r}(b)-\mathbf{a}\right|^2 -\left|\mathbf{r}(a)-\mathbf{a}\right|^2 \right). $$
The formula applies to any piecewise-smooth path between those endpoints for this force law.

This result is specific to constant stiffness. If \(k\) varies with position, the work integral contains \(k(\mathbf{r}(t))\) as an additional factor, and the derivation above does not reduce it to the same endpoint expression.

Setting Up the Integral in Components

In two dimensions, write \(\mathbf{r}(t)=(x(t),y(t))\) and \(\mathbf{F}=(F_x,F_y)\). Then the work is

$$ W=\int_a^b \left[ F_x(x(t),y(t))x'(t)+ F_y(x(t),y(t))y'(t) \right]dt. $$

In three dimensions, include the third component as well:

$$ W=\int_a^b \left[ F_xx'+F_yy'+F_zz' \right]dt, $$

where each force component is evaluated along the path. The dot product automatically accounts for how each part of the displacement aligns with the force.

Worked Example: A Constant-Stiffness Spring on a Curved Path

A spring is anchored at the origin, has stiffness \(k=3\ \text{N/m}\), and exerts \(\mathbf{F}(\mathbf{r})=-3\mathbf{r}\). An object follows the curved path \(\mathbf{r}(t)=(t,t^2)\ \text{m}\), for \(0\le t\le1\). Find the work.

First differentiate the path:

$$ \mathbf{r}'(t)=(1,2t)\ \text{m}. $$

The force along the path is

$$ \mathbf{F}(\mathbf{r}(t))=(-3t,-3t^2)\ \text{N}. $$

Take the dot product, showing both component contributions:

$$ \mathbf{F}(\mathbf{r}(t))\cdot\mathbf{r}'(t) =(-3t)(1)+(-3t^2)(2t) =-3t-6t^3. $$

Therefore,

$$ W=\int_0^1(-3t-6t^3)\,dt =\left[-\frac{3}{2}t^2-\frac{3}{2}t^4\right]_0^1 =-\frac{3}{2}-\frac{3}{2} =-3\ \text{J}. $$

Check with the constant-stiffness result. The path begins at the anchor, so its initial squared distance is \(0\). Its final position is \((1,1)\ \text{m}\), with squared distance \(1^2+1^2=2\ \text{m}^2\). Thus \(W=-\frac{3}{2}(2-0)=-3\ \text{J}\), agreeing with the integral.

Position-Varying Stiffness in Three Dimensions

When stiffness varies, evaluate it at each point of the path, then multiply the resulting spring force by the path’s velocity vector in the dot product. The integral still follows the same definition of work; only the force field changes.

Worked Example: Stiffness Varying with the \(x\)-Coordinate

A spring is anchored at the origin and has stiffness \(k(x)=\left(2+\frac{x}{1\ \text{m}}\right)\text{N/m}\). Its force is \(\mathbf{F}=-k(x)\mathbf{r}\). An object follows the three-dimensional path \(\mathbf{r}(t)=(t,t^2,1-t)\ \text{m}\), \(0\le t\le1\). Find the work.

Along the path, \(x=t\ \text{m}\), so the stiffness is \(k=(2+t)\ \text{N/m}\). The path derivative is \(\mathbf{r}'(t)=(1,2t,-1)\ \text{m}\), and the force along the path is

$$ \mathbf{F}(\mathbf{r}(t)) =-(2+t)(t,t^2,1-t)\ \text{N}. $$

Compute the dot product by first evaluating the position-derivative product:

$$ \mathbf{r}(t)\cdot\mathbf{r}'(t) =t+2t^3-(1-t) =2t+2t^3-1. $$

Consequently,

$$ \begin{aligned} W &=-\int_0^1(2+t)(2t+2t^3-1)\,dt\\ &=-\int_0^1(2t^4+4t^3+2t^2+3t-2)\,dt\\ &=-\left[\frac{2}{5}t^5+t^4+\frac{2}{3}t^3+\frac{3}{2}t^2-2t\right]_0^1\\ &=-\left(\frac{2}{5}+1+\frac{2}{3}+\frac{3}{2}-2\right)\text{J}\\ &=-\frac{47}{30}\ \text{J}. \end{aligned} $$

The path begins at \((0,0,1)\ \text{m}\) and ends at \((1,1,0)\ \text{m}\). Both endpoints are one metre from the anchor, but that does not justify using the constant-stiffness formula: the stiffness varies along the route. The integral gives the work for the specified position-dependent force law.

Position-Varying Stiffness in Two Dimensions

A varying stiffness need not depend on the coordinate that changes most rapidly, or on the distance from the anchor. It can be any specified function of position for which the line integral is defined. The next example makes the stiffness depend on the \(y\)-coordinate.

Worked Example: Stiffness Varying with the \(y\)-Coordinate

Let the anchor be the origin and take \(k(y)=\left(1+\frac{y}{1\ \text{m}}\right)\text{N/m}\), with force \(\mathbf{F}=-k(y)\mathbf{r}\). The path is \(\mathbf{r}(t)=(t,t^2)\ \text{m}\), \(0\le t\le1\). Find the work.

On the path, \(y=t^2\ \text{m}\), so \(k=(1+t^2)\ \text{N/m}\). Also, \(\mathbf{r}'(t)=(1,2t)\ \text{m}\), and

$$ \mathbf{r}(t)\cdot\mathbf{r}'(t)=t+2t^3. $$

Thus the force-dot-displacement integrand is \(-(1+t^2)(t+2t^3)\), and

$$ \begin{aligned} W &=-\int_0^1(1+t^2)(t+2t^3)\,dt\\ &=-\int_0^1(t+3t^3+2t^5)\,dt\\ &=-\left[\frac{t^2}{2}+\frac{3t^4}{4}+\frac{t^6}{3}\right]_0^1\\ &=-\left(\frac{1}{2}+\frac{3}{4}+\frac{1}{3}\right)\text{J}\\ &=-\frac{19}{12}\ \text{J}. \end{aligned} $$

Substituting \(t=1\) gives \(1/2+3/4+1/3=6/12+9/12+4/12=19/12\); the lower endpoint contributes zero. Hence the work is \(-19/12\ \text{J}\). The negative sign is consistent with the spring’s restoring force opposing the net outward motion in this example.

A Common Error: Omitting a Force Component

In the first worked example, it would be incorrect to use only the \(x\)-component of force and write \(W=\int_0^1(-3t)(1)\,dt=-3/2\ \text{J}\). The path also changes in the \(y\)-direction, so the force component \(-3t^2\) contributes through \(y'(t)=2t\). The correct integrand is \((-3t)(1)+(-3t^2)(2t)=-3t-6t^3\), giving \(-3\ \text{J}\).

Another useful check is the sign. A spring pulls toward its anchor, but its work is not automatically negative: the object could move toward the anchor, in which case the force can assist its motion. Use the dot product, rather than deciding the sign from the word “spring.”

Procedure for a Spring Work Integral

1
Specify the force law.
Identify the anchor, stiffness, and whether stiffness is constant or depends on position.
2
Parametrize the oriented path.
Write \(\mathbf{r}(t)\) on the correct parameter interval and calculate \(\mathbf{r}'(t)\).
3
Evaluate force along the path.
Substitute \(\mathbf{r}(t)\) into the spring force, including any position-dependent stiffness.
4
Take the dot product and integrate.
Keep every coordinate contribution, then use the given parameter limits.
5
Check the result.
Confirm the units and sign; for constant stiffness, compare with the squared-distance formula.

Why the Path and Force Law Both Matter

The work integral combines the force at each location with the direction of motion there. A curved path can change both the force and the direction of displacement, so a calculation must use the full parametrization rather than only the endpoints. For a fixed-stiffness spring, the squared-distance derivation gives a convenient check and shows why different paths with the same endpoints yield the same work for this particular force. With position-varying stiffness, compute the prescribed integral instead; do not assume that the same endpoint formula applies.

Check Your Understanding

For each question, identify the force law and the path information needed before calculating.

  1. For a spring anchored at \(\mathbf{a}\) with constant stiffness \(k\), what direction does \(-k(\mathbf{r}-\mathbf{a})\) point?
  2. Write the work integral for a three-dimensional parametrized path \(\mathbf{r}(t)=(x(t),y(t),z(t))\).
  3. Why can the constant-stiffness squared-distance formula not automatically be used when \(k\) depends on position?
  4. For \(\mathbf{r}(t)=(t,t^2)\), what is \(\mathbf{r}'(t)\), and what is \(\mathbf{r}(t)\cdot\mathbf{r}'(t)\)?
  5. In the first worked example, what contribution is lost if the \(y\)-component of force is omitted?