Physics Library
 An open source physics library
Encyclopedia | Forums | Docs | Random |  
Login
create new user
Username:
Password:
forget your password?
Main Menu
Sections

Meta

Talkback

Downloads

Information
[parent] example of line integral (Example)

Line Integral in Physics: Examples and Complete Worked Solutions

This companion entry develops the ideas from Line Integral in Physics: Curves, work, Circulation, and Path Dependence through a sequence of worked physics problems. The examples begin with curve geometry and scalar line integrals, then progress to mechanical work, path dependence, conservative fields, circulation, Stokes’ theorem, generalized coordinates, and electromagnetic applications [1, 2, 3, 4].

All exercises are stated first. Complete worked solutions follow afterward so that the first half can be used as a problem set without revealing the derivations immediately.

Part I: Exercises

Exercise 1: arc length of a straight path

A particle moves along the parameterized curve

r(t) = 3tex + 4tey,    0 ≤ t ≤ 1.
(1)

Find the arc length of the path using

     ∫
L  =    ds.
      C
(2)

Exercise 2: a scalar line integral on a quarter circle

Let C be the quarter circle of radius R in the first quadrant,

r(𝜃) = R cos𝜃 e + R  sin 𝜃e ,     0 ≤ 𝜃 ≤ π-.
               x          y              2
(3)

Evaluate

    ∫

I =    x ds.
     C
(4)

Then evaluate the result for R = 2 m.

Exercise 3: mass of a nonuniform curved wire

A thin wire forms the same quarter circle of radius R. Its linear mass density is

λ(𝜃) = λ0(1 + sin 𝜃).
(5)

Find its total mass.

PIC

Figure 2. Geometry for Exercise 3. The wire density varies with angular position while ds = Rd𝜃.

Exercise 4: work done by a constant force

A constant force

F  = 2ex − ey + 3ez  N
(6)

moves a particle from

rA = ex + 2ez   m
(7)

to

rB  = 4ex + 2ey + ez  m.
(8)

Find the work. Does the result depend on the path?

Exercise 5: work by a position-dependent force along a straight path

In the plane, let

F(x,y) = 2xex +  3yey.
(9)

The particle follows

r(t) = tex + 2tey,    0 ≤ t ≤ 1.
(10)

Evaluate

      ∫
W  =     F ⋅ dr.
       C
(11)

Exercise 6: work along a curved path

Let

F(x,y ) = yex + xey.
(12)

A particle moves along the parabola

r(t) = tex + t2ey,     0 ≤ t ≤ 1.
(13)

Find the work. Then identify a scalar potential Φ such that F = ∇Φ and verify the same answer from the endpoints.

Exercise 7: path dependence between the same endpoints

Consider

F(x, y) = − yex + xey.
(14)

Two paths connect A = (0, 0) to B = (1, 1).

Path C1 goes first from (0, 0) to (1, 0) and then to (1, 1). Path C2 goes first from (0, 0) to (0, 1) and then to (1, 1).

Evaluate the line integral along each path and show explicitly that the field is path dependent.

PIC

Figure 3. Two piecewise paths for Exercise 7. The vector field produces different work between the same endpoints.

Exercise 8: conservative field and the potential shortcut

Let

                    2
F(x,y ) = 2xyex + (x +  2y)ey.
(15)

Show that the field is conservative by finding a scalar potential Φ. Then calculate the work from (0, 0) to (2, 1) without choosing a path. Finally verify the result along the straight path

r(t) = 2tex + tey,    0 ≤ t ≤ 1.
(16)

Exercise 9: gravity along a helical path

Near Earth’s surface take

F  = − mge  .
           z
(17)

A particle travels along the helix

                              (        )
                                    2𝜃
r(𝜃) = R cos𝜃 ex + R sin 𝜃ey +   5 − -π-  ez,
(18)

with 0 ≤ 𝜃 ≤ 2π, where lengths are measured in meters. Find the work done by gravity. Explain why the radius R does not affect the answer.

Exercise 10: circulation around a circle

For

F(x, y) = − yex + xey,
(19)

evaluate the counterclockwise circulation around the circle

 2    2     2
x  + y  = R  .
(20)

