<<

EE2 Mathematics : J. D. Gibbon (Professor J. D Gibbon1, Dept of Mathematics)

[email protected] http://www2.imperial.ac.uk/ jdg ∼

These notes are not identical word-for-word with my lectures which will be given on a BB/WB. Some of these notes may contain more examples than the corresponding lecture while in other cases the lecture may contain more detailed working. I will NOT be handing out copies of these notes – you are therefore advised to attend lectures and take your own.

1. The material in them is dependent upon the Vector Algebra you were taught at A-level and your 1st year. A summary of what you need to revise lies in Handout 1 : “Things you need to recall about Vector Algebra” which is also 1 of this document. § 2. Further handouts are :

(a) Handout 2 : “The role of grad, div and in vector calculus” summarizes most of the material in 3. § (b) Handout 3 : “Changing the order in double integration” is incorporated in 5.5. § (c) Handout 4 : “Green’s, & Stokes’ Theorems plus Maxwell’s Equations” summarizes the material in 6, 7 and 8. § § § Technically, while Maxwell’s Equations themselves are not in the syllabus, three of the four of them arise naturally out of the Divergence & Stokes’ Theorems and they connect all the subsequent material with that given from lectures on e/m theory given in your own Department.

1Do not confuse me with Dr J. Gibbons who is also in the Mathematics Dept. 14th/10/10 (EE2Ma-VC.pdf) 1

Contents

1 Revision : Things you need to recall about Vector Algebra 2

2 Scalar and Vector Fields 3

3 The vector operators : grad, div and curl 3 3.1 Definition of the operator ...... 3 3.2 Definition of the divergence of∇ a div B ...... 4 3.3 Definition of the curl of a vector field curl B ...... 5 3.4 Five vector identities ...... 6 3.5 Irrotational and solenoidal vector fields ...... 6

4 Line (path) integration 8 4.1 Line integrals of Type 1 : C ψ(x, y, z) ds ...... 10 4.2 Line integrals of Type 2 : C F (x, y, z) dr ...... 11 4.3 Independence of path in lineR integrals of∙ Type 2 ...... 13 R 5 Double and multiple integration 15 5.1 How to evaluate a double integral ...... 16 5.2 Applications ...... 16 5.3 Examples of multiple integration ...... 17 5.4 Change of variable and the Jacobian ...... 18 5.5 Changing the order in double integration ...... 20

6 Green’s Theorem in a plane 22

7 2D Divergence and Stokes’ Theorems 25

8 Maxwell’s Equations 29 14th/10/10 (EE2Ma-VC.pdf) 2

1 Revision : Things you need to recall about Vector Algebra

Notation: a = a1ˆi + a2jˆ + a3kˆ (a1, a2, a3). ≡ 1. The magnitude or length of a vector a is 1/2 a = a = a2 + a2 + a2 . (1.1) | | 1 2 3  2. The scalar (dot) product of two vectors a = (a1, a2, a3) & b = (b1, b2, b3) is given by

a b = a1b1 + a2b2 + a3b3 . (1.2) ∙ Since a b = ab cos θ, where θ is the angle between a and b, then a and b are ∙ perpendicular if a b = 0, assuming neither a nor b are null. ∙ 3. The vector (cross) product 2 between two vectors a and b is ˆi jˆ kˆ a b = a1 a2 a3 . (1.3) × b1 b2 b3

Recall that a b can also be expressed as × a b = (ab sin θ) nˆ (1.4) × where nˆ is a unit vector perpendicular to both a and b in a direction determined by the right hand rule. If a b = 0 then a and b are parallel if neither vector is null. × 4. The scalar triple product between three vectors a, b and c is a a a a 1 2 3 Cyclic Rule: a (b c) = b1 b2 b3 (1.5) ∙ × %& clockwise +ve c c c c b 1 2 3 ←− According to the cyclic rule

a (b c) = b (c a) = c (a b) (1.6) ∙ × ∙ × ∙ × One consequence is that if any two of the three vectors are equal (or parallel) then their scalar product is zero: e.g. a (b a) = b (a a) = 0. If a (b c) = 0 ∙ × ∙ × ∙ × and no pair of a, b and c are parallel then the three vectors must be coplanar.

5. The vector triple product between three vectors is a (b c) = b(a c) c(a b) . (1.7) × × ∙ − ∙ The placement of the brackets on the LHS is important: the RHS is a vector that lies in the same plane as b and c whereas (a b) c = b(c a) a(c b) lies in the plane × × ∙ − ∙ of a and b. Thus, a b c without brackets is a meaningless statement! × × 2It is acceptable to use the notation a b as an alternative to a b. ∧ × 14th/10/10 (EE2Ma-VC.pdf) 3

2 Scalar and Vector Fields

(L1) Our first aim is to step up from single variable calculus – that is, dealing with functions of one variable – to functions of two, three or even four variables. The physics of electro- magnetic (e/m) fields requires us to deal with the three co-ordinates of space (x, y, z) and also time t. There are two different types of functions of the four variables : 1. A scalar field 3 is written as ψ = ψ(x, y, z, t) . (2.1) Note that one cannot plot ψ as a graph in the conventional sense as ψ takes values at every point in space and time. A good example of a scalar field is the temperature of the air in a room. If the box-shape of a room is thought of as a co-ordinate system with the origin in one corner, then every point in that room can be labelled by a co-ordinate (x, y, z). If the room is poorly air-conditioned the temperature in different parts may vary widely : moving a thermometer around will measure the variation in temperature from point to point (spatially) and also in time (temporally). Another example of a scalar field is the concentration of salt or a dye dissolved inafluid.

2. A vector field B(x, y, z, t) must have components (B1,B2,B3) in terms of the three unit vectors (ˆi, jˆ, kˆ)

B = ˆiB1(x, y, z, t) + jˆB2(x, y, z, t) + kˆB3(x, y, z, t) . (2.2) These components can each be functions of (x, y, z, t). Three physical examples of vector fields are :

(a) An :

E(x, y, z, t) = ˆiE1(x, y, z, t) + jˆE2(x, y, z, t) + kˆE3(x, y, z, t) , (2.3) (b) A :

