<<

Contour and surface

Contour integrals of the scalar type

These are integrals of the type

I = f r l ‡C @ D 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 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

As an example, let us calculate the perimeter of the ellipse

x2 y2 + = 1, a2 b2 Here, for the upper part of the ellipse, one has

x2 y −x a2 y = b 1 − , = b ë 2 x a 2 1 − x a2

Thus the perimeter is given by

b2 2 2 2 4 a2 − 1 − x2 a y a b x a a J a2 N P = 2 1 + x = 2 1 + ë x = 2 x. 2 ‡−a x ‡−a 1 − x ‡−a a2 − x2 a2

In the case of a circle, a = b = R, one easily obtains P = 2 pR. However, in the general case the integral cannot be expressed via elementary functions. 2 Mathematical_physics-08-Contour_and_surface_integrals.nb

2 a2 + − 1 + b x2 J a2 N 2 Integrate , x, −a, a , Assumptions → 0 < a < b B a2 − x2 8 < 8

2 a2 + − 1 + b x2 J a2 N 2 Integrate , x, −a, a , Assumptions → 0 < b < a B a2 − x2 8 < 8

b2 4 a EllipticE 1 − B a2 F

b2 4 a EllipticE 1 − B a2 F

The solution is one of elliptic integrals that received their name from the ellipse. For the circle one has

P = 4 a EllipticE 0 @ D 2 a π

In the case of b Ø 0 one has

P = 4 a EllipticE 1 @ D 4 a that is an expected result as well. A similar result arises in the case a Ø 0

b2 4 a EllipticE 1 − B a2 F

b2 P = 4 Limit a EllipticE 1 − , a → 0 B B a2 F F

4 b2

Let us check that the solution is symetric in a and b

b2 a2 In[31]:= FullSimplify a EllipticE 1 − b EllipticE 1 − , Assumptions → 0 < b < a B B a2 F B b2 F 8

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_ := a EllipticE 1 − − b EllipticE 1 − @ D B a2 F B b2 F This function is zero for any set of arguments:

fab 1, 2 FullSimplify In[35]:= @ D êê fab 1, 2. @ D 3 Out[35]= EllipticE − 3 − 2 EllipticE @ D B 4 F

−16 Out[36]= 4.44089 × 10 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

P 1, b << a = π 2, b = a : ê 4 a b a, b >> a ê as a function of rba ª b/a.

Plot rba, EllipticE 1 − rba 2 , π 2 , rba, 0, 4 , PlotStyle → Dashed, Thick, Dotted In[1]:= A9 A E ê = 8 < 8

4

3

Out[1]= 2

1

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 = 2 16 a 2 2 P EllipticE 1 − b B a2 F This means that we have expressed the area through the perimeter and the ratio rba ª b/a, as two independent variables:

π b P2 S = 16 a 2 2 EllipticE 1 − b B a2 F 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]:= Plot rba .P → 1, rba, 0, 5 B 2 ê 8

0.06

Out[2]= 0.04

0.02

1 2 3 4 5

ü Center of mass of a parabola segment

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 2 2 yCM = y l = y 1 + x = 1 + k x x L ‡C L ‡C x L ‡−a 2 where

a L = l = 1 + k2 x2 x ‡C ‡−a is the length of the parabola segment. Calculation of the integrals yields

L = Integrate 1 + k2 x2 , x, −a, a , Assumptions → a > 0, k > 0 In[37]:= B 8 < 8

k x2 2 2 In[38]:= FullSimplify yCM = Integrate 1 + k x , x, −a, a , Assumptions → a > 0, k > 0 , B L B 2 8 < 8 0 F

a k 1 + a2 k2 1 + 2 a2 k2 − ArcSinh a k I M @ D Out[38]= 8 k a k 1 + a2 k2 + ArcSinh a k @ D

Particular value:

yCM = yCM . a → 1, k → 1. In[39]:= ê 8 <

Out[39]= 0.183029

Show In[49]:= B x2 Plot , x, −1, 1 , AspectRatio → 0.25 , B 2 8 < F Graphics Disk 0, yCM , 0.015 @ @8 < DD

