Mathematical Physics-08-Contour and Surface Integrals
Mathematical Physics-08-Contour and Surface Integrals
Mathematical Physics-08-Contour and Surface Integrals
I = ‡ f@rD l
C
where C is a contour and „l is an infinitesimal element of the contour length. If the contour can be described by {y[x], z[x]),
one can use
y 2 z 2
l = 1+ + x.
x x
For more complicated contours one can rewrite the contour integral as an integral over a parameter t and use the expression
of the contour in the parametric form {x[t], y[t], z[t]}. In this case the length element becomes
x 2 y 2 z 2
l = + + t.
t t t
ü Perimeter of an ellipse
x2 y2
+ = 1,
a2 b2
Here, for the upper part of the ellipse, one has
x2 y − x ë a2
y=b 1− , =b
a2 x
x2
1−
a2
b2 x2 ë a4 a2 − J1 − N x2
b2
a y 2 a a
P=2‡ x = 2 ‡ x = 2 ‡
a2
1+ 1+ x.
−a x −a 1−
x2 −a a2 − x2
a2
In the case of a circle, a = b = R, one easily obtains P = 2pR. However, in the general case the integral cannot be expressed
via elementary functions.
2 Mathematical_physics-08-Contour_and_surface_integrals.nb
a2 + J− 1 + N x2
b2
a2
2 IntegrateB , 8x, − a, a<, Assumptions → 80 < a < b<F
a2 − x2
a2 + J− 1 + N x2
b2
a2
2 IntegrateB , 8x, − a, a<, Assumptions → 80 < b < a<F
a2 − x2
b2
4 a EllipticEB1 − F
a2
b2
4 a EllipticEB1 − F
a2
The solution is one of elliptic integrals that received their name from the ellipse. For the circle one has
P = 4 a EllipticE@0D
2aπ
P = 4 a EllipticE@1D
4a
b2
4 a EllipticEB1 − F
a2
b2
P = 4 LimitBa EllipticEB1 − F, a → 0F
a2
4 b2
b2 a2
In[31]:= FullSimplifyBa EllipticEB1 − F b EllipticEB1 − F, Assumptions → 80 < b < a<F
a2 b2
a2 b2
Out[31]= b EllipticEB1 − F a EllipticEB1 − F
b2 a2
This is too difficult for Mathematica that seemingly does not know relations between elliptic integrals. Let us define the
function
b2 a2
In[34]:= fab@a_, b_D := a EllipticEB1 − F − b EllipticEB1 − F
a2 b2
that is zero up to the Mathematica's standard precision. Let us now plot P/(4a) that has particular cases
Mathematical_physics-08-Contour_and_surface_integrals.nb 3
1, b << a
= : π ê 2, b = a
P
4a b ê a, b >> a
In[1]:= PlotA9rba, EllipticEA1 − rba2 E, π ê 2=, 8rba, 0, 4<, PlotStyle → 8Dashed, Thick, Dotted<E
Out[1]= 2
1 2 3 4
The ratio of the area of the ellipse S = pab to the a square of its perimeter is
S π b 1
=
P2 F
16 a b2 2
EllipticEB1 − a2
This means that we have expressed the area through the perimeter and the ratio rba ª b/a, as two independent variables:
π b P2
S=
F
16 a b2 2
EllipticEB1 − a2
Let us plot this function vs b/a for a fixed P = 1 to see that its maximum corresponds to b/a = 1
π P2
In[2]:= PlotB rba ê. P → 1, 8rba, 0, 5<F
EllipticEA1 − rba2 E
16 2
0.08
0.06
Out[2]= 0.04
0.02
1 2 3 4 5
Let us calculate the position of the center of mass of the parabola segment
k x2
y= , −a < x < a
2
4 Mathematical_physics-08-Contour_and_surface_integrals.nb
The vertical coordinate of the center of mass is given by the contour integral
1 1 y 2 k a x2
yCM = ‡ y l = ‡ y 1+ x = ‡ 1 + k2 x2 x
L C L C x L −a 2
where
a
L = ‡ l = ‡ 1 + k2 x2 x
C −a
ArcSinh@a kD
Out[37]= a 1 + a2 k2 +
k
and
k x2
In[38]:= FullSimplifyByCM = IntegrateB 1 + k2 x2 , 8x, − a, a<, Assumptions → 8a > 0, k > 0<F,
L 2
Assumptions → k > 0F
ak 1 + a2 k2 I1 + 2 a2 k2 M − ArcSinh@a kD
Out[38]=
8k ak 1 + a2 k2 + ArcSinh@a kD
Particular value:
Out[39]= 0.183029
In[49]:= ShowB
x2
PlotB , 8x, − 1, 1<, AspectRatio → 0.25F,
2
Graphics@Disk@80, yCM<, 0.015DD
0.5
0.4
0.3
Out[49]=
0.2
0.1
ü Length of a cycloide
1.0
0.5
Out[57]=
1 2 3 4 5 6
-0.5
-1.0
One can see that for a < 1 the dependence y[x] is non-monotonic. In this case parametric representation is the only conve-
nient way to calculate the contour integral.
Out[24]= 1 + a2 + 2 a Cos@φD
In[62]:= 2 IntegrateB H∂φ x@φDL2 + H∂φ y@φDL2 , 8φ, 0, π<, Assumptions → 8a ∈ Reals, a ≠ 1, a ≠ 0<F
4a
Out[62]= 4 Abs@− 1 + aD EllipticEB− F
H− 1 + aL2
In[58]:= L1@a_D = 2 IntegrateB H∂φ x@φDL2 + H∂φ y@φDL2 , 8φ, 0, π<, Assumptions → 0 < a < 1F
4a
Out[58]= − 4 H− 1 + aL EllipticEB− F
H− 1 + aL2
In[4]:= L2@a_D = 2 IntegrateB H∂φ x@φDL2 + H∂φ y@φDL2 , 8φ, 0, π<, Assumptions → 1 < aF
4a
Out[4]= 4 H− 1 + aL EllipticEB− F
H− 1 + aL2
1.5
Out[6]= 1.0
0.5
L[a] has a singularity at a = 1. that becomes better visible if we plot the derivative of L[a]
6 Mathematical_physics-08-Contour_and_surface_integrals.nb
Out[77]= 3
or as
W = ‡ F ⋅ r
C
Such integrals can be introduced in a usual way by splitting of the trajectory into a sum of many small finite displacements
∆rn and taking the limit of the sum
N
W = limN→∞ ‚ Fn ⋅ ∆rn
n=1
Practically contour integrals can be calculated in the parametric form as ordinary integrals over a parameter. The natural
parameter for the mechanical integral above is time t. Changing the variable to , one obtains
Mathematical_physics-08-Contour_and_surface_integrals.nb 7
t2 r t2
W=‡ F⋅ t = ‡ F ⋅ v t
t1 t t1
that is, the work is the integral of the power P = F·v over time. As an example, consider the work of the gravity force
F = mg = − mgez
to compute the work, one could consider motion of the particle along the circular trajectory with f = f[t] and write
IFx vx + Fy vy + Fz vz M t =
t2
W=‡
t1
t2 z t2 z φ t2 φ
‡ −m g t = ‡ −m g t = ‡ m g R Sin@φD t.
t1 t t1 φ t t1 t
The result does not depend on the angular velocity „f/„t with which the particle moves along the trjectory, because one can
change the integration variable to f
φ2
W=‡ m g R Sin@φD φ.
φ1
In fact, f could be used as the parameter for the contour integration instead of t from the very beginning. Moreover, one can
firther change the integration variable to z and finally calculate the integral
φ2
W = −‡ m g z = − m g Hz2 − z1 L = − m g R HCos@φ2 D − Cos@φ1 DL.
φ1
Of course, this was a toy example because the gravity force is a potential force and its work can be related to the difference
of potential energies,
W = − HU2 − U1 L
This relation can be proven in a general form. If the force is potential, F = −“U(r), then the infinitesimal work is simply the
negative differential of the potential energy:
W = F ⋅ r = - ∇ U HrL ⋅ r
∂U ∂U ∂U ∂U ∂U ∂U
= − ex + ey + ez ⋅ r = − x + y + z = − U
∂x ∂y ∂z ∂x ∂y ∂z
Thus
W = ‡ - ∇ U HrL ⋅ r = - ‡ U = − HU2 − U1 L.
C C
Work of any potential force over a closed contour is zero. If instead of the force one has a vector function that is not a
gradient of a scalar, the integral of this type over a closed contour can be non-zero. In this case it can be called circulation.
As an illustration of the circulation, consider the magnetic field produced by an infinite thin straight wire directed along the z
axis and carrying a current I in the positive z direction. The magnetic field is directed in the x-y plane and in the polar
coordinate system is given by
eφ µ0 I
B=a , a= ,
r 2π
8 Mathematical_physics-08-Contour_and_surface_integrals.nb
where r is the distance from the wire that is put into the origin of the coordinate system, and eφ is the unit vector perpendicu-
lar to r (in the x-y plane) and directed in the direction of increasing of f, in accordance with the screw rule
eφ = − Sin@φD ex + Cos@φD ey .
‡ B ⋅ r
C
with the contour C being a circle of radius R centered at the wire and going in the positive f direction. Since for this contour
„r = eφ „r = eφ R„f, this integral simplifies to
2π 2π
Heφ ⋅ eφ L R φ = ‡
a a
‡ B ⋅ r = ‡ R φ = 2 πa = µ0 I,
C 0 R 0 R
independently of R.
In fact, the contour integral (circulation of the magnetic field) depends only on the current that crosses the surface bounded
by the contour and not on the shape of the contour (Ampere's law). To illustrate this, let us use the contour that consists of an
infinite horizontal line y = -y1 going to the right and another horizontal line y = y2 going to the left. With
Sin@φD y
Bx = B ⋅ ex = − a = −a
r x2 + y2
‡ f@rD S
S
where S is a surface in a 3d space. Surface can be parametrized by two parameters, r = r(u,v). The surface element „S
created by changing u and v by „u and „v is given by the absolute value of the vector product
∂r ∂r
S = × u v
∂u ∂v
For instance, the surface of a sphere can be parametrized by the two angles J and f, and the surface element is elementarily
given by
S = R2 Sin@ϑD ϑ φ ,
where R is the radius of the sphere. With
r = 8R Sin@ϑD Cos@φ D, R Sin@ϑD Sin@φ D, R Cos@ϑD<
and
Mathematical_physics-08-Contour_and_surface_integrals.nb 9
∂r
= 8R Cos@ϑD Cos@φ D, R Cos@ϑD Sin@φ D, − R Sin@ϑD<
∂ϑ
∂r
= 8− R Sin@ϑD Sin@φ D, R Sin@ϑD Cos@φ D, 0<
∂φ
one obtains
∂r ∂r
× = 9− R2 Cos@ϑD Cos@φD Sin@ϑD, − R2 Cos@ϑD Sin@ϑD Sin@φD, R2 Sin@ϑD2 =
∂ϑ ∂φ
SimplifyB
%.%
, Assumptions → 8R > 0, 0 < ϑ < π ê 2<F
R2 Sin@ϑD
∂r ∂r
the same result. Let us now compute | ∂ϑ × ∂φ
in one step:
Cross@∂ϑ r, ∂φ rD.Cross@∂ϑ r, ∂φ rD
, Assumptions → 8R > 0, 0 < ϑ < π ê 2<F
R2 Sin@ϑD
In most cases, like the sphere, one can write down the expression for „S without using the general formula. For instant, for
the paraboloid
k Ix2 + y2 M k ρ2
z= =
2 2
10 Mathematical_physics-08-Contour_and_surface_integrals.nb
k ρ2
In[81]:= ParametricPlot3DB:ρ Cos@φD, ρ Sin@φD, ê. k → 1>, 8φ, 0, 2 π<, 8ρ, 0, 3<F
2
Out[81]=
z 2
S = 1+ ρ ρ φ = 1 + Hk ρL2 ρ ρ φ
ρ
Excersice: derive this from the general formula. The area of the paraboloid in the region r < a is
2 −1 + 1 + a2 k2 + a2 k2 1 + a2 k2 π
Out[24]=
3 k2
2 − 1 + SimplifyB 1 + a2 k2 + a2 k2 1 + a2 k2 F π
3 k2
2 I− 1 + I1 + a2 k2 M Mπ
3ê2
3 k2
whereas Simplify applied to the whole expression does not work. In the limit ak <<1 the area of the paraboloid reduces to the
1
area of the circle pa2 ,as it should be. In fact, this integral is very simple because r„r = 2
„ r2 . Similar integral describing the
length of a parabola above is much more complicated.
‡ F@rD ⋅ S, S = n S
S
where n is a unit vector perpendicular to the surface at the point r. If the surface is parametrized by two parameters, r =
r(u,v), then „S generated by changing u and v by „u and „v is given by
Mathematical_physics-08-Contour_and_surface_integrals.nb 11
∂r ∂r
S = × u v
∂u ∂v
and the flux integral becomes
∂r ∂r
‡ F@rD ⋅ × u v, S = n S
S ∂u ∂v
As in the case of surface integrals of the scalar type, in most cases the expression for „S can be written without calculation.
For instance, for the sphere of radius R one has
r
S = R2 Sin@ϑD ϑ φ
r
As an illustration we calculate the flux of the Coulomb field produced by a point charge Q
r Q
E= a , a=
r3 4 πε0
Gauss theorem states that the flux of the electric field depends only on the total charge inside the surface but not on the
position of the charge (charges) and the surface shape. To illustrate this, let us calculate the flux of the same Coulomb field
through the paraboloid
k Ix2 + y2 M k ρ2
z= − z0 = − z0
2 2
In the integral
Φ = ‡ E@rD ⋅ S
S
„S is perpendicular to the paraboloid at a given point of its surface. It is convenient to make a general calculation of „S in
the cylindrical coordinate system
k ρ2
r = 8ρ Cos@φD, ρ Sin@φD, z< = :ρ Cos@φD, ρ Sin@φD, − z0 >.
2
k ρ2
r = :ρ Cos@φD, ρ Sin@φD, − z0 >;
2
Simplify@
Cross@∂φ r, ∂ρ rD
D
9k ρ2 Cos@φD, k ρ2 Sin@φD, − ρ=
This vector is directed out of the paraboloid. Then, the electric field on the paraboloid becomes
Thus E ⋅ I ∂ρ × M
∂r ∂r
∂φ
is given by
4 a ρ Ik ρ2 + 2 z0 M
I4 ρ2 + k2 ρ4 − 4 k ρ2 z0 + 4 z20 M
3ê2
∞ 4 a ρ Ik ρ2 + 2 z0 M ∞ 2 a Hk u + 2 z0 L
Φ=2π‡ ρ = 2 π ‡ u
I4 ρ2 + k2 ρ4 − 4 k ρ2 z0 + 4 z20 M I4 u + k2 u2 − 4 k u z0 + 4 z20 M
0 3ê2 0 3ê2
that is
2 π 2 a Hk u + 2 z0 L
In[27]:= Φ = IntegrateB , 8u, 0, ∞<, Assumptions → 8z0 > 0, k > 0<F
I4 u + k2 u2 − 4 k u z0 + 4 z20 M
3ê2
Out[27]= 4aπ
This result is correct and in accordance with the Gauss theorem saying that the flux must be the same as the flux through the
sphere. In the case z0 < 0 the charge is outside the paraboloid and the flux is zero:
2 π 2 a Hk u + 2 z0 L
Φ = IntegrateB , 8u, 0, ∞<, Assumptions → 8z0 < 0, k > 0<F
I4 u + k2 u2 − 4 k u z0 + 4 z20 M
3ê2
In the case z0 < 0 the charge is exactly on the surface of the paraboloid and the flux is
2 π 2 a Hk u + 2 z0 L
Φ = IntegrateB , 8u, 0, ∞<, Assumptions → 8z0 == 0, k > 0<F
I4 u + k2 u2 − 4 k u z0 + 4 z20 M
3ê2
2aπ
The same result arises if the charge is placed on the surface of a sphere.
and a slightly more complicated formula for the integral of a gradient over a contour. In both cases, the region is one-
dimensional and its border is zero-dimensional, thus there is no integral over the border, just values of the functions at the
border points. Next of these relations is the Stokes' theorem that relates the flux through an open surface (a 2d integral) with
a work-type integral over a contour bounding this surface. It has the form
‡ ı × F ⋅ S = ‡ F ⋅ r .
S C
Mathematical_physics-08-Contour_and_surface_integrals.nb 13
There is a one-dimensional integral on the right but a two-dimensional integral on the left, however, of a differentiated
function, the curl. The physical implication of the Stokes theorem is the Ampere's law, where F is the magnetic field B and
õ×F is proportional to the density of current flowing through the surface.
Next there is the Gauss theorem relating a volume integral with a flux through the closed surface bounding this volume
‡ ı ⋅ F V = ‡ F ⋅ S .
V S
Here there is a two-dimensional integral on the right but a three-dimensional integral on the left, however, of a differentiated
function, the divergence. The physical implication of the Gauss theorem is the relation between the electric-field flux out of
the volume V through its surface S, F being the electric field E, and the total electric charge in the volume, the charge
density being proportional to õ·E.
‡ ı × F V = −‡ F × S
V S