H(x, y, z, t) = ˆiH1(x, y, z, t) + jˆH2(x, y, z, t) + kˆH3(x, y, z, t) , (2.4) (c) The velocity field u(x, y, z, t) in a fluid.

A classic illustration of a three-dimensional vector field in action is the e/m signal received by a mobile phone which can be received anywhere in space.

3 The vector operators : grad, div and curl

3.1 Definition of the gradient operator ∇ The gradient operator (grad) is denoted by the symbol and is defined as ∇ ∂ ∂ ∂ = ˆi + jˆ + kˆ . (3.1) ∇ ∂x ∂y ∂z 3The convention is to use Greek letters for scalar fields and bold Roman for vector fields. 14th/10/10 (EE2Ma-VC.pdf) 4

As such it is a vector form of partial differentiation because it has spatial partial derivatives in each of the three directions. On its right, can operate on a scalar field ψ(x, y, z) ∇ ∂ψ ∂ψ ∂ψ ψ = ˆi + jˆ + kˆ . (3.2) ∇ ∂x ∂y ∂z Note that while ψ is a scalar field, ψ itself is a vector. ∇ Example 1) : With ψ = 1 x3 + y3 + z3 • 3 ψ = ˆix2 + jˆy2 + kˆz2. (3.3) ∇ As explained above, the RHS is a vector whereas ψ is a scalar.

Example 2) : With ψ = xyz the vector ψ is • ∇ ψ = ˆiyz + jˆxz + kˆxy . (3.4) ∇ End of L1

3.2 Definition of the divergence of a vector field div B L2 Because vector algebra allows two forms of multiplication (the scalar and vector products) there are two ways of operating on a vector ∇

B = ˆiB1(x, y, z, t) + jˆB2(x, y, z, t) + kˆB3(x, y, z, t) . (3.5)

The first is through the scalar or dot product

∂ ∂ ∂ div B = B = ˆi + jˆ + kˆ ˆiB1 + jˆB2 + kˆB3 . (3.6) ∇ ∙ ∂x ∂y ∂z ∙    Recalling that ˆi ˆi = jˆ jˆ = kˆ kˆ = 1 but ˆi jˆ = ˆi kˆ = kˆ jˆ = 0, the result is ∙ ∙ ∙ ∙ ∙ ∙ ∂B ∂B ∂B div B = B = 1 + 2 + 3 . (3.7) ∇ ∙ ∂x ∂y ∂z Note that div B is a scalar because div is formed through the dot product. The best physical explanation that can be given is that div B is a measure of the compression or expansion of a vector field through the 3 faces of acube.

If div B = 0 the the vector field B is incompressible ; • If div B > 0 the the vector field B is expanding ; • If div B < 0 the the vector field B is compressing . • 14th/10/10 (EE2Ma-VC.pdf) 5

Example 1 : Let r be the straight line vector r = ˆix + jˆy + kˆz then

div r = 1 + 1 + 1 = 3 (3.8)

Example 2 : Let B = ˆix2 + jˆy2 + kˆz2 then

div B = 2x + 2y + 2z (3.9)

Note : the usual rule in vector algebra that a b = b a (that is, a and b commute) ∙ ∙ doesn’t hold when one of them is an operator. Thus ∂ ∂ ∂ B = B1 + B2 + B3 = B (3.10) ∙ ∇ ∂x ∂y ∂z 6 ∇ ∙

3.3 Definition of the curl of a vector field curl B The alternative in vector multiplication is to use in a cross product with a vector B : ∇ ˆi jˆ kˆ curl B = B = ∂x ∂y ∂z . (3.11) ∇ × B1 B2 B3

The best physical explanation that can be given is to visualize in colour the intensity of B then curl B is a measure of the curvature in the field lines of B. Example 1) : Take the vector denoting a straight line from the origin to a point (x, y, z) denoted by r = ˆix + jˆy + kˆz. Then

ˆi jˆ kˆ curl r = r = ∂x ∂y ∂z = 0 . (3.12) ∇ × x y z

1 ˆ 2 ˆ 2 ˆ 2 Example 2) : Choose B = 2 ix + jy + kz then  ˆi jˆ kˆ curl B = B = ∂x ∂y ∂z = 0 . (3.13) ∇ × 1 2 1 2 1 2 2 x 2 y 2 z

Example 3) : Take the vector denoted by B = ˆiy2z2 + jˆx2z2 + kˆx2y2. Then

ˆi jˆ kˆ 2ˆ 2ˆ 2 ˆ curl B = B = ∂x ∂y ∂z = 2x i(y z) 2y j(x z)+2z k(x y) . (3.14) ∇× 2 2 2 2 2 2 − − − − y z x z x y

14th/10/10 (EE2Ma-VC.pdf) 6

Example 4) : For the curl of a two-dimensional vector B = ˆiB1(x, y) + jˆB2(x, y) we have

ˆi jˆ kˆ ˆ ∂B2 ∂B1 curl B = B = ∂x ∂y ∂z = k , (3.15) ∇ × ∂x − ∂y B1(x, y) B2(x, y) 0  

which points in the vertical direction only because there are no ˆi and jˆ components. End of L2

3.4 Five vector identities L3 There are 5 useful vector identities (see hand out No 2). The proofs of 1), 4) and 5) are obvious : for No 1) use the product rule. 2) and 3) can be proved with a little effort.

1. The gradient of the product of two scalars ψ and φ

(φψ) = ψ φ + φ ψ . (3.16) ∇ ∇ ∇ 2. The divergence of the product of a scalar ψ with a vector b

div (ψB) = ψ div B + ( ψ) B . (3.17) ∇ ∙ 3. The curl of the product of a scalar ψ with a vector B

curl (ψB) = ψ curl B + ( ψ) B . (3.18) ∇ × 4. The curl of the gradient of any scalar ψ

curl ( ψ) = ψ = 0 , (3.19) ∇ ∇ × ∇ because the cross product is zero. ∇ × ∇ 5. The divergence of the curl of any vector B

