Tutorials › Calculus III › Variable Force Along a Straight Segment

Work and Vector Line Integrals · Tutorial 755 of 999

Variable Force Along a Straight Segment

Parametrize a straight segment from its starting point to its endpoint, then integrate the position-dependent force dotted with the segment’s direction of travel.

Intermediate 10 min read

What You'll Learn

  • Write a straight segment from its initial and terminal position vectors.
  • Set up work as the force evaluated along the path dotted with the velocity vector.
  • Convert the vector dot product into a scalar integral in the parameter.
  • Compute work exactly for position-dependent forces in two and three dimensions.
  • Check the result using component contributions and work units.
  • Recognize why integrating force magnitude alone gives the wrong quantity.

From Constant Force to Variable Force

For a constant force, the work along a straight displacement can be found by taking the dot product of the force with the displacement. When the force depends on position, that single dot product is no longer enough: the force can change from one point of the segment to another.

The central idea is to accumulate the small amounts of work made along the path. At each point, only the component of the force in the direction of motion contributes. Parametrizing the segment lets us express both the changing force and the direction of travel using one variable.

Key idea: Along a straight segment, evaluate the force at each position on the segment, take its dot product with the segment’s displacement vector, and integrate that scalar quantity over the segment parameter.

Parametrizing the Segment

Let \(\mathbf{A}\) be the starting point and \(\mathbf{B}\) the ending point. The straight segment from \(\mathbf{A}\) to \(\mathbf{B}\) has the parametrization

$$ \mathbf{r}(t)=\mathbf{A}+t(\mathbf{B}-\mathbf{A}), \qquad 0\leq t\leq 1. $$

At \(t=0\), this gives \(\mathbf{r}(0)=\mathbf{A}\), and at \(t=1\), it gives \(\mathbf{r}(1)=\mathbf{B}\). The derivative is constant:

$$ \mathbf{r}'(t)=\mathbf{B}-\mathbf{A}. $$

Thus \(\mathbf{r}'(t)\) points in the direction of travel and has the same magnitude as the full displacement. If the position is measured in metres, \(\mathbf{r}'(t)\) has units of metres because \(t\) is dimensionless.

Definition: If \(\mathbf{F}\) is a continuous force field along the segment parametrized by \(\mathbf{r}(t)\), the work done by the force while moving from \(\mathbf{A}\) to \(\mathbf{B}\) is $$ W=\int_0^1 \mathbf{F}(\mathbf{r}(t))\cdot\mathbf{r}'(t)\,dt. $$