Exercise 11: curl-free locally but nonzero circulation

Consider the field

            − y           x
F (x,y) = --2----2ex + -2----2ey,
          x  + y       x  + y
(21)

defined away from the origin. Evaluate its counterclockwise line integral around a circle of radius R centered at the origin. Explain why the result does not contradict the fact that the curl vanishes away from the origin.

Exercise 12: direct verification of Stokes’ theorem

Let

F (x,y,z) = − y-e +  xe .
              2  x   2 y
(22)

Let C be the counterclockwise boundary of the disk x2 + y2 ≤ R2 in the xy plane, viewed from +z. Compute

∮
   F ⋅ dr
  C
(23)

directly and compare it with

∫
  (∇ ×  F) ⋅ ez dS.
 S
(24)

PIC

Figure 4. Stokes’ theorem for Exercise 12. Boundary circulation equals the flux of curl through the spanning disk.

Exercise 13: reparameterization of the same curve

Let

F(x,y ) = xex + yey.
(25)

The geometric curve is the parabola y = x2 from (0, 0) to (1, 1).

First use

               2
r(u) = uex + u ey,     0 ≤ u ≤  1.
(26)

Then describe the same curve by

r(v) = v2ex + v4ey,    0 ≤  v ≤ 1.
(27)

Evaluate the line integral in both parameterizations and verify that the results agree.

Exercise 14: generalized force for a pendulum

A pendulum bob of mass m and fixed length ℓ has position

r(𝜃) = ℓsin 𝜃ex − ℓcos 𝜃ey.
(28)

Gravity is

F  = − mgey.
(29)

Find the generalized force

Q 𝜃 = F ⋅ ∂r.
          ∂𝜃
(30)

Then find the work done by gravity as the bob moves from 𝜃1 to 𝜃2. Evaluate the special case 𝜃1 = 0 and 𝜃2 = π∕2.

Exercise 15: electromotive-force style circulation

An Electric Field in the plane is

E (x,y) = − αyex + αxey,
(31)

where α is a constant. Find the counterclockwise line integral

     ∮
ℰ =     E ⋅ dl
      C
(32)

around a circle of radius a. Verify the result using Stokes’ theorem.

Exercise 16: synthesis problem on a helical path

A particle moves along

r(ϕ) = acos ϕe  + a sin ϕ e +  bϕe ,     0 ≤ ϕ ≤ 2 π.
               x          y       z
(33)

It experiences the force field

F =  κ(− ye  + xe ) + F e .
           x     y     0 z
(34)

Derive the work done over one turn of the helix. Then evaluate the result for

a = 2 m,     b = 0.5 m,     κ = 3 N∕m,      F0 = 4 N.
(35)

Interpret the two contributions to the work.

Part II: Complete Worked Solutions

Solution 1: arc length of a straight path

Differentiate the position:

dr
---= 3ex +  4ey.
dt
(36)

Therefore

|   |
|dr |  √ -------
||---|| =  32 + 42 = 5.
 dt
(37)

The arc-length element is

ds = 5 dt.
(38)

Hence

     ∫
       1
L  =     5dt = 5.
      0
(39)

Thus the path length is

L  = 5m.
(40)

The result is simply the length of the straight displacement vector from (0, 0) to (3, 4).

Solution 2: a scalar line integral on a quarter circle

For

r (𝜃) = R cos 𝜃ex + R sin 𝜃ey,
(41)

we have

dr- = − R sin 𝜃e  + R cos 𝜃e .
d 𝜃             x          y
(42)

Its magnitude is

|  |
||dr||
|d𝜃| = R,
(43)

so

ds = R d𝜃.
(44)

Also

x = R cos 𝜃.
(45)

Therefore

     ∫ π∕2

I =   0   (R  cos𝜃)R d𝜃.
(46)

Thus

      2     π∕2     2
I = R  [sin 𝜃]0   = R  .
(47)

For R = 2 m,

I = 4 m2.
(48)

Solution 3: mass of a nonuniform curved wire

The mass is

      ∫
M  =     λds.
       C
(49)

For the quarter circle,

ds = R d𝜃.
(50)

Therefore

         ∫
            π∕2