div (curl B) = ( B) = 0 . (3.20) ∇ ∙ ∇ × The cyclic rule for the scalar triple product in (3.20) shows that this is zero for all vectors B because two vectors ( ) in the triple are the same. ∇ 3.5 Irrotational and solenoidal vector fields Consider identities 4) & 5) above (see also Handout 2 “The role of grad, div & curl ...”)

curl ( φ) = φ = 0 , (3.21) ∇ ∇ × ∇ div (curl B) = 0 . (3.22)

(3.21) says that if any vector B(x, y, z) can be written as the gradient of a scalar φ(x, y, z) (which can’t always be done) B = φ (3.23) ∇ 14th/10/10 (EE2Ma-VC.pdf) 7

then automatically curl B = 0. Such vector fields are called irrotational vector fields. It is equally true that for a given field B, then if it is found that curl B = 0, then we can write 4 B = φ (3.24) ±∇ φ is called the “”. Note that not every vector field has a corresponding scalar potential, but only those that are curl-free. Likewise we now turn to (3.22) : vector fields B for which div B = 0 are called solenoidal, in which case B can be written as B = curl A (3.25) where the vector A is called a “”. Note that only vectors those that are div-free have a corresponding vector potential 5. Example : The Newtonian gravitational force between masses m and M (with gravitational constant G) is r F = GmM , (3.26) − r3 where r = ˆix + jˆy + kˆz and r2 = x2 + y2 + z2 .

1. Let us first calculate curl F

3 curl F = GmM curl (ψr) , where ψ = r− . (3.27) − The 3rd in the list of vector identities gives

curl (ψr) = ψ curl r + ( ψ) r (3.28) ∇ × and we already know that curl r = 0. It remains to calculate ψ : ∇

3/2 3(ˆix + jˆy + kˆz) 3r ψ = x2 + y2 + z2 − = = . (3.29) ∇ ∇ −(x2 + y2 + z2)5/2 − r5 n  o Thus, from (3.26), 3r curl F = GmM 0 r = 0 . (3.30) − − 2r5 ×   Thus the Newton gravitational force field is curl-free, which is why a gravita- tional potential exists. We can write 6

F = φ . (3.31) −∇ One can find φ by inspection : it turns out that φ = GmM 1/r. − 4Whether we use + or in (3.24) depends on convention : in e/m theory normally uses a minus sign − whereas fluid dynamics uses a plus sign. 5The last lecture on Maxwell’s Equations stresses that all magnetic fields in the universe are div-free asno magnetic monopoles have yet been found : thus all magnetic fields are solendoidal vector fields. 6In this case a negative sign is adopted on the scalar potential. 14th/10/10 (EE2Ma-VC.pdf) 8

2. Now let us calculate div F

3 div F = GmM div (ψr) where ψ = r− . (3.32) − The 2nd in the list of vector identities gives

div (ψr) = ψ div r + ( ψ) r (3.33) ∇ ∙ and we already know that div r = 3 and we have already calculated ψ in (3.29). ∇ 3 3r div F = GmM r = 0 . (3.34) − r3 − r5 ∙   Thus the Newton gravitational force field is also div-free, which is whya gravitational vector potential A also exists.

As a final remark it is noted that with F satisfying both F = φ and div F = 0, then −∇ div ( φ) = 2φ = 0 , (3.35) ∇ ∇ which is known as Laplace’s equation. End of L3.

4 Line (path) integration

(L4) In single variable calculus the idea of the integral

b N f(x) dx = f(xi)δxi (4.1) a i=1 Z X is a way of expressing the sum of values of the function f(xi) at points xi multiplied by the area of small strips δxi : correctly it is often expressed as the area under the curve f(x). Pictorially the concept of an area sits very well in the plane with y = f(x) plotted against x. However, the idea of area under a curve has to be dropped when line integration is considered because we now wish to place our curve C in 3-space where a scalar field ψ(x, y, z) or a vector field F (x, y, z) take values at every point in this space. Instead, we consider a specified continuous curve C in 3-space – known as the path 7 of integration – and then work out methods for summing the values that either ψ or F take on that curve. It is essential to realize that the curve C sitting in 3-space and the scalar/vector fields ψ or F that take values at every point in this space are wholly independent quantities and must not be conflated.

7The same idea arises in complex integration where, by convention, a closed C is known as a ‘contour’. 14th/10/10 (EE2Ma-VC.pdf) 9

z

B • C

y A • x

Figure 3.1 : The curve C in 3-space starts at the point A and ends at B. B δs

δr

r + δr A r

O Figure 3.2 : On a curve C, small elements of arc length δs and the chord δr, where O is the origin.

δs δy

δx Figure 3.3 : In 2-space we can use Pythagoras’ Theorem to express δs in terms of δx and δy.

Pythagoras’ Theorem in 3-space (see Fig 3.3 for a 2-space version) express δs in terms of δx, δy and δz : (δs)2 = (δx)2 + (δy)2 + (δz)2. There are two types of line integral : Type 1 : The first concerns the integration of a scalar field ψ along a path C

ψ(x, y, z) ds (4.2) ZC 14th/10/10 (EE2Ma-VC.pdf) 10

Type 2 : The second concerns the integration of a vector field F along a path C

F (x, y, z) dr (4.3) ∙ ZC Remark : In either case, if the curve C is closed then we use the designations

ψ(x, y, z) ds and F (x, y, z) dr (4.4) ∙ IC IC

4.1 Line integrals of Type 1 : C ψ(x, y, z) ds How to evaluate these integrals is bestR shown by a series of examples keeping in mind that, where possible, one should always draw a picture of the curve C :

2 Example 1) : Show that C x y ds = 1/3 where C is the circular arc in the first quadrant of the unit circle. R y C is the arc of the unit circle x2 + y2 = 1 represented in polars by x = cos θ and y = sin θ (0, 1) for 0 θ π/2. Thus the small element of ≤ ≤ δs arc length is δs = 1.δθ.

π/2 (x, y) x2y ds = cos2 θ sin θ(dθ) δθ ZC Z0 = 1/3 . (4.5) θ x (0, 0) (1, 0)

Example 2) : Show that xy3 ds = 54√10/5 where C is the line y = 3x from x = 1 1. C − →