F 0.5 0.4 0.3 Out[49]= 0.2 0.1

-1.0 -0.5 0.5 1.0

ü Length of a cycloide

Find the length of a cycloid x φ = Sin φ + a φ; y φ = Cos φ ; @ D @ D @ D @ D in the a œ{0,2 p}. Here is a plot of the cycloid. Mathematical_physics-08-Contour_and_surface_integrals.nb 5

x φ_ := Sin φ + a φ; y φ_ := Cos φ ; In[56]:= @ D @ D @ D @ D ParametricPlot x φ . a → 1 2, y φ , φ, 0, 4 π ∗ Cycloide ∗ @8 @ D ê ê @ D< 8

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.

Simplify ∂ x φ 2 + ∂ y φ 2 In[24]:= AH φ @ DL H φ @ DL E 1 + a2 + 2 a Cos φ Out[24]= @ D For a < 1 the length of the cycloid is given by

2 Integrate ∂ x φ 2 + ∂ y φ 2 , φ, 0, π , Assumptions → a ∈ Reals, a ≠ 1, a ≠ 0 In[62]:= B H φ @ DL H φ @ DL 8 < 8

L1 a_ = 2 Integrate ∂ x φ 2 + ∂ y φ 2 , φ, 0, π , Assumptions → 0 < a < 1 In[58]:= @ D B H φ @ DL H φ @ DL 8 < F 4 a Out[58]= − 4 −1 + a EllipticE − H L B −1 + a 2 F H L and for a > 1 it is given by

L2 a_ = 2 Integrate ∂ x φ 2 + ∂ y φ 2 , φ, 0, π , Assumptions → 1 < a In[4]:= @ D B H φ @ DL H φ @ DL 8 < F 4 a Out[4]= 4 − 1 + a EllipticE − H L B − 1 + a 2 F H L The full dependence for a > 0 can be represented by

L a_ := If 0 < a < 1, L1 a , L2 a In[5]:= @ D @ @ D @ DD L a Plot @ D , a, 0, 2 , PlotRange → 0, 2 B 2 π 8 < 8

2.0

1.5

Out[6]= 1.0

0.5

0.0 0.5 1.0 1.5 2.0

L[a] has a singularity at a = 1. that becomes better visible if we plot the of L[a] 6 Mathematical_physics-08-Contour_and_surface_integrals.nb

L1Der a_ = ∂ L1 a ; ∗ Immediate set is mandatory ! ∗ In[75]:= @ D a @ D H L L2Der a_ = ∂ L2 a ; @ D a @ D LDer a_ := If 0 < a < 1, L1Der a , L2Der a @ D @ @ D @ DD Plot LDer a , a, 0, 2 @ @ D 8

5

4

Out[77]= 3

2

1

0.5 1.0 1.5 2.0

Note that LDer cannot be determined as

LDer a_ := If 0 < a < 1, ∂ L1 a , ∂ L2 a @ D @ a @ D a @ DD LDer 2 ∗ with delayed set, @ D H Mathematica tries to calculate when they are needed, i.e., when a is set to 2. But it cannot differentiate with respect to 2 ∗ L General::ivar : 2 is not a valid variable. à ∂ 4 EllipticE −8 Out[18]= 2 H @ DL or as

LDer a_ = If 0 < a < 1, ∂ L1 a , ∂ L2 a @ D @ a @ D a @ DD ∗ This remains a delayed set because it depends on a condition, H and delayed set does not work ∗ L LDer 2 @ D If 0 < a < 1, ∂ L1 a , ∂ L2 a Out[22]= @ a @ D a @ DD

General::ivar : 2 is not a valid variable. à ∂ 4 EllipticE −8 Out[23]= 2 H @ DL

Contour integrals of the work / circulation type

An example of a contour integral is work along the trajectory C that is a line in 3 d space

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 = lim F ⋅ ∆r N→∞ ‚ n n 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 = −mg ez along a contour being a part of a circle z = R Cos φ , x = R Sin φ , φ ≤ φ ≤ φ @ D @ D 1 2 to compute the work, one could consider motion of the particle along the circular trajectory with f = f[t] and write

t2 W = F v + F v + F v t = I x x y y z zM ‡t1