M  = λ0R      (1 + sin𝜃) d𝜃.
           0
(51)

The first part gives π∕2, while

∫
  π∕2
     sin 𝜃d𝜃 = 1.
 0
(52)

Hence

          (π-    )
M  = λ0R   2 +  1  .
(53)

The result has units of mass because λ0 has units of mass per length and R has units of length.

Solution 4: work done by a constant force

For a constant force,

W  =  F ⋅ (rB − rA).
(54)

The displacement is

rB − rA = 3ex +  2ey − ez  m.
(55)

Therefore

W   = (2)(3) + (− 1)(2) + (3)(− 1).
(56)

Thus

W  =  1J.
(57)

Because F is constant, the integral depends only on the net displacement, not on the path taken between the endpoints.

Solution 5: work by a position-dependent force along a straight path

The path is

x = t,     y = 2t.
(58)

Thus

F(r(t)) = 2tex + 6tey.
(59)

Also

dr
---= ex + 2ey.
dt
(60)

Hence

F ⋅ dr = 2t + 12t = 14t.
    dt
(61)

Therefore

     ∫  1
W  =     14tdt = 7.
       0
(62)

So the work is

W  =  7
(63)

in the appropriate energy units for the stated force and coordinates.

Solution 6: work along a curved path

Along the parabola,

x = t,     y = t2.
(64)

Therefore

      2
F =  t ex + tey.
(65)

The tangent vector is

dr
---=  ex + 2tey.
dt
(66)

Hence

    dr
F ⋅ ---= t2 + 2t2 = 3t2.
    dt
(67)

Thus

      ∫ 1  2
W  =     3t dt = 1.
       0
(68)

Now observe that

Φ (x,y) = xy
(69)

has gradient

∇ Φ = yex +  xey = F.
(70)

The endpoints are (0, 0) and (1, 1), so

W  = Φ (1, 1) − Φ (0,0) = 1 − 0 = 1.
(71)

The direct line integral and the potential difference agree.

Solution 7: path dependence between the same endpoints

For C1, the first segment lies along y = 0. There

F  = xey,
(72)

while dr = dxex, so the dot product is zero.

On the second segment, x = 1 and

dr = dy ey.
(73)

The field is

F =  − yex + ey.
(74)

Therefore

F ⋅ dr = dy.
(75)

Hence

∫           ∫  1

 C  F ⋅ dr =  0 dy = 1.
   1
(76)

For C2, the first vertical segment has x = 0, so F = −yex and its dot product with dy ey vanishes.

On the top horizontal segment, y = 1 and

dr = dx ex.
(77)

Thus

F =  − ex + xey
(78)

and

F ⋅ dr = − dx.
(79)

Therefore

∫
   F  ⋅ dr = − 1.
 C2
(80)

The two answers differ:

1 ⁄= − 1.
(81)

The field is path dependent. The difference is

1 − (− 1) = 2,
(82)

which is the counterclockwise circulation around the unit square formed by C1 followed by −C2.

Solution 8: conservative field and the potential shortcut

We seek Φ satisfying

∂Φ-
∂x =  2xy.
(83)

Integrating with respect to x gives

      2
Φ =  x y + g(y).
(84)

Differentiate with respect to y:

∂Φ     2    ′
---=  x +  g(y).
∂y
(85)

Comparing with the given y component,

x2 + g ′(y) = x2 + 2y.
(86)

Thus

g ′(y) = 2y,
(87)

so we may choose

Φ =  x2y + y2.
(88)

The endpoint method gives

W  = Φ (2, 1) − Φ (0,0) = 4 + 1 = 5.
(89)

For the straight path x = 2t, y = t,

F  = 4t2ex + (4t2 + 2t)ey.
(90)

Also

dr-= 2e  + e .
dt     x    y
(91)

Therefore

   dr-      2
F ⋅dt = 12t  + 2t.
(92)

Hence

     ∫ 1
W  =    (12t2 + 2t)dt = 4 + 1 = 5.
      0
(93)

The explicit path calculation agrees with the potential shortcut.

Solution 9: gravity along a helical path

Only the z component matters because

F  = − mgez.
(94)

From the path,

           2𝜃-
z(𝜃) = 5 − π .
(95)