y R C is an element on the line y = 3x. Thus y = 3x δy = 3δx so

2 2 2 2 x (δs) = (δx) + 9(δx) = 10(δx)

1 xy3 ds = 27√10 x4dx = 54√10/5 . C 1 Z Z−

Example 3) : Show that x2y ds = √2/12 where C is the closed triangle in the figure. C − H 14th/10/10 (EE2Ma-VC.pdf) 11

y On C : y = 0 so ds = dx and = 0 (because y = 0). 1 C1 (0, 1) 2 2 On C2 : y = 1 x so dy = dx and so (ds) = 2(ds) . − − R On C3 : x = 0 so ds = dy and = 0 (because x = 0). C3 C2 R C3 x C 1 (1, 0) Therefore 0 = + + = 0 + x2(1 x)√2 dx + 0 = √2/12 . (4.6) − − IC ZC1 ZC2 ZC3 Z1 Note that we take the positive root of (ds)2 = 2(dx)2 but use the fact that following the

arrows on C2 the variable x goes from 1 0. → 2 2 2 Example 4) : (see Sheet 2). Find C (x + y + z ) ds where C is the helix r =R ˆi cos θ + jˆ sin θ + kˆθ , (4.7) with one turn : that is θ running from 0 2π . → From (4.7) we note that x = cos θ, y = sin θ and z = θ. Therefore dx = sin θdθ, − dy = cos θdθ and dz = dθ. Thus (ds)2 = sin2 θ + cos2 θ + 1 (dθ)2 = 2(dθ)2 . (4.8) Therefore we can write the integral as  2π (x2 + y2 + z2) ds = √2 1 + θ2 dθ = 2π√2 1 + 4π2/3 . (4.9) ZC Z0 End of L4  

4.2 Line integrals of Type 2 : C F (x, y, z) dr B ∙ δs R

δr F r + δr A r

O Figure 3.4 : A vector F and a curve C with the chord δr : O is the origin. (L5) 14th/10/10 (EE2Ma-VC.pdf) 12

1. Think of F as a force on a particle being drawn through the path of the curve C. Then the work done δW in pulling the particle along the curve with arc length δs and chord δr is δW = F δr. Thus the full work W is ∙ W = F dr . (4.10) ∙ ZC 2. The second example revolves around taking F as an electric field E(x, y, z). Then the mathematical expression of Faraday’s Law says that the electro-motive force on a particle of charge e travelling along C is precisely e E(x, y, z) dr . C ∙ R Example 1 : Evaluate F dr given that F = ˆix2y + jˆ(x z) + kˆxyz and the path C is C ∙ − the parabola y = x2 in the plane z = 2 from (0, 0, 2) (1, 1, 2). R y →

(1, 1)

2 C1 is along the curve y = x in the plane z = 2 in which case dz = 0 and dy = 2x dx. C2 is along the straight line y = x in which case dy = dx. C2 C1 % %

x

F dr = (F1dx + F2dy + F3dz) ∙ ZC1 ZC1 = x2y dx + (x z) dy + xyz dz − ZC1  = x2y dx + (x 2) dy (4.11) − ZC1  Using the fact that dy = 2x dx we have

1 I = x4 dx + (x 2)2x dx − Z0 1  = x4 + 2x2 4x dx = 17/15 . (4.12) − − Z0  Finally, with the same integrand but along C2 we have

1 F dr = x3 dx + (x 2) dx ∙ − ZC2 Z0 = 1/4 + 1/2 2 = 5/4 . (4.13) − − This example illustrates the point that with the same integrand and start/end points the value of an integral can differ when the route between these points is varied. 14th/10/10 (EE2Ma-VC.pdf) 13

Example 2 : Evaluate I = (y2dx 2x2dy) given that F = (y2, 2x2) with the path C C − − taken as y = x2 in the z = 0 plane from (0, 0, 0) (2, 4, 0). y R →

(2, 4) C is the curve y = x2 in the plane z = 0, in which case dz = 0 and dy = 2x dx. The starting point has co-ordinates (0, 0, 0) and the end point (2, 4, 0). C

x

I = (y2dx 2x2dy) C − Z 2 = x4 4x3 dx = 48/5 . (4.14) − − Z0  Example 3 : Given that F = ˆix jˆz + 2kˆy, where C is the curve z = y4 in the x = 1 plane, − show that from (1, 0, 0) (1, 1, 1) the value of the line integral is 7/5. → On C we have dz = 4y3dy and in the plane x = 1 we also have dx = 0. Therefore

F dr = (x dx z dy + 2y dz) C ∙ C − Z Z 1 = y4 + 8y4 dy = 7/5 . (4.15) − Z0  End of L5

4.3 Independence of path in line integrals of Type 2 (L6) Are there circumstances in which a line integral F dr, for a given F , takes values C ∙ which are independent of the path C? R To explore this question let us consider the case where F dr is an exact differential : that is ∙ F dr = dφ for some scalar8 φ. For starting and end co-ordinates A and B of C we have ∙ − F dr = dφ = φ[A] φ[B] . (4.16) ∙ − − ZC ZC This result is independent of the route or path taken between A and B. Thus we need to know what F dr = dφ means. Firstly, from the chain rule ∙ − ∂φ ∂φ ∂φ dφ = dx + dy + dz = φ dr . (4.17) ∂x ∂y ∂z ∇ ∙

8As stated earlier, the choice of sign is by convention. 14th/10/10 (EE2Ma-VC.pdf) 14

Hence, if F dr = dφ we have F = φ, which means that F must be a curl-free ∙ − −∇ vector field curl F = 0 , (4.18) where φ is the scalar potential. A curl-free F is also known as a conservative vector field. Result : The integral F dr is independent of path only if curl F = 0. Moreover, when C C ∙ is closed then R F dr = 0 . (4.19) ∙ IC

2 2 Example 1 : Is the line integral C (2xy dx + 2x y dy) independent of path? We can see that F is expressed asR F = 2xy2ˆi + 2x2yjˆ + 0kˆ. Then

ˆi jˆ kˆ ˆ curl F = ∂x ∂y ∂z = (4xy 4xy)k = 0 . (4.20) 2 2 − 2xy 2x y 0