t2 z t2 z φ t2 φ −m g t = −m g t = m g R Sin φ t. @ D ‡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 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 z − z = −m g R Cos φ − Cos φ . H 2 1L H @ 2D @ 1DL ‡φ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 = − U − U H 2 1L 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 r ⋅ r H L ∂U ∂U ∂U ∂U ∂U ∂U = − ex + ey + ez ⋅ r = − x + y + z = − U ∂x ∂y ∂z ∂x ∂y ∂z

Thus

W = -∇U r ⋅ r = - U = − U2 − U1 . ‡C H L ‡C H L

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 of a scalar, the integral of this type over a closed contour can be non-zero. In this case it can be called circulation.

ü Circulation of the magnetic field

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 φ e + Cos φ e . φ @ D x @ D y Let us first calculate the contour integral

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 π a 2 π a B ⋅ r = eφ ⋅ eφ R φ = R φ = 2 πa = 0 I, ‡C ‡0 R H L ‡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 φ y Bx = B ⋅ ex = −a @ D = −a r x2 + y2 the contour integral is given by

∞ −∞

B ⋅ r = Bx y=−y1 x + Bx y=y2 x = ‡C ‡−∞ ‡∞ ∞ ∞ ∞ ∞ a y1 a y2 a a x + = u + u = πa + πa = 2 πa = 0 I, 2 2 2 2 2 2 ‡−∞ x + y1 ‡−∞ x + y2 ‡−∞ u + 1 ‡−∞ u + 1 the same value as that along the circular contour.

Surface integrals of the scalar type

These are the integrals of the type

f r S ‡S @ D where S is a surface in a 3 d 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 = R Sin ϑ Cos φ , R Sin ϑ Sin φ , R Cos ϑ 8 @ D @ D @ D @ D @ D< and Mathematical_physics-08-Contour_and_surface_integrals.nb 9

∂r = R Cos ϑ Cos φ , R Cos ϑ Sin φ , −R Sin ϑ ∂ϑ 8 @ D @ D @ D @ D @ D< ∂r = −R Sin ϑ Sin φ , R Sin ϑ Cos φ , 0 ∂φ 8 @ D @ D @ D @ D < one obtains ∂r ∂r × = −R2 Cos ϑ Cos φ Sin ϑ , −R2 Cos ϑ Sin ϑ Sin φ ,R2 Sin ϑ 2 ∂ϑ ∂φ 9 @ D @ D @ D @ D @ D @ D @ D = that can be computed as

Cross R Sin ϑ Cos φ , R Sin ϑ Sin φ , R Cos ϑ , @8 @ D @ D @ D @ D @ D< −R Sin ϑ Sin φ , R Sin ϑ Cos φ , 0 Simplify 8 @ D @ D @ D @ D

Simplify B %.% , Assumptions → R > 0, 0 < ϑ < π 2 8 ê

r = R Sin ϑ Cos φ , R Sin ϑ Sin φ , R Cos ϑ ; 8 @ D @ D @ D @ D @ D< Simplify B Cross ∂ r, ∂ r .Cross ∂ r, ∂ r @ ϑ φ D @ ϑ φ D , Assumptions → R > 0, 0 < ϑ < π 2 8 ê

k x2 + y2 k ρ2 z = I M = 2 2 10 Mathematical_physics-08-Contour_and_surface_integrals.nb

k ρ2 In[81]:= ParametricPlot3D ρ Cos φ , ρ Sin φ , . k → 1 , φ, 0, 2 π , ρ, 0, 3 B: @ D @ D 2 ê > 8 < 8

Out[81]=

in the cylindrical coordinate system one has

z 2 S = 1 + ρ ρ φ = 1 + k ρ 2 ρ ρ φ ρ H L

Excersice: derive this from the general formula. The area of the paraboloid in the region r < a is

S = 2 π Integrate 1 + k ρ 2 ρ, ρ, 0, a , Assumptions → a > 0, k > 0 In[24]:= B H L 8 < 8

2 − 1 + 1 + a2 k2 + a2 k2 1 + a2 k2 π

Out[24]= 3 k2