Thus

dz      2
---= − --.
d𝜃     π
(96)

Therefore

                (    )
   dr-              2-    2mg--
F ⋅d 𝜃 = (− mg )  − π   =   π  .
(97)

The work is

     ∫  2π2mg
W  =      -----d𝜃 = 4mg.
       0    π
(98)

The helix drops from z = 5 m to z = 1 m, a vertical drop of 4 m. Since gravity is conservative, horizontal motion and the radius R do not change the work.

Solution 10: circulation around a circle

Parameterize the circle by

r (𝜃) = R cos 𝜃ex + R sin 𝜃ey,
(99)

with 0 ≤ 𝜃 ≤ 2π. Then

dr- = − R sin 𝜃ex + R cos 𝜃ey.
d 𝜃
(100)

Along the circle,

F = − R sin𝜃 e  + R cos𝜃 e .
              x           y
(101)

Thus

    dr-    2
F  ⋅d𝜃 = R  .
(102)

Therefore

∮          ∫ 2π
   F ⋅ dr =     R2 d𝜃 = 2πR2.
 C          0
(103)

Solution 11: curl-free locally but nonzero circulation

On the circle,

x = R cos 𝜃,    y = R sin 𝜃.
(104)

The field becomes

F = − sin-𝜃ex + cos𝜃-ey.
        R        R
(105)

Also

dr-
d𝜃 = − R sin𝜃ex + R cos 𝜃ey.
(106)

Their dot product is

    dr
F ⋅ ---= 1.
    d𝜃
(107)

Hence

∮           ∫
              2π
   F  ⋅ dr =    d 𝜃 = 2π.
  C          0
(108)

The result is independent of R.

The curl vanishes everywhere the field is regular, but the origin is excluded from the domain. A loop surrounding the origin cannot be continuously contracted to a point without passing through the singularity. The region is therefore not simply connected, so local curl-free behavior does not imply global path independence.

Solution 12: direct verification of Stokes’ theorem

On the boundary circle,

x = R cos 𝜃,    y = R sin 𝜃.
(109)

The field is

       R-          R-
F  = − 2 sin𝜃 ex + 2 cos 𝜃ey.
(110)

The tangent is

dr
--- = − R sin 𝜃ex + R cos 𝜃ey.
d 𝜃
(111)

Therefore

    dr-  R2-
F ⋅ d𝜃 =  2 .
(112)

Thus

∮          ∫  2πR2
   F ⋅ dr =     ---d 𝜃 = πR2.
 C           0   2
(113)

Now calculate the curl. Since

Fx = − y,     Fy =  x,
       2            2
(114)

the z component is

                  (    )
∂Fy-   ∂Fx-   1-      1-
∂x  −  ∂y  =  2 −   − 2   = 1.
(115)

Therefore

∇ × F  = ez.
(116)

The surface integral is simply the disk area:

∫                   ∫
  (∇  × F ) ⋅ ez dS =  dS =  πR2.
 S                   S
(117)

The boundary and surface calculations agree exactly.

Solution 13: reparameterization of the same curve

Using u,

r(u ) = uex + u2ey.
(118)

Thus

F =  ue  + u2e
       x      y
(119)

and

dr-
du =  ex + 2uey.
(120)

The integrand is

u + 2u3.
(121)

Hence

    ∫
       1       3       1-  1-
I =     (u + 2u  )du =  2 + 2 = 1.
      0
(122)

Using v,

r(v) = v2ex + v4ey.
(123)

Then

F = v2ex + v4ey
(124)

and

dr- = 2ve  + 4v3e .
dv       x        y
(125)

Thus the integrand is

2v3 + 4v7.
(126)

Therefore

    ∫  1
I =     (2v3 + 4v7 )dv = 1-+ 1-= 1.
      0                 2    2
(127)

The two parameterizations describe the same oriented curve, so the geometric line integral is unchanged.

Solution 14: generalized force for a pendulum

Differentiate the position with respect to 𝜃:

∂r-
∂ 𝜃 = ℓcos 𝜃ex + ℓsin𝜃ey.
(128)

Therefore