Thus the integral is independent of path and we should be able to calculate φ from F = φ. −∇ ∂φ ∂φ ∂φ = 2xy2 , = 2x2y , = 0 . (4.21) − ∂x − ∂y − ∂z

Partial integration of the 1st equation gives φ = x2y2 + A(y) where A(y) is an arbitrary − function of y only, whereas from the second φ = x2y2 + B(x). Thus A(y) = B(x) = − const = C. Hence φ = x2y2 + C. (4.22) − Example 2 : Find the work done F dr by the force F = (yz, xz, xy) moving from C ∙ (1, 1, 1) (3, 3, 2). → R Is this line integral independent of path? We check to see if curl F = 0.

ˆi jˆ kˆ curl F = ∂x ∂y ∂z = 0 . (4.23)

yz xz xy

Thus the integral is independent of path and φ must exist. In fact φx = yz, φy = xz − − and φz = xy. Integrating the first gives φ = xyz + A(y, z), the second gives φ = − − xyz + B(x, z) and the third φ = xyz + C(x, y). Thus A = B = C = const and − − φ = xyz + const . (4.24) − (3,3,2) (3,3,2) W = dφ = xyz = 18 1 = 17 . (4.25) − (1,1,1) − Z(1,1,1)   14th/10/10 (EE2Ma-VC.pdf) 15

Example 3 : Find F dr on every path between (0, 0, 1) and (1, π/4, 2) where C ∙ RF = 2xyz2, (x2z2 + z cos yz), (2x2yz + y cos yz) . (4.26)

We check to see if curl F= 0. 

ˆi jˆ kˆ curl F = ∂x ∂y ∂z = 0 . (4.27) 2 2 2 2 2xyz (x z + z cos yz) (2x yz + y cos yz)

2 Thus the integral is independent of path and φ must exist. Then φx = 2xyz , φy = 2 2 2 − (x z + z cos yz) and φz = (2x yz + y cos yz). Integration of the first gives − − φ = x2yz2 + A(y, z) , (4.28) − of the second φ = (x2yz2 + sin yz) + B(x, z) , (4.29) − and the third φ = (x2yz2 + sin yz) + C(x, y) . (4.30) − The only way these are compatible is if A(y, z) = sin yz + c and B = C = c = const. and so φ = (x2yz2 + sin yz) + c. In consequence − (1,π/4, 2) F dr = φ = π + 1 . End of L6 (4.31) ∙ − (0,0,1) ZC   5 Double and multiple integration

(L7) Now we move on to yet another different concept of integration : that is, summation over an area instead of along a curve.

Consider the value of a scalar function ψ(xi, yi) at the co-ordinate point (xi, yi) at the lower left hand corner of the square of area δAi = δxiδyi. Then

N M

ψ(xi, yi) δAi ψ(x, y) dxdy as δx 0, δy 0 . (5.1) → → → i=1 j=1 ZZR X X double integral

We say that the RHS is the “double| integral{z of ψ over } the region R”. Note : do not confuse this with the area of R itself, which is

Area of R = dxdy . (5.2) ZZR 14th/10/10 (EE2Ma-VC.pdf) 16

5.1 How to evaluate a double integral y

y = h(x)

R

y = g(x)

x a b Figure 4.2 : The region R is bounded between the upper curve y = h(x), the lower curve y = g(x) and the vertical lines x = a and x = b.

b y=h(x) ψ(x, y) dxdy = ψ(x, y) dy dx (5.3) ZZR Za (Zy=g(x) ) The inner integral is a partial integral over y holding x constant. Thus the inner integral is a function of x y=h(x) ψ(x, y) dy = P (x) (5.4) Zy=g(x) and so b ψ(x, y) dxdy = P (x) dx . (5.5) ZZR Za Moreover the area of R itself is

b y=h(x) b Area of R = dy dx = h(x) g(x) dx (5.6) { − } Za (Zy=g(x) ) Za 5.2 Applications 1. Area under a curve˙: For a function of a single variable y = f(x) between limits x = a and x = b b f(x) b Area = dy dx = f(x) dx . (5.7) Za (Z0 ) Za 2. Volume under a surface : A surface is 3-space may be expressed as z = f(x, y)

f(x,y) Volume = dxdydz = dz dxdy ZZZV ZR (Z0 ) = f(x, y) dxdy (5.8) ZZR 14th/10/10 (EE2Ma-VC.pdf) 17

By this process, a 3-integral has been reduced to a double integral. A specific example would be the volume of an upper unit hemisphere z = + 1 (x2 + y2) f(x, y) − ≡ centred at the origin. p 3. Mass of a solid body : Let ρ(x, y, z) be the variable density of the material in a solid body. Then the mass δM of a small volume δV = δxδyδz is δM = ρ δV , End of L7

Mass of body = ρ(x, y, z) dV . (5.9) ZZZV 5.3 Examples of multiple integration L8 Example 1 : Consider the first quadrant of a circle of radius a. Show that : y

i πa2/ (0, a) ( ) Area of R = 4 C (ii) xy dxdy = a4/8 ZZR x, y ( ) (iii) x2y2 dxdy = πa6/96 R ZZR x (0, 0) (a, 0) i) : The area of R is given by

a √a2 x2 a − A = dy dx = √a2 x2 dx . (5.10) − Z0 (Z0 ) Z0 π/2 Let x = a cos θ and y = a sin θ then A = 1 a2 (1 cos 2θ) dθ = πa2/4. 2 0 − ii) : R a √a2 x2 − xy dxdy = x y dy dx ZZR Z0 Z0 ! a 1 2 2 = 2 x(a x ) dx 0 − Z a = 1 1 x2a2 1 x4 = a4/8 . (5.11) 2 2 − 4 0 iii) :   a √a2 x2 − x2y2 dxdy = x2 y2 dy dx ZZR Z0 Z0 ! a 1 2 2 2 3/2 = 3 x (a x ) dx 0 − Z π/2 1 6 2 4 = 3 a cos θ sin θ dθ Z0 1 6 = a I2 I3 . (5.12) 3 −  14th/10/10 (EE2Ma-VC.pdf) 18