This result can be simplified by the Simplify command applied locally

2 − 1 + Simplify 1 + a2 k2 + a2 k2 1 + a2 k2 π B F 3 k2

3 2 2 − 1 + 1 + a2 k2 ê π I I M M 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 area of the circle pa2,as it should be. In fact, this integral is very simple because r„r = 1 „ r2. Similar integral describing the 2 length of a parabola above is much more complicated.

Surface integrals of the flux type

These are integrals of the type

F r ⋅ S, S = n S ‡S @ D 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 r ⋅ × u v, S = n S ‡S @ D ∂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 ϑ ϑ φ r @ D

ü Flux of the electric field

As an illustration we calculate the flux of the Coulomb field produced by a point charge Q r Q E = a , a = 3 r 4 πε0 through the sphere of radius R:

2 π π r r π Q Φ = E r ⋅ S = a ⋅ R2 Sin ϑ ϑ φ = 2 π a Sin ϑ ϑ = 4 π a = . @ D 3 @ D @ D ‡S ‡0 ‡0 R R ‡0 ε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 x2 + y2 2 I M k ρ z = − z0 = − z0 2 2 In the integral

Φ = E r ⋅ S ‡S @ D

„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 = ρ Cos φ , ρ Sin φ , z = ρ Cos φ , ρ Sin φ , − z0 . 8 @ D @ D < : @ D @ D 2 >

The vector product ∂r × ∂r can be computed as follows I ∂ρ ∂φ M

k ρ2 r = ρ Cos φ , ρ Sin φ , − z0 ; : @ D @ D 2 > Simplify @ Cross ∂ r, ∂ r @ φ ρ D D k ρ2 Cos φ , k ρ2 Sin φ , −ρ 9 @ D @ D = This vector is directed out of the paraboloid. Then, the electric field on the paraboloid becomes

2 ρ Cos φ , ρ Sin φ , k ρ − z r : @ D @ D 2 0> E = a = a 3 3 2 r 2 2 ρ2 + k ρ − z ê K J 2 0N O 12 Mathematical_physics-08-Contour_and_surface_integrals.nb

Thus E ⋅ ∂r × ∂r is given by I ∂ρ ∂φ M

ρ2 ρ Cos φ , ρ Sin φ , k − z : @ D @ D 2 0> a . k ρ2 Cos φ , k ρ2 Sin φ , −ρ Simplify 3 2 9 @ D @ D = êê ρ2 2 ê ρ2 + k − z K J 2 0N O

4 a ρ k ρ2 + 2 z I 0M 3 2 4 ρ2 + k2 ρ4 − 4 k ρ2 z + 4 z2 ê I 0 0M Now the flux through the paraboloid is given by

∞ 2 ∞ 4 a ρ k ρ + 2 z0 2 a k u + 2 z0 Φ = 2 π I M ρ = 2 π H L u 3 2 3 2 ‡0 4 ρ2 + k2 ρ4 − 4 k ρ2 z + 4 z2 ê ‡0 4 u + k2 u2 − 4 k u z + 4 z2 ê I 0 0M I 0 0M that is

2 π 2 a k u + 2 z H 0L In[27]:= Φ = Integrate , u, 0, ∞ , Assumptions → z0 > 0, k > 0 B 3 2 8 < 8

Out[27]= 4 a π

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 k u + 2 z H 0L Φ = Integrate , u, 0, ∞ , Assumptions → z0 < 0, k > 0 B 3 2 8 < 8

In the case z0 < 0 the charge is exactly on the surface of the paraboloid and the flux is

2 π 2 a k u + 2 z H 0L Φ = Integrate , u, 0, ∞ , Assumptions → z0 == 0, k > 0 B 3 2 8 < 8

The same result arises if the charge is placed on the surface of a sphere.

Vector integral relations: Stokes and Gauss theorems

There are important vector integral relations between integrals over a region and over the border of this region. The simplest example of these relations is the formula

b ∂x F x x = F b − F a ‡a @ D @ D @ D 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 2 d 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 . 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 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 . 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.

There is a vector variant of the Gauss theorem

ı × F V = − F × S ‡V ‡S arising in the theory of magnetism.