Q 𝜃 = (− mgey ) ⋅ (ℓcos 𝜃ex + ℓsin𝜃ey ).
(129)

Thus

Q 𝜃 = − mg ℓsin𝜃.
(130)

The work is

     ∫
       𝜃2
W  =      Q𝜃 d𝜃.
      𝜃1
(131)

Hence

            ∫
              𝜃2
W  = − mg ℓ     sin 𝜃d 𝜃.
             𝜃1
(132)

Therefore

W  = mg  ℓ(cos 𝜃2 − cos 𝜃1).
(133)

For 𝜃1 = 0 and 𝜃2 = π∕2,

W  = mg ℓ(0 − 1) = − mg ℓ.
(134)

Gravity does negative work as the bob is raised from its lowest point to the horizontal position.

Solution 15: electromotive-force style circulation

Parameterize the circle by

r(𝜃) = a cos𝜃ex + a sin 𝜃ey.
(135)

Then

E  = − αa sin 𝜃ex + αa cos 𝜃ey
(136)

and

dr-
d𝜃 =  − asin𝜃ex + a cos𝜃ey.
(137)

Thus

    dr
E ⋅ ---= αa2.
    d𝜃
(138)

Therefore

     ∫
       2π   2          2
ℰ =      αa  d𝜃 = 2 παa .
      0
(139)

For the Stokes check,

∇  × E =  2αez.
(140)

Therefore

∫
  (∇ ×  E) ⋅ e dS = 2α (πa2) = 2παa2.
 S           z
(141)

The two methods agree.

Solution 16: synthesis problem on a helical path

Along the helix,

x = a cosϕ,     y = a sin ϕ.
(142)

Therefore the force becomes

F = − κa sin ϕex + κa cosϕey +  F0ez.
(143)

The path tangent is

dr
---=  − asinϕex +  acosϕey +  bez.
dϕ
(144)

Their dot product is

    dr
F ⋅ ---= κa2 sin2ϕ + κa2 cos2ϕ + F0b.
    dϕ
(145)

Using sin 2ϕ + cos 2ϕ = 1,

   -dr      2
F ⋅d ϕ = κa  + F0b.
(146)

Hence

      ∫ 2π
W   =     (κa2 + F0b) dϕ.
       0
(147)

Therefore

W  = 2π (κa2 + F0b).
(148)

For the numerical values,

κa2 = (3)(22) = 12J
(149)

and

F0b = (4)(0.5) = 2 J.
(150)

Thus

W  =  2π(14) = 28π J.
(151)

Numerically,

W  ≃  87.96J.
(152)

The term 2πκa2 is the work produced by the circulating horizontal field during one revolution. The term 2πF0b is the work done by the constant axial force through the net vertical displacement 2πb.

References

References

[1]   J. R. Taylor, Classical Mechanics, University Science Books, 2005.

[2]   J. B. Marion and S. T. Thornton, Classical Dynamics of Particles and Systems, 5th ed., Brooks/Cole, 2004.

[3]   D. J. Griffiths, Introduction to Electrodynamics, 4th ed., Cambridge University Press, 2017.

[4]   H. M. Schey, Div, Grad, Curl, and All That: An Informal Text on Vector Calculus, 4th ed., W. W. Norton, 2005.


"example of line integral" is owned by bloftin.
(view preamble)
View style:
Keywords:  line integral, worked examples, arc length, scalar line integral, vector line integral, work, circulation, conservative field, path dependence, Stokes theorem, generalized coordinates, electromotive force

This object's parent.

Cross-references: domain, regular, motion, square, dot product, gradient, energy, magnitude, vector, Electric Field, flux, boundary, curl, vector field, force, position, mass, particle, generalized coordinates, Stokes theorem, fields, line integrals, scalar, work

This is version 1 of example of line integral, born on 2026-09-25.
Object id is 1284, canonical name is ExampleOfLineIntegral.
Accessed 8 times total.

Classification:
Physics Classification: 02.30.Cj (Measure and integration)
 45.20.-d (Formalisms in classical mechanics)
 02.40.-k (Geometry, differential geometry, and topology )
 41.20.-q (Applied classical electromagnetism)
Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:

No messages.

Interact
rate | post | correct | update request | add example | add (any)