π/2 2n where In = 0 sin θ dθ. Using a Reduction Formula method we find that R 2n 1 In = − In 1 ,I0 = π/2 . (5.13) 2n −   6 Thus I2 = 3π/16 and I2 = 15π/96 and so from (5.12) the answer is πa /96.

5.4 Change of variable and the Jacobian In the last example it might have been easier to have invoked the natural circular symmetry in the problem. Hence we must ask how δA = δxδy would be expressed in polar co-ordinates. This suggests considering a more general co-ordinate change. In the two figures below we see

a region R in the x y plane that is distorted into R∗ in the plane of the new co-ordinates − u = u(x, y) and v = v(x, y) y v

R R∗

x u The transformation relating the two small areas δxδy and δuδv is given here by (the modulus sign is a necessity) : Result 1 :

dxdy = Ju,v(x, y) dudv , (5.14) | | where the Jacobian Ju,v(x, y) is defined by

∂x ∂x ∂u ∂v Ju,v(x, y) = ∂y ∂y (5.15) ∂u ∂v

Note that 1 ∂x ∂u − = (5.16) ∂u 6 ∂x   because ux is computed at y = const whereas xu is computed at v = const. However, luckily there is an inverse relationship between the two Jacobians

1 Jx,y(u, v) = [Ju,v(x, y)]− (5.17)

dudv = Jx,y(u, v) dxdy (5.18) | | Either (5.14) and (5.18) can therefore be used at one’s convenience. 14th/10/10 (EE2Ma-VC.pdf) 19

Proof : (not examinable). Consider two sets of orthogonal unit vectors ; (ˆi , jˆ) in the x y- − plane, and (uˆ , vˆ) in the u v-plane. Keeping in mind that the component of δx along uˆ is − (δx/δu)δu (v is constant along uˆ), in vectorial notation we can write δx δx δx = uˆ δu + vˆ δv (5.19) δu δv δy δy δy = uˆ δu + vˆ δv (5.20) δu δv and so the cross-product is δx δx δy δy δx δy = uˆ δu + vˆ δv uˆ δu + vˆ δv , (5.21) × δu δv × δu δv     Therefore

∂x ∂x dx dy = δx δy = det ∂u ∂v uˆ vˆ dudv | × | ∂y ∂y | × |  ∂u ∂v 

= Ju,v(x, y) dudv . (5.22) | | The inverse relationship (5.18) can be proved in a similar manner  Result 2 :

f(x, y) dxdy = f(x(u, v), y(u, v)) Ju,v(x, y) dudv . (5.23) | | ZZR ZZR∗ Example 1 : For polar co-ordinates x = r cos θ and y = r sin θ we take u = r and v = θ

∂x ∂x ∂r ∂θ cos θ r sin θ Jr,θ(x, y) = = − = r (5.24) ∂y ∂y sin θ r cos θ ∂r ∂θ

Thus dxdy = r drdθ . Example 2 : To calculate the volume of a sphere of radius a we note that z = a2 x2 y2. ± − − Doubling up the two hemispheres we obtain p

Volume = 2 a2 x2 y2 dxdy (5.25) R − − ZZ p where R is the circle x2 + y2 = a2 in the z = 0 plane. Using a change of variable

Volume = 2 a2 x2 y2 dxdy R − − ZZ p = 2 √a2 r2 rdrdθ R − ZZa 2π = 2 √a2 r2 rdr dθ − Z0 Z0 = 4πa3/3 . (5.26) 14th/10/10 (EE2Ma-VC.pdf) 20

Example 3 : From the example in 5.3 over the quarter circle in the first quadrant it would § be easier to compute in polars. Thus

Area of R = dxdy = rdrdθ R R ZZa π/2 ZZ = rdr dθ = πa2/4 (5.27) Z0 Z0

xy dxdy = r3 cos θ sin θdrdθ R R ZZ ZZa π/2 = r3dr cos θ sin θdθ 0 0 Z π/2Z 1 4 1 = 4 a 2 sin 2θdθ Z0 = (a4/16)[ cos 2θ]π/2 = a4/8 . (5.28) − 0 Likewise one may show that

x2y2 dxdy = r5 cos2 θ sin2 θ drdθ R R ZZ ZZa π/2 = r5dr cos2 θ sin2 θdθ = πa6/96 . (5.29) Z0 Z0 Example 4 : Show that (x2 + y2) dxdy = 8/3 using u = x + y and v = x y. where R R − has corners at (0, 0), (1, 1), (2, 0) and (1, 1) and rotates to a square with corners at (0, 0), RR − (2, 0), (2, 2) and (0, 2). From x = 1 (u + v) and y = 1 (u v) it is found that 2 2 −

1 Ju,v(x, y) = (5.30) − 2

I = 1 2(u2 + v2) 1 dudv 4 |− 2 | ZZR∗ 2 2 2 2 1 1 u3 v 1 v3 u / . = 4 3 0 [ ]0 + 3 0 [ ]0 = 8 3 (5.31) n    o End of L8

5.5 Changing the order in double integration

In a handout, not in lectures. An example is used to illustrate this : consider

a a x2 dx I = dy . (5.32) x2 + y2 Z0 Zy  14th/10/10 (EE2Ma-VC.pdf) 21

1 a Performing the integration in this order is hard as it involves a term in tan− y . To make evaluation easier we change the order of the x-integration and the y-integration; first, however, we must deduce what the area of integration is from the internal limits in (5.32). The internal integral is of the type x=a f(x, y) dx. (5.33) Zx=y Being an integration over x means that we are summing horizontally so we have left and right hand limits. The left limit is x = y and the right limit is x = a. This is shown in the drawing of the graph where the region of integration is labelled as R:

y

x = y x = a

R

x y = 0 a

Now we want to perform the integration over R but in reverse order to that above: we integrate vertically first by reading off the lower limit as y = 0 and the upper limit as y = x. After integrating horizontally with limits x = 0 to x = a, this reads as

a y=x x2 dy I = dx. (5.34) x2 + y2 Z0 Zy=0  The inside integral can be done with ease. x is treated as a constant because the integration is over y. Therefore define y = xθ where θ is the new variable. We find that