The vector \(\mathbf{F}(\mathbf{r}(t))\) is the force at the point reached at parameter value \(t\). The dot product with \(\mathbf{r}'(t)\) extracts the force component in the direction of motion, scaled by the rate of displacement with respect to \(t\). For the straight segment this becomes

$$ W=\int_0^1 \mathbf{F}\bigl(\mathbf{A}+t(\mathbf{B}-\mathbf{A})\bigr) \cdot(\mathbf{B}-\mathbf{A})\,dt. $$

If force is measured in newtons and position in metres, the integrand has units of newton-metres, or joules. The formula requires that the force be defined along the segment and be integrable there; continuity is a standard sufficient condition. The parameter interval runs from the stated starting point to the stated endpoint.

Why the Dot Product Integral Gives Work

The formula follows from adding the work over many short pieces of the motion. For a small displacement \(\Delta\mathbf{r}\), the force is approximately constant over that short piece, so its work is approximately \(\mathbf{F}\cdot\Delta\mathbf{r}\). Partition the parameter interval into small subintervals. On a subinterval of width \(\Delta t\), the segment displacement is exactly \(\mathbf{r}'(t)\Delta t\), since \(\mathbf{r}'(t)=\mathbf{B}-\mathbf{A}\) is constant.

$$ \Delta\mathbf{r}=(\mathbf{B}-\mathbf{A})\Delta t. $$

Choose a sample parameter value \(t_i^*\) in each subinterval. The total approximate work is the sum of the force at the sample points dotted with the corresponding displacements:

$$ \sum_i \mathbf{F}(\mathbf{r}(t_i^*))\cdot \bigl((\mathbf{B}-\mathbf{A})\Delta t\bigr) = \sum_i \left[\mathbf{F}(\mathbf{r}(t_i^*))\cdot(\mathbf{B}-\mathbf{A})\right]\Delta t. $$

As the partition is refined, continuity of the force along the segment makes these Riemann sums converge to the integral of the scalar function \(\mathbf{F}(\mathbf{r}(t))\cdot(\mathbf{B}-\mathbf{A})\). That limit is precisely the work formula. The dot product is essential: it measures the part of the force that contributes to displacement, rather than the total force magnitude.

Worked Examples

Worked Example: A Linear Force Along a Segment in the Plane

Let the force, in newtons, be \(\mathbf{F}(x,y)=(x+2y,\,3x-y)\), where coordinates are measured in metres. Find the work from \(\mathbf{A}=(0,0)\) to \(\mathbf{B}=(2,1)\).

First, compute the displacement:

$$ \mathbf{B}-\mathbf{A}=(2-0,\,1-0)=(2,1). $$

Parametrize the segment and differentiate:

$$ \mathbf{r}(t)=(0,0)+t(2,1)=(2t,t), \qquad \mathbf{r}'(t)=(2,1). $$

Evaluate the force at the position \((2t,t)\):

$$ \mathbf{F}(\mathbf{r}(t)) =(2t+2t,\,3(2t)-t) =(4t,5t). $$

Take the dot product with the direction vector:

$$ \mathbf{F}(\mathbf{r}(t))\cdot\mathbf{r}'(t) =(4t,5t)\cdot(2,1) =8t+5t =13t. $$

Therefore,

$$ W=\int_0^1 13t\,dt =\left[\frac{13}{2}t^2\right]_0^1 =\frac{13}{2}-0 =\frac{13}{2}\text{ J}. $$

As a check, the two force components contribute \(\int_0^1 4t(2)\,dt=4\) J and \(\int_0^1 5t(1)\,dt=\frac{5}{2}\) J. Their sum is \(4+\frac{5}{2}=\frac{13}{2}\) J, agreeing with the dot-product calculation.

Worked Example: A Nonlinear Force Along a Segment

Let \(\mathbf{F}(x,y)=(y,x^2)\) in newtons, with coordinates in metres. Find the work from \(\mathbf{A}=(1,0)\) to \(\mathbf{B}=(3,2)\).

The displacement and segment parametrization are

$$ \mathbf{B}-\mathbf{A}=(3-1,\,2-0)=(2,2), \qquad \mathbf{r}(t)=(1,0)+t(2,2)=(1+2t,2t). $$

The velocity vector with respect to the parameter is

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

Substitute the parametrized coordinates into the force. Its first component is \(y=2t\), and its second component is \(x^2=(1+2t)^2=1+4t+4t^2\). Hence

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

The force component along the displacement is

$$ \begin{aligned} \mathbf{F}(\mathbf{r}(t))\cdot\mathbf{r}'(t) &=(2t,\,1+4t+4t^2)\cdot(2,2)\\ &=4t+2+8t+8t^2\\ &=2+12t+8t^2. \end{aligned} $$

Integrate term by term and evaluate at both endpoints:

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

To check, the first component contributes \(\int_0^1 (2t)(2)\,dt=2\) J. The second contributes \(\int_0^1 (1+4t+4t^2)(2)\,dt=2+4+\frac{8}{3}=\frac{26}{3}\) J. Adding gives \(2+\frac{26}{3}=\frac{32}{3}\) J, as obtained above.

Worked Example: Three Force Components Along a Spatial Segment

Let \(\mathbf{F}(x,y,z)=(2x,-y,3)\) in newtons, with coordinates measured in metres. Find the work from \(\mathbf{A}=(0,0,0)\) to \(\mathbf{B}=(1,2,1)\).

The displacement is \((1,2,1)\), so a parametrization and its derivative are

$$ \mathbf{r}(t)=(t,2t,t), \qquad \mathbf{r}'(t)=(1,2,1), \qquad 0\leq t\leq 1. $$

Along this segment, \(x=t\) and \(y=2t\). Thus the force is

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

The dot product is

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

Consequently,

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

The component contributions give an independent check: the first is \(\int_0^1 2t\,dt=1\) J, the second is \(\int_0^1(-2t)(2)\,dt=-2\) J, and the third is \(\int_0^1 3\,dt=3\) J. Their sum is \(1-2+3=2\) J. The negative contribution is valid: that force component acts partly against the displacement.

A Common Mistake: Integrating Force Magnitude

Work is not generally the integral of the force’s magnitude. Magnitude records the total size of the force, but it does not record how the force is directed relative to the motion. The dot product does.

For a concrete comparison, take \(\mathbf{F}(x,y)=(x,y)\) and move from \((0,0)\) to \((2,1)\). The parametrization is \(\mathbf{r}(t)=(2t,t)\), so \(\mathbf{r}'(t)=(2,1)\) and \(\mathbf{F}(\mathbf{r}(t))=(2t,t)\). A mistaken calculation that integrates the force magnitude with respect to \(t\) gives

$$ \int_0^1\lVert\mathbf{F}(\mathbf{r}(t))\rVert\,dt = \int_0^1\sqrt{(2t)^2+t^2}\,dt = \int_0^1\sqrt{5}\,t\,dt = \frac{\sqrt{5}}{2}. $$

But the correct work uses the dot product with the displacement rate:

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

The two values differ because force magnitude alone does not measure the force component along the motion. For this path, the force points along the segment, so its dot product with the displacement rate is larger than its magnitude by the factor \(\sqrt{5}\).

A Reliable Calculation Process

For a position-dependent force along a straight segment, keeping the geometric and algebraic steps in order prevents most setup errors.

1
Find the displacement.
Subtract the starting point from the endpoint to obtain \(\mathbf{B}-\mathbf{A}\).
2
Parametrize the segment.
Use \(\mathbf{r}(t)=\mathbf{A}+t(\mathbf{B}-\mathbf{A})\) for \(0\leq t\leq1\), then compute \(\mathbf{r}'(t)\).
3
Evaluate the force along the path.
Substitute the coordinate functions from \(\mathbf{r}(t)\) into every component of \(\mathbf{F}\).
4
Take the dot product and integrate.
Form the scalar function \(\mathbf{F}(\mathbf{r}(t))\cdot\mathbf{r}'(t)\), integrate over \(0\leq t\leq1\), and include work units.

This method matters whenever force varies with position: the force sampled at the beginning or end alone cannot generally represent its effect over the whole segment. Integrating the tangential component accounts for that variation while preserving the direction of the motion.

Check Your Understanding

For each question, identify the role of the parametrization, the force evaluation, and the dot product.

  1. Write a parametrization for the segment from \((2,-1)\) to \((5,3)\), and find its derivative.
  2. If \(\mathbf{F}(x,y)=(x,y)\) acts along the segment from \((0,0)\) to \((1,2)\), what scalar function of \(t\) must be integrated to find the work?
  3. Why does the work integrand use a dot product rather than the magnitude of the force?
  4. For \(\mathbf{F}(\mathbf{r}(t))=(1,t)\) and \(\mathbf{r}'(t)=(2,1)\), compute the work on \(0\leq t\leq1\).
  5. What condition on the force along the segment is sufficient to ensure that the work integral exists?