x x2 dy 1 dθ xπ = x = . (5.35) x2 + y2 1 + θ2 4 Z0 Z0 Hence π a I = x dx 4 Z0 πa2 = . (5.36) 8 14th/10/10 (EE2Ma-VC.pdf) 22

6 Green’s Theorem in a plane

L9 Green’s Theorem in a plane – which will be quoted at the bottom of an exam question where necessary – tells us how behaviour on the boundary of a close curve C through a closed line integral in two dimensions is related to the double integral over the region inside R.

Theorem 1 Let R be a closed bounded region in the x y plane with a piecewise smooth − boundary C. Let P (x, y) and Q(x, y) be arbitrary, continuous functions within R having continuous partial derivatives Qx and Py. Then

(P dx + Qdy) = (Qx Py) dxdy . (6.1) − IC ZZR y

C2

y = h(x) C1 R y = g(x)

a b x Figure : In the x y plane the boundary curve C is made up from two counter-clockwise curves − C1 and C2 : R denotes the region inside. Proof : R is represented by the upper and lower boundaries (as in the Figure above) g(x) y h(x) (6.2) ≤ ≤ and so ∂P b y=h(x) ∂P dxdy = dy dx ∂y ∂y ZZR Za (Zy=g(x) ) b = P x, h(x) P x, g(x) dx − Za b  a  = P x, g(x) dx P x, h(x) dx − − Za Zb  switched limits &sign

= P x, y dx |P x, y {zdx } − − ZC1 ZC2   = P x, y dx . (6.3) − IC  14th/10/10 (EE2Ma-VC.pdf) 23

The same method can be used the other way round to prove that (note the +ve sign) ∂Q dxdy = Q x, y dy (6.4) ∂x ZZR IC  Both these results are true separately but can be pieced together to form the final result.  Example 1 : Use Green’s Theorem to evaluate the line integral

(x y) dx x2dy , (6.5) − − I  where R and C are given by y Using G.T. with P = x y and Q = x2 over the − − C3 (2, 2) box-like region R we obtain 2 ←

(x y) dx x2dy = (1 2x) dxdy − − R − C4 R C2 I ZZ ↓ ↑  2 2 = dy (1 2x) dx − Z0 Z0 x = 4 . (6.6) − C1 2 → Direct valuation gives = + + + where C is y = 0 ; C is x = 2 ; C is C C1 C2 C3 C4 1 2 3 y = 2 and C is x = 0. Thus 4 H R R R R 2 2 0 = x dx 4 dy + (x 2) dx + 0 = 2 8 + 2 = 4 . (6.7) − − − − IC Z0 Z0 Z2 Example 2 : Using Green’s Theorem over R in the diagram, show that

y3 dx + (x3 + 3xy2) dy = 3/20 (6.8) I  y

(1, 1) C2

y = x C1 R y = x2

x 14th/10/10 (EE2Ma-VC.pdf) 24

Using Green’s Theorem

y3 dx + (x3 + 3xy2) dy = 3 x2 dxdy I ZZR  1 y=x = 3 x2 dy dx 2 Z0 Zy=x  1 = 3 x3 x4 dx = 3/20 . End of L9 (6.9) − Z0  L10 Example 3 : (Part of 2005 exam) : With a suitable choice of P and Q and R as in the figure, show that 1 (x dy y dx) = dxdy = 1/3 . (6.10) 2 − IC ZZR y

(2, 2)

. y = x

1 2 R y = 2 x %↓

x 1 2

2 x 2 1 2 dxdy = dy dx = x 2 x dx = 1/3 . (6.11) R 1 1 x2 1 − ZZ Z Z 2 ! Z  Around the line integral we have

2 2 1/2 = 1 x2 1 x2 dx + 1 (xdx xdx) + 1 dy 2 − 2 2 − 2 I Z1 Z1 Z1 = 7/12 1/4 = 1/3 . (6.12) −

Example 4 : (Part of 2004 exam) : If Q = x2 and P = y2 and R is as in the figure below, − show that (x2dy y2dx) = 2 (x + y) dxdy = 24/5 . (6.13) − IC ZZR 14th/10/10 (EE2Ma-VC.pdf) 25

y

(2, 2) . y2 = 2x

R % 1 2 y = 2 x

x 2

The RHS is obvious in the sense that Qx Py = 2x + 2y and so − 2 √2x 2 √2x 2 (x + y) dxdy = 2 x dy dx + 2 y dy dx R 0 1 x2 0 1 x2 ZZ Z Z 2 ! Z Z 2 ! 2 = 2 x √2x 1 x2 + 1 2x 1 x4 dx − 2 2 − 4 Z0 2 h  i √ 3/2 1 3 1 4 = 2 2x 2 x + x 8 x dx = 24/5 . (6.14) 0 − − Z h i The sum of the three line integrals can be done to get the same answer.

7 2D Divergence and Stokes’ Theorems B δs

δr

r + δr A r

O Figure 6.1 : On a curve C, with starting and ending points A and B, small elements of arc length δs and the chord δr, where O is the origin. 14th/10/10 (EE2Ma-VC.pdf) 26

The chord δr and the arc δs in the figure show us how to define a unit tangent vector Tˆ δr dr Tˆ = lim = δr 0 δs ds → dx dy = ˆi + jˆ . (7.1) ds ds

The unit normal nˆ must be perpendicular to this : that is nˆ Tˆ = 0, giving ∙ dy dx nˆ = ˆi jˆ , (7.2) ± ds − ds   where refer to inner and outer normals. ± A) The Divergence Theorem : Define a 2D vector u = ˆiQ jˆP . Then − dx dy u nˆ = P + Q div u = Qx Py (7.3) ∙ ds ds −

Thus Green’s Theorem turns into a 2D version of Divergence Theorem

div u dxdy = u nˆ ds (7.4) ∙ ZZR IC This line integral simply expresses the sum of the normal component of u around the boundary. If u is a solenoidal vector (div u = 0) then automatically u nˆ ds = 0. C ∙ 9 The 3D version uses an arbitrary 3D vector field u(x, y, z) thatH lives in some finite, simply connected volume V whose surface is S: dA is some small element of area on the curved surface S div u dV = u nˆ dA (7.5) ∙ ZZZV ZZS

End of L10 B) Stokes’ Theorem : L11 Now define a 2D vector v = ˆiP + jˆQ. Then

v dr = (v Tˆ) ds = P dx + Q dy . (7.6) ∙ ∙ Moreover ˆi jˆ kˆ ˆ curl v = ∂x ∂y ∂z = k (Qx Py) (7.7) − PQ 0

14th/10/10 (EE2Ma-VC.pdf) 27

Thus Green’s Theorem turns into a 2D version of Stokes’ Theorem

kˆ curl v dxdy = v dr (7.8) ∙ ∙ ZZR IC  The line integral on the RHS is called the circulation. Note that if v is an irrotational vector then v dr = 0 which means there is no circulation. C ∙ The 3D-versionH of Stokes’ Theorem for an arbitrary 3D vector field v(x, y, z) in a volume V is given by v dr = nˆ curl v dA . (7.9) ∙ ∙ IC ZZS nˆ is the unit normal vector to the surface S of V . C is a closed circuit circumscribed on the surface of the volume and S is the surface of the ‘cap’ above C.

Example 1 : (part of 2002 exam) If v = ˆiy2 + jˆx2 and R is as in the figure below, by evaluating the line integral, show that

v dr = 5/48 . (7.10) ∙ IC y

y = x

C3 . C2 y = x ↑ R

C1 & y = 1/(4x) 1 x 2 1 Firstly v dr = y2dx + x2dy . (7.11) ∙ I IC 2  (i) On C1 we have y = 1/(4x) and so dy = dx/(4x ). Therefore − 1 1 1 1 v dr dx . = 2 = (7.12) C ∙ 1 16x − 4 −16 Z 1 Z 2  

(ii) On C2 we have x = 1 and so dx = 0. Therefore 1 3 v dr = dy = . (7.13) C ∙ 1 4 Z 2 Z 4 14th/10/10 (EE2Ma-VC.pdf) 28

(iii) On C3 we have y = x and so dy = dx. Therefore

1 2 7 v dr = 2 x2 dx = . (7.14) ∙ −12 ZC3 Z1 Summing these three results gives 1 + 3 7 = 5 . − 16 4 − 12 48 Example 2 : (part of 2003 exam) If

x2y u = ˆi + jˆ x ln(1 + y2) (7.15) 1 + y2   and R is as in the figure below, show that

div u dxdy = 2 ln 2 1 . (7.16) − ZZR

y

C3 . C2 ↑ y = x R x C1 1 → Firstly we calculate div u 4xy div u = (7.17) 1 + y2 and so xy div u dxdy = 4 dxdy 1 + y2 ZZR ZZR 1 y=x y dy = 4 x dx 1 + y2 Z0 Zy=0 Z  1 x x 1 y2 dx = 4 2 ln(1 + ) 0 Z0 1   = 2 x ln(1 + x2) dx Z0 = 2 ln 2 1 (7.18) − End of L11 14th/10/10 (EE2Ma-VC.pdf) 29

8 Maxwell’s Equations

L12 Maxwell’s equations are technically not in my syllabus but I give this lecture to tie every- thing together in a physical context. Consider a 3D volume with a closed circuit C drawn on its surface. Let’s use the 3D versions of the Divergence (7.5) and Stokes’ Theorems (7.9) to derive some relationships between various electro-magnetic variables.

1. Using the charge density ρ, the total charge within the volume V must be equal to surface area integral of the electric flux density through the surface S (recall that D = E where E is the electric field). D ρ dV = nˆ dA . (8.1) D ∙ ZZZV ZZS Using a 3D version of the Divergence Theorem (7.5) above on the RHS of (8.1)

ρ dV = div dV . (8.2) D ZZZV ZZZV Hence we have the first of Maxwell’s equations

div = ρ (8.3) D This is also known as Gauss’s Law.

2. Following the above in the same manner for the magnetic flux density B (recall that B = μH where H is the magnetic field) but noting that there are no magnetic sources

(so ρmag = 0), we have the 2nd of Maxwell’s equations

div B = 0 (8.4)

3. Faraday’s Law says that the rate of change of magnetic flux linking a circuit C is proportional to the electromotive force (in the negative sense). Mathematically this is expressed as d B nˆ dA = E dr (8.5) dt ∙ − ∙ ZZS IC Using a 3D version of Stokes’ Theorem (7.9) on the RHS of (8.4), and taking the time derivative through the surface integral (thereby making it a partial derivative) we have the 3rd of Maxwell’s equations

∂B curl E + = 0 (8.6) ∂t 14th/10/10 (EE2Ma-VC.pdf) 30

4. Amp`ere’s(Biot-Savart) Law expressed mathematically (the line integral of the magnetic field around a circuit C is equal to the current enclosed) is

J nˆ dA = H dr , (8.7) ∙ ∙ ZZS IC where J is the current density and H is the magnetic field. Using 3D-Stokes’ Theorem (7.9) on the RHS we find that we have curl H = J and therefore div J = 0, which is inconsistent with the first three of Maxwell’s equations. Why? The continuity equation for the total charge is d ρ dV = J nˆ dA . (8.8) dt − ∙ ZZZV ZZS Using the Divergence Theorem on the LHS we obtain ∂ρ div J + = 0 . (8.9) ∂t If div J = 0 then ρ would have to be independent of t. To get round this problem we use Gauss’s Law ρ = div expressed above to get D ∂ div J + D = 0 (8.10) ∂t   and so this motivates us to replace J in curl H = J by J + ∂ /∂t giving the 4th of D Maxwell’s equations ∂ curl H = J + D (8.11) ∂t

5. We finally note that because div B = 0 then B is a : there must exist a vector potential A such that B = curl A. Using this in the 3rd of Maxwell’s equations, we have ∂A curl E + = 0 . (8.12) ∂t   This means that there must also exist a scalar potential φ that satisfies ∂A E = φ . (8.13) − ∂t − ∇

End of L12 and the Vector Calculus part of EE2 Maths.