<<

Analysis in Many Variables 2019-20 Epiphany Term Epiphany AMV Notes 3

Contents

12 Convergence of Fourier series 61 12.1 Proving convergence ...... 61 12.2 Functions with discontinuities ...... 64 12.3 The Gibbs phenomenon ...... 68

13 Generalised functions 71

14 Proofs of the three big theorems 78 14.1 Green’s theorem in the plane ...... 78 14.2 Stokes’ theorem ...... 79 14.3 The divergence theorem ...... 82 14.4 Further examples ...... 85 12 Convergence of Fourier series

So far we have used Fourier series to represent various functions f(x). Depending on the boundary P∞ nπx conditions, we’ve seen the sine Fourier series f(x) = n=1 Bn sin( L ), the cosine Fourier series f(x) = P∞ nπx P∞ 2πinx/L n=0 An cos( L ), and the exponential Fourier series f(x) = n=−∞ Ane , all on 0 ≤ x ≤ L, with the boundary conditions being Dirichlet, Neumann and periodic respectively.

In each case we used a version of the ‘Fourier Trick’ to find the coefficients An or Bn in these series, under the assumption that they could converge to the right answers. Now we must consider whether these series representations truly give us the f(x): can the Fourier series converge to f(x) at all, and if so, for what types of functions f(x) does this work? Note, the material in this chapter is not examinable - though it is interesting! It also provides some motivation for the following chapter, on generalised functions, which is examinable.

12.1 Proving convergence

For simplicity we’ll restrict attention to the exponential Fourier series, and set L = 2π. Then the basic claim is that for at least some functions f we can write

∞ X iny f(y) = Ane n=−∞ on 0 ≤ y ≤ 2π. (I’ve used y instead of x here as x is being saved for the variable in the Fourier integral.) As in last year’s analysis course, the precise meaning of the right hand side of this equation is the limit of a sequence of partial sums, and so we need to examine the truncated series SN (y), where

N X 1 Z 2π S (y) = A einy,A = f(x)e−inx dx . (12.1) N n n 2π n=−N 0

and N ∈ Z+. The hope is to show that

lim SN (y) = f(y) N→∞

which will be enough to establish pointwise convergence of the partial Fourier sums to the desired answer. To start with we will suppose that f is periodic on [0, 2π], and continuously differentiable there. We manipulate SN (y) as follows:

N X iny SN (y) = An e substitute for An n=−N N X  1 Z 2π  = f(x) e−inx dx einy now swap the sum and integral 2π n=−N 0 N Z 2π 1 X = f(x) e−in(x−y) dx . 2π 0 n=−N

61 (Note, there is no problem swapping the sum and the integral here since the sum is finite.) Now

N 2N 1 X 1 X e−inx = eiNx e−inx pulling out a factor and changing the limits 2π 2π n=−N n=0 −i(2N+1)x 1 (1 − e ) n+1 = eiNx using the geometric sum formula Pn rk = 1−r 2π (1 − e−ix) k=0 1−r 1 (ei(N+1/2)x − e−i(N+1/2)x) e−i(N+1/2)x = eiNx 2π (eix/2 − e−ix/2) e−ix/2 1 1 sin((N + 2 )x) 1 iα −iα = 1 . using sin α = (e − e ), twice 2π sin( 2 x) 2i Thus Z 2π 1 1 sin((N + 2 )(x − y)) SN (y) = f(x) 1 dx (12.2) 0 2π sin( 2 (x − y)) Z 2π 1 (x − y) sin((N + 2 )(x − y)) = f(x) 1 dx (12.3) 0 2 sin( 2 (x − y)) π(x − y) Z 2π = fe(y)(x) hN (x − y) dx (12.4) 0 where sin((N + 1 )x) h (x) = 2 (12.5) N πx and, for x 6= y, (x − y) fe(y)(x) = f(x) 1 . 2 sin( 2 (x − y))

Note that limx→y fe(y)(x) = f(y). Hence if set fe(y)(y) = f(y), then fe(y)(x) is a of x with the same value at x = y as f has there. Thus, if we could show that Z 2π lim fe(y)(x)hN (x − y) dx = fe(y)(y) N→∞ 0 then we would be done, given that fe(y)(y) = f(y). From now on we’ll set y = 0 and write fe(0)(x) as fe(x) to save ink, but the arguments work exactly the same for any non-zero value of y, after a simple change of variables. Our aim has become to show that, for any continuously differentiable function fe(x), Z 2π lim fe(x)hN (x) dx = fe(0) . (12.6) N→∞ 0

To this end, let’s investigate the function hN (x), as defined by equation (12.5)), and its behaviour as N → ∞. The left side of figure 30 shows hN (x) for two different values of N: the top plot showing h10(x) and the bottom one h100(x). Note that the vertical scales are not the same! Comparing these two plots, there are a couple of notable features:

• For x 6= 0, hN (x) oscillates with increasing frequency as N increases. N+1/2 • At x = 0, hN (0) = limx→0 hN (x) = π , and grows with N.

Thus limN→∞ hN (x) is not a well-defined function. However, all we really care about is the integral of hN (x) multiplied by some other function, and this might be better behaved as N → ∞.

Let’s pick some a0 < 0 and define Z x 0 0 gN (x) = hN (x ) dx (12.7) a0

62 Figure 30: Plots of hN (x) (left) and gN (x) (right), for N = 10 (top) and N = 100 (bottom). (For animated versions of these plots, see http://maths.dur.ac.uk/users/P.E.Dorey/AMV/hNandgN.html.)

Plots of g10(x) and g100(x) are shown on the right side of figure 30, for a0 = −2. We see that gN (x) does not diverge as N → ∞, but rather appears to converge to a step function:  1 x > 0 ; g (x) → N 0 x < 0 .

(Though, there does seem to be something slightly odd going on near to x = 0; this is related to the Gibbs phenomenon, which will be discussed at the end of this chapter.) Later on we will prove that this is indeed the case, by showing that {hN (x)} is an example of a δ-convergent sequence, defined as follows:

Definition: A sequence {hN (x)} is called a δ-convergent sequence if:  b 1 a < 0 < b (I) lim R h (x) dx = N→∞ a N 0 a < b < 0 or 0 < a < b R b (II) for any M > 0 and |a| ≤ M, |b| ≤ M, | a hN (x) dx| < γ, where γ is some constant independent of a, b and N.

This next step is the key to the proof of the convergence of the truncated Fourier sums. It follows from the fact that hN (x) is a δ-convergent sequence. Let’s take a < 0 < b, and use our assumption that f(x), the function whose Fourier series we are looking at, is differentiable in the interval [a, b] (soon we will 0 relax this a bit, but let’s make life easy to begin with). Since hN (x) = gN (x), we can integrate by parts to find: Z b Z b Z b 0  b 0 hN (x)f(x) dx = gN (x)f(x) dx = gN (x)f(x) a − gN (x)f (x) dx . a a a

Taking the limit N → ∞ allows us to replace gN (x) by 0 for x < 0 and by 1 for x > 0 (part II of the definition of δ-convergence allows us to take this limit inside the integral sign), so in the limit the

63 right-hand side becomes

Z b 0 b 1.f(b) − 0.f(a) − f (x)dx = f(b) − [f(x)]0 = f(0) . 0 Hence Z b lim hN (x)f(x)dx = f(0) when a < 0 < b (12.8) N→∞ a which is exactly what we wanted to show. R b We’ll write the LHS of (12.8) as a δ(x)f(x)dx, thereby defining δ(x), the . It is not a function in the usual sense, but is rather defined by its value when multiplied by another (better- behaved) function and integrated. Shifting the integration variable from x to x − c its key property can be summed up as follows:

Definition: Equation (12.8) defines the Dirac delta function δ(x), and can be symbolised in a neat, general form as: Z b δ(x − c)f(x)dx = f(c) when a < c < b . (12.9) a

If we apply this definition (and convergence result) to our original goal, equation (12.6), we see that the Fourier series representation of the function f(x) does indeed converge:

Z 2π Z 2π lim f(y)hN (y − x)dy = δ(y − x)f(y)dy = f(x) . N→∞ 0 0

The Dirac delta function is not a traditional function since it is not defined like a normal function – it does not have numerical values for each value of x. It is something that appears inside an integral and is defined (as above) by its action within the integral. The Dirac delta function is one of a group of objects called Generalised Functions (or distributions). We will come back to these in more detail in the next chapter.

Note that (12.9) looks a little like the result δijaj = ai that we saw when discussing index notation and the Kronecker delta, with the implied summation from the repeated index being replaced by the integral over x. This isn’t a bad analogy and gets even better if you think (as in numerical analysis courses) of approximating f(x) by its values at a discrete set of points. However for now it is best to keep the two concepts separated, and remember that δ(x) is the Dirac delta function, defined via its action inside integrals, while δij is the more straightforward Kronecker delta, as defined last term.

12.2 Functions with discontinuities

Now we return to the question of which functions have a Fourier series representation. In general this is a tough question, but for so-called piecewise smooth functions the story is a straightforward generalisation of what we’ve already seen. In order to define a piecewise smooth function, we must first define a piecewise continuous function.

Definition: A function f(x) is piecewise continuous for x ∈ (a, b) if the interval (a, b) can be divided into a finite number of sub-intervals such that: • f(x) is continuous in the interior of each subinterval; • f(x) tends to a finite limit on the boundary of each sub-interval as approached from the interior of that sub-interval.

Figure 31 shows a piecewise continuous function. You can see that it satisfies the requirements: (1) the interval (a, b) is divided into a finite number of sub-intervals; (2) the function is continuous in each

64 sub-interval; and (3) the function has finite limits at each end of the sub-interval as approached from within the sub-interval.

Figure 31: A piecewise continuous function on the interval (a, b).

Now a piecewise smooth function is defined as follows.

Definition: A function f(x) is piecewise smooth for x ∈ (a, b) if: • It is piecewise continuous; • It has piecewise continuous first .

Let us look at an example of a piecewise smooth function and a function which is not piecewise smooth. Example 24 We will check that the following function is piecewise smooth on x ∈ (−π, π):  x, −π < x ≤ 0 f(x) = . π, 0 < x < π First observe that we can split the interval into two sub-intervals, (−π, 0) and (0, π), and that within each of this (finite) set of sub-intervals, the function is continuous (i.e. no jumps/discontinuities).

Also we can see that on the first sub-interval (−π, 0), limx→−π+ f(x) = −π and limx→0− f(x) = 0, where the + and − mean that we are approaching from above and below respectively (i.e. from the interior). And on the second sub-interval (0, π), limx→0+ f(x) = π and limx→π− f(x) = π. Since all these limits are finite we can say that the function is piecewise continuous. We now must check whether the first of f(x) is also piecewise continuous. The first derivative is given by:  1, −π < x < 0 f 0(x) = . 0, 0 < x < π Since f 0(x) is a finite constant in both sub-intervals, it is continuous and has finite limits at the ends of the sub-intervals. We conclude that this f(x) satisfies both conditions required to be piecewise smooth. Example 25 Now let us look at g(x) = tan(x), and decide whether it is piecewise smooth on (−π, π). Recall the graph of g(x) = tan(x), shown over a somewhat greater range in figure 32 below. From the graph, it’s clear that tan(x) cannot be piecewise continuous on (−π, π) and so it is not piecewise smooth. The interval will have to be split at −π/2 and π/2, after which g(x) is indeed continuous on each subinterval. However it does not tend to a finite limit at the end of each: as x → ±π/2 from either side, |g(x)| → ∞.

65 Figure 32: The graph of g(x) = tan(x).

Clearly within each ‘piece’ of a piecewise smooth function the Fourier series can be calculated as before, since there are no discontinuities or jumps inside these sub-intervals. The problem arises at the boundaries of the sub-intervals where the function, f(x), jumps from one value to another. Figure 33 shows a function f(x) which is piecewise smooth on (a, b), with a jump discontinuity at x = c. We also note that at the point of a jump discontinuity the derivative of f(x) is not defined.

Figure 33: A piecewise smooth function with the values of the function either side of the discontinuity at x = c labelled as f+ and f− respectively.

If f(x) is piecewise smooth for each segment in a ≤ x ≤ b and hN (x) = hN (−x) (i.e. hN is even, which 1 sin((N+ 2 )x) is the case for our hN (x) = x ), then, using the same type of argument as before, it can be 2π sin( 2 ) shown that Z b 1 lim f(x)hN (x − c)dx = (f+(c) + f−(c)) a ≤ c ≤ b. (12.10) N→∞ a 2

Therefore we can conclude that our Fourier series can represent our function f(x), even when there is a discontinuity in f(x).

66 If the function f(x) is piecewise smooth on x ∈ (a, b) then the sequence of truncated Fourier series converges as follows: 1   lim SN (x) → lim f(y) + lim f(y) N→∞ 2 y↓x y↑x  f(x) if f is continuous at x = average of f(x) across jump at a discontinuity in f(x)

(y ↓ x and y ↑ x denote the one-sided limits as y approaches x from above or below respectively.)

This means that we can use a Fourier series as long as the function f(x) is piecewise smooth on the domain of x.

Aside: proof of δ-convergence

We wish to show that hN (x) is a δ-convergent sequence and to do so we must show the two properties in the definition. This is bonus (non-examinable) material, using some ideas from complex analysis – if you’re not taking that course then no need to worry. We will begin with property I : Z b  1 a < 0 < b lim hN (x)dx = N→∞ a 0 otherwise. Let’s set Z b IN (a, b) = hN (x)dx a Z b sin((N + 1 )x) = 2 use the substitution y = (N + 1/2)x a πx Z b(N+1/2) sin y = dy. a(N+1/2) πy There are three cases to discuss: (i) For a < 0 < b, we have Z ∞ sin x lim IN (a, b) = dx , N→∞ −∞ πx R eiz and we want to show that it equals 1. Consider the contour integral IC = πz dz taken over the closed contour shown in figure 34. This encloses no poles, so IC = 0 by Cauchy’s theorem. The contribution of the large semi-circle is exponentially damped as z has a positive imaginary part there. Since eiz = cos z + i sin z, the integral we want is equal to the imaginary part of the contribution from the real axis, and this must be minus the imaginary part of the contribution from the small semi-circle iz Cε (since the whole contour integral is zero). On Cε we can approximate e by 1, giving the integral R dz Iε = = −i, which has an imaginary part equal to −1. (Recall that for C an anticlockwise contour Cε iπz R dz all the way round the origin, C z = 2πi. The contour Cε only goes half-way round, and in a clockwise sense, so the result follows.) Hence the imaginary part of the integral along the real axis is equal to 1, as required. ˆ 1 (ii) For a < b < 0, and setting N = N + 2 , ˆ ˆ Z bN sin x h cos xibNˆ Z bN cos x dx = − − dx . ˆ 2 aNˆ πx πx aN aNˆ πx The first term goes to zero as N and hence Nˆ → ∞ whilst the second is bounded by terms that vanish in this limit: ˆ ˆ Z bN cos x Z bN 1 1 | 2 dx| < 2 dx < → 0 . aNˆ πx aNˆ πx |a|Nˆ (iii) Similarly for 0 < a < b.

67 ˆ ˆ R bNˆ sin x R π sin x Property II : for |aN|, |bN| < π the integrand in IN (a, b) = aNˆ πx dx is positive, and |IN | ≤ −π πx dx. For bNˆ > π, note that ˆ ˆ Z bN sin x h cos xibNˆ Z bN cos x dx = − − 2 dx π πx πx π π πx and ˆ ˆ Z bN cos x Z bN 1 1 | 2 dx| ≤ 2 dx ≤ 2 . π πx π πx π

By breaking the integration range up, these results can be used to bound IN (a, b) by a sum of constants independent of a, b and N, as required.

Figure 34: The contour integral paths.

12.3 The Gibbs phenomenon

Although the partial sums SN (x) converge pointwise to f(x), whenever f has a discontinuity the con- vergence is not uniform – rather, there is an over- (and under-) shoot of about 9% on either side of the discontinuity, which gets closer and closer to the location of the discontinuity as N increases. This is known as the Gibbs phenomenon, though in fact it was first discovered by Henry Wilbraham almost 50 years earlier. As for the rest of this chapter, the material in this section is for interest and won’t be in the exam (at least not this year!). Here is a simple example. Take f(x) to be a simple square wave, a function with period 2π defined by

 1 0 ≤ x < π ; f(x) = (12.11) 0 π ≤ x < 2π .

Then the Fourier coefficients are ( 1 Z π 1 n = 0 ; A = e−inxdx = 2 n 2π i  −inxπ i n 0 2πn e 0 = 2πn ((−1) − 1) n 6= 0 . Thus all even terms apart from n = 0 vanish, while the odd ones combine with their complex conjugates to give a sum of sine terms:

∞ 1 X 2 f(x) = + sin((2m+1)x) . 2 (2m+1)π m=0

68 Sum this series up far enough for any fixed x and it will indeed converge to 1 for 0 < x < π, to 0 for π < x < 2π, and to 1/2 for x = 0 or x = π. (Note with reference back to the last section that in this case it is particularly easy to see that the Fourier series yields the predicted ‘averaged’ value of 1/2 at x = 0 and π, the points of discontinuity.)

However, if we look at the partial sums SN (x), they don’t look so good: their graphs overshoot, and these overshoots do not go away with increasing N, as can be seen by looking at figure 35.

Figure 35: Plots the partial sums SN (x) for f(x) defined by (12.11), for N = 11 (left) and N = 51 (right).

To say something analytic about this situation, we can extend some of the ideas used in the proof of δ-convergence. From the first expression from (12.4) for the partial sum, specialised to this particular f(x), we have Z π 1 1 sin((N + 2 )(y − x)) SN (x) = 1 dy . 0 2π sin( 2 (y − x)) As N gets large the only contribution to this integral comes from near to y = x, since away from that point the fast-oscillating sine function in the numerator cancels itself out (this is basically the same 1 result as needed for properties I (ii) and (iii) of δ-convergence). This allows us to replace sin( 2 (y−x)) 1 by 2 (y−x) in the denominator of the integrand without changing the limiting behaviour as N → ∞, so Z π 1 sin((N + 2 )(y − x)) SN (x) ∼ dy . 0 π(y − x) As N increases we will need to focus more and more closely on a region with a discontinuity in order to see something interesting. We’ll pick the one at x = 0, though the reasoning would apply equally to any of them. With the benefit of hindsight (and perhaps motivated by some numerical experiments) 1 we will zoom in on x = 0 by setting x = t/(N+ 2 ), and deciding to keep t finite as N → ∞; at the 1 same time it is convenient to rescale the integration variable y as well, by substituting y = s/(N+ 2 ), so 1 1 dy = ds/(N+ 2 ). Defining SeN (t) = SN (t/(N+ 2 )), we have

(N+ 1 )π Z 2 sin(s − t) SeN (t) ∼ ds 0 π(s − t) and as N → ∞ the upper limit of integration tends to ∞ and so SeN (t) ∼ Se(t) where Z ∞ sin(s − t) Se(t) = ds . 0 π(s − t)

69 Note that this limiting function is independent of N. This means that by rescaling x suitably with increasing N, we have enabled S to tend to a ‘universal’ shape given by a relatively simple integral. In the physics literature what we’ve taken is sometimes called a double-scaling limit.

Figure 36: The ‘limit shape’ function Se(t).

A plot of Se(t) is shown in figure 36. Given the horizontal rescaling from x to t, it nicely captures the behaviour of the square-wave partial sums shown in figure 35 near to x = 0. In fact we can say more, and find an exact formula for the size of the overshoot. Changing variables twice,

Z ∞ sin s Z t sin s Se(t) = ds = ds . −t πs −∞ πs

The maximum of Se(t) will tell us the size of the overshoot. Differentiating the last expression and using the fundamental theorem of calculus, dSe sin t = dt πt and the stationary points of Se(t) will be found at the zeros of this function, which are the non-zero integer multiples of π. Looking at figure 36, the one corresponding to the global maximum is the first 1 after t = 0, which is at t = π. Hence Semax, the maximum value of Se, is given by Z π sin s Semax = ds = 1.089489872236083635116014422912454870731948710482183073417251852884151851852522 ... −∞ πs and the overshoot is approximately

0.08948987223608363511601442291245487073194871048218307341725185288415185185252192953883417397470521 ...

times the size of the discontinuity, which is indeed about 9%. This number has a special name: it’s called the Wilbraham-Gibbs constant, after its discoverer and re-discoverer.

1 I used Maple, which allows for arbitrary-precision arithmetic, to evaluate the integral for Semax numerically. But best get independent confirmation before relying on all of the digits I have given. . .

70 13 Generalised functions

During our investigation of the convergence of Fourier series, we came across a new ‘function’, the Dirac delta function. This is not a function in the traditional sense but is part of a group of gadgets called generalised functions, which really only make sense inside integrals. They are useful in applications where we come across discontinuities, as in the previous section with piecewise smooth functions, and when dealing with objects such as point masses or charges in physics where at isoloted points the formal mass or charge density could be infinite.

Definitions and a first example

As just mentioned, generalised functions are best defined in terms of their effects inside integrals, as in the definition of the Dirac delta function in equation (12.9). In order to make a more precise definition we need to specify a set (or ‘class’) of test functions, which are essentially very well behaved functions to be integrated against. One way to think about this is to say we need a very well behaved function to deal with a very badly behaved function (like Dirac’s delta). For the remainder of this section f(x) will always be our test function, belonging K, the class of test functions, which we’ll define as follows:

Definition: We will take the class K of test functions to be the set of all functions which: K1) Have finite derivatives of all orders; K2) Vanish outside some bounded region of R. (Though that region may be different for different functions in K.)

In more-fancy language, K1 says that the functions in K should be smooth, while K2 says that they should have compact . Note that if f(x) is a test function then so are xf(x), x2f(x) and so on. (Small exercise: check that you understand why!)

Aside: it’s not completely obvious that K is non-empty: are there are any functions at all that satisfy both K1 and K2? The classic starting-point leading to an affirmative answer to this question is the bump function ψ(x) defined by

( 2 e−1/(1−x ) −1 < x < 1 ; ψ(x) = 0 otherwise and plotted in figure 37.

Figure 37: The bump function ψ(x).

It’s a nice exercise to check that ψ(x) satisfies K1 and K2 (K2 should be easy to see, but K1 is a little harder).

Test functions are used to define what it means for two generalised functions to be equal. The following slightly-convoluted-looking definition is needed since a generalised function does not take numerical values for each x, so we cannot show equality in the usual way. We will use it a lot!

71 Definition: Two generalised functions g(x) and h(x) are said to be equal if: Z ∞ Z ∞ f(x)g(x)dx = f(x)h(x)dx, (13.1) −∞ −∞ for every test function f ∈ K.

Furthermore, we will suppose (or define) the usual operations of substitutions and integrations by parts to work for integrals involving generalised functions just as for those involving ordinary functions. This allows us to use generalised functions to define derivatives of functions we thought of previously as non-differentiable, and to define new generalised functions in terms of ones that we already know (for example, the Dirac delta function). Let us see the effect of integration by parts with a test function, f(x), and some, as yet unspecified, function g(x), to see what happens. All we require of g(x) at the moment is that it is differentiable.

Z ∞  Z ∞ f(x)g0(x)dx = [f(x)g(x)]∞ − f 0(x)g(x)dx from integration by parts  −∞ −∞ −∞ (= 0 by K2) Z ∞ = − f 0(x)g(x)dx. −∞ We now extend this result to define what we mean by g0(x) when g(x) is a generalised function. In this case g(x) might not satisfy the traditional definition of differentiability as per term 1. For example, g might be a step function as in the next example. Example 26 (a) Find the derivative of the Heaviside step function, which is defined as follows:

 1 x > 0 θ(x) = . 0 x < 0

(Technical aside: we’re thinking of θ(x) as a generalised function, so it is only meaningful in terms of the answers that you would get when integrating it against a test function. For this reason there’s no need to worry about its value at x = 0, apart from saying that it should be finite.) In the graph of the Heaviside step function there is a jump discontinuity at x = 0 (see figure 38).

Figure 38: The Heaviside step function.

72 Now using the rules formulated above, Z ∞ Z ∞ f(x)θ0(x)dx = − f 0(x)θ(x)dx by integration by parts and K2 −∞ −∞ Z 0 Z ∞ = − f 0(x)0dx − f 0(x)1dx −∞ 0 Z ∞ = − f 0(x)dx 0 ∞ = − [f(x)]0 = f(0) by K2.

On the other hand, we also have that Z ∞ f(x)δ(x)dx = f(0) by definition of the δ function. (13.2) −∞

R ∞ 0 R ∞ 0 So we have shown that −∞ f(x)θ (x)dx = −∞ f(x)δ(x)dx for all f ∈ K, which means that θ (x) = δ(x) as an equality of generalised functions (equation (13.1)). Thus the Dirac delta function can be used to take the derivative of a function that (traditionally) cannot be differentiated. This wider perspective has many applications.

Proving generalised function identities

We now continue this (long!) example by looking at some other identities involving the Dirac delta function, proving them as equalities of generalised functions, equation (13.1). The method we will use is to integrate both sides of the proposed identity with respect to an arbitrary test function f ∈ K to show the equality (by equation (13.1)). Note that integration by parts and integration by substitution can be used at will – it is part of the definition of a generalised function that it satisfies such operations.

n 0 dδ(x) (n) d δ(x) Some notation: Here δ (x) = dx , and δ (x) = dxn . Do not confuse the (n) with power n; it is the n-th derivative.

Example 26 (b) xδ(x) = 0

Integrate the LHS multiplied by a test function: Z ∞ Z ∞ xδ(x)f(x)dx = δ(x)(xf(x))dx use defining property of the Dirac delta function −∞ −∞

= xf(x)|x=0 = 0.

Integrate RHS multiplied by the same test function: Z ∞ 0.f(x)dx = 0. −∞ Hence (1) holds by equation (13.1), since Z ∞ Z ∞ xδ(x)f(x)dx = 0.f(x)dx = 0. −∞ −∞

73 Example 26 (c) xδ0(x) = −δ(x)

Integrate the LHS multiplied by a test function: Z ∞ Z ∞ xδ0(x)f(x)dx = δ0(x)(xf(x))dx Use integration by parts with xf(x) treated as one function −∞ −∞ Z ∞ ∞ 0 = [xf(x)δ(x)]−∞ − δ(x)(xf(x)) dx by K2, first term disappears −∞ Z ∞ = − δ(x)(xf(x))0dx use definition of Dirac delta −∞ 0 = −(xf(x)) |x=0 use product rule for differentiation = −f(0).

Integrate the RHS multiplied by the same test function: Z ∞ (−δ(x))f(x)dx = −f(0) by definition of Dirac delta. −∞

Finally by equation (13.1) we have that (2) holds, since Z ∞ Z ∞ xδ0(x)f(x)dx = (−δ(x))f(x)dx = −f(0). −∞ −∞ R ∞ Example 26 (d) Evaluate −∞ δ(x−y) f(y) dy . Substitute z = x − y, so dz = −dy and

Z ∞ Z −∞ Z ∞ δ(x−y) f(y) dy = − δ(z) f(x−z) dz = δ(z) f(x−z) dz = (f(x−z))|z=0 = f(x) −∞ ∞ −∞ (Note, the initial formula here is sometimes used as the definition of δ(x), but this example shows how to derive it from a simpler property.) R ∞ Example 26 (e) Evaluate −∞ δ(2x) f(x) dx . Substitute z = 2x, so dz = 2dx and

Z ∞ 1 Z ∞ 1 δ(2x) f(x) dx = δ(z) f(z/2) dz = f(0) . −∞ 2 −∞ 2

1 Note, this proves that δ(2x) = δ(x) 2

Example 26 (f) xδ(2)(x) = −2δ0(x)

Integrate the LHS multiplied by a test function: Z ∞ Z ∞ xδ(2)(x)f(x)dx = δ(2)(x)(xf(x))dx use integration by parts and K2 −∞ −∞ Z ∞ = − δ0(x)(xf(x))0dx and again... −∞ Z ∞ = δ(x)(xf(x))00dx use definition of Dirac delta −∞ 00 = (xf(x)) |x=0 product rule of differentiation 0 00 0 = 2f (0) + xf (x)|x=0 = 2f (0).

74 Now integrate the RHS multiplied by the same test function, by parts: Z ∞ Z ∞ −2δ0(x)f(x)dx = 2 δ(x)f 0(x)dx = 2f 0(0). −∞ −∞ And once again by equation (13.1), we can show that (3) holds since: Z ∞ Z ∞ xδ(2)(x)f(x)dx = −2δ0(x)f(x)dx = 2f 0(0). −∞ −∞

Example 26 (g) h(x)δ(x − y) = h(y)δ(x − y), where h(x) is any differentiable function. Start by integrating the LHS multiplied by a test function: Z ∞ Z ∞ h(x)δ(x − y)f(x)dx = δ(x − y)(h(x)f(x))dx use definition of Dirac delta −∞ −∞

= (h(x)f(x))|x=y = h(y)f(y).

And the RHS: Z ∞ Z ∞ h(y)δ(x − y)f(x)dx = h(y) δ(x − y)f(x)dx use definition of Dirac delta −∞ −∞

= h(y)(f(x))|x=y = h(y)f(y). Again by equation (13.1), we can show that (4) holds since Z ∞ Z ∞ h(x)δ(x − y)f(x)dx = h(y)δ(x − y)f(x)dx = h(y)f(y). −∞ −∞

Example 26 (h) δ(ex − 1) = δ(x)

This one looks a little different to the others as δ is now a function of a reasonably complicated function of x. However the method is the same: integrate the LHS multiplied by a test function and find a suitable substitution to get things into more standard form: Z ∞ Z ∞ dy dy δ(ex − 1)f(x)dx = δ(y − 1)f(log(y)) using substitution y = ex, = ex = y −∞ 0 y dx Z ∞ f(log(y)) = δ(y − 1) dy use definition of the Dirac delta 0 y f(log(y)) = | y y=1 = f(0).

And the RHS: Z ∞ δ(x)f(x)dx = f(0). −∞ So by equation (13.1) we have shown that (5) holds.

More generally, if g(x) is a differentiable function of x with real zeros at ai, i = 1, ..., n (i.e. g(ai) = 0), then

n X δ(x − ai) δ(g(x)) = (13.3) |g0(a )| i=1 i

75 It’s a little tricky to establish this formula in general, but if you think of δ(x) as being the limit of functions which are very strongly peaked near x = 0, it shouldn’t be too surprising that the integral of δ(g(x)) times a test function f is only influenced by values of f at points x for which g(x) = 0. Rather than worry about a full proof, I recommend you check the general forumla in some simple examples such as the case just given, or maybe g(x) = 3x and g(x) = −3x. In practice (or in exams!) it is OK to quote it, though for simple cases it is better -and safer- to do the relevant substitution directly.

Z ∞ Z ∞ n n (n) n d f(x) n d f(x) Bonus example 8 δ (x)f(x)dx = (−1) n δ(x)dx = (−1) n |x=0 −∞ −∞ dx dx

This time we will use repeated applications of integration by parts and the property K2.

Z ∞ h i∞ Z ∞ δ(n)(x)f(x)dx = f(x)δ(n−1)(x) − δ(n−1)(x)f 0(x)dx use K2 −∞ −∞ −∞ Z ∞ = − δ(n−1)(x)f 0(x)dx −∞ h i∞ Z ∞ = −f 0(x)δ(n−2)(x) + δ(n−2)(x)f 00(x)dx −∞ −∞ Z ∞ = δ(n−2)(x)f 00(x)dx by K2, since f(±∞) = 0 then f 0(±∞) = 0 −∞ . . keep integrating by parts until

Z ∞ n n d f(x) = (−1) δ(x) n dx finally use definition of Dirac delta −∞ dx dnf(x) = (−1)n . dxn x=0

There is one final useful rule that can help us in our calculations/manipulations of Dirac delta functions. This rule is not specifically for generalised functions, but for higher order differentiation of products (i.e. it is the product rule for nth order differentiation).

Leibniz Rule for differentiation: If the functions f(x) and g(x) are any differentiable functions (not necessarily test functions!) then:

n dn(f(x)g(x)) X n = f (k)(x)g(n−k)(x), (13.4) dxn k k=0

(k) n n! where f (x) means the kth derivative w.r.t. x of f(x), and k = k!(n−k)! , is the Binomial Coefficient.

These are all useful identities but if you only remember (13.3), the idea to make substitutions, and the repeated use of integration by parts to deal with derivatives, together with the basic definition of the Dirac delta function (equation (12.9)), then you will be able to manipulate any identity involving Dirac delta functions. (The Leibniz rule is very useful so it isn’t a bad idea to commit that to memory too.)

We finish with a more complicated example, taken from the 2013 exam paper, Q6(b): Example 26 (i) By integrating both sides with respect to a test function find the constant c in the following expression : xn−1δ(n)(x) = cδ0(x) n > 0.

76 Starting with the LHS of this expression, multiplying it by a test function f(x) and remembering that n (n) d δ(x) n−1 δ (x) = dxn and x is x to the power of n − 1, Z ∞ LHS : xn−1δ(n)(x)f(x)dx −∞ Z ∞ n n d n−1 = (−1) n (x f(x))δ(x)dx integrating by parts n times −∞ dx dn = (−1)n (xn−1f(x)) | by definition of Dirac delta dxn x=0 n X ndk(xn−1) d(n−k)(f(x)) = (−1)n | by Leibniz. k dxk dx(n−k) x=0 k=0 Since we are evaluating at x = 0, the only term left in the sum is the one where x does not appear dn−1(xn−1) explicitly. This happens when k = n − 1, and dxn−1 = (n − 1)! . Substituting this into our expression gives:

n X ndk(xn−1) d(n−k)(f(x))  n  d(n−(n−1))(f(x)) (−1)n | = (−1)n (n − 1)! | k dxk dx(n−k) x=0 n − 1 dx(n−(n−1)) x=0 k=0 n! = (−1)n (n − 1)!f 0(0) (n − 1)!1! = (−1)nn!f 0(0).

Now we find the integral of the RHS multiplied by the same test function: Z ∞ RHS : cδ0(x)f(x)dx −∞ Z ∞ = −c f 0(x)δ(x)dx integrating by parts −∞ = −cf 0(0) by definition of Dirac delta.

Our two final expressions must agree for all test functions f, so (−1)nn!f 0(0) = −cf 0(0) which implies

c = (−1)n+1n!

A little as with index notation, finding and checking these identities becomes straightforward with practice. There are many further examples for you to try on the problem sheet and on past exam papers.

77 14 Proofs of the three big theorems

In this chapter we return to the ‘big three’ theorems, and indicate how they can be proved. One approach is to prove Stokes’ theorem and the divergence theorem from the integral defintions of the curl and divergence respectively, and then remark that Green is a special case of Stokes. This line of attack is sketched in a handout that you can find on the course webpages. Here we’ll use a different method, beginning with Green and working up from there. Don’t worry about memorising these proofs, but do try to understand how they work. The chapter also includes a number of further examples which you may find useful in your revision.

14.1 Green’s theorem in the plane

Recall that the ‘coordinate’ version of the theorem reads as follows. Suppose P (x, y) and Q(x, y), (x, y) ∈ R2, are continuously differentiable scalar fields in 2 dimensions, and suppose that C is a simple closed curve in the x-y plane, traversed anticlockwise and surrounding an area A. Then

I Z ∂Q ∂P (P (x, y)dx + Q(x, y)dy) = −  dx dy , C A ∂x ∂y

(a) (b)

Figure 39: Area of integration, A, with boundary C. Plot (a) shows the curve split into left and right sections x = hL(y), x = hR(y), while plot (b) shows the curve split into upper and lower sections y = gU (x) and y = gL(x).

Proof of Green’s theorem in the plane: We’ll make the additional assumption that the area A is both horizontally and vertically simple, meaning that each point in A lies between exactly two boundary points (on C) to its left and right, and also between exactly two boundary points above and below, as illustrated in figure 39. We’ll start with the right hand side of the theorem and look at the two terms, which we’ll label as 1 and 2 , separately, remembering that we can interchange the order of integration by Fubini’s Theorem, and splitting up the integration region and its bounding curve in the two ways shown in the figure. We have Z ∂Q Z ∂P RHS = dx dy − dx dy A ∂x A ∂y Z ∂Q Z ∂P = dx dy − dy dx A ∂x A ∂y | {z } | {z } 1 2

78 where Fubini’s theorem was used to swap the order of integration in the second term in going from the first to the second line. Now evaluating the two terms in turn,

y+ h (y) y+ Z Z R ∂Q Z h ihR(y) 1 = dx dy = Q(x, y) dy h (y) y− hL(y) ∂x y− L Z y+ = (Q(hR, y) − Q(hL, y)) dy (now split the integral) y− Z y+ Z y− nd = Q(hR, y) dy + Q(hL, y) dy (note change of limits in 2 integral) y− y+ I = Q dy . C

We follow a similar argument for 2 :

x+ g (x) x+ Z Z U ∂P Z h igU (x) 2 = − dydx = −P (x, y) dx g (x) x− gL(x) ∂y x− L Z x+ = (−P (x, gU ) + P (x, gL)) dx (now split the integral) x− Z x− Z x+ st = P (x, gU ) dx + P (x, gL) dx (note change of limits in 1 integral) x+ x− I = P dx . C The last steps in both calculations ( 1 and 2 ) are made using the fact that the curve C can be split as in the diagram, i.e. C = hL(y) ∪ hR(y) = gU (x) ∪ gL(x). Finally we can bring 1 and 2 back together to see that 1 + 2 = LHS, as required by the theorem. (To prove the theorem for more complicated regions, divide it up into subregions first, and then add the results, noting that line integrals on bits of boundaries shared by two subregions will be traversed in opposite directions, and hence cancel.)

14.2 Stokes’ theorem

Stokes’ theorem generalises Green’s theorem in the plane, relating an integral over a surface S, now in R3, to the line integral over the boundary of S, C. This is most clearly seen by writing Green’s theorem in vector form as I Z F · dx = (∇ × F) · e3 dx dy , C A where e3 is the unit vector in the z direction, F(x, y, z) = (P (x, y),Q(x, y),R), A is a region in the x-y plane, and C is the curve which bounds A, traversed anticlockwise when viewed from above. Stokes’ looks much the same: I Z F · dx = (∇ × F) · dA C S

where F(x, y, z) is now any continuously differentiable vector field in R3 and S ⊂ R3 is a smooth oriented surface which is bounded by the closed curve C. As before, dA is shorthand for nb dA, and nb is a unit vector normal to the surface at the location of the area element dA, pointing up when viewed from the side of the surface from which C appears to be traversed anticlockwise. Put simply, Stokes’ theorem relates the microscopic circulation (curl), of some quantity F on a surface to the total circulation around the boundary of that surface. As a warm-up to the full proof, let’s start by looking at this intuitively without specific vector fields or surfaces.

79 (a) (b)

Figure 40: Sketches of two vector fields over a surface. The black arrows represent the vector field and the red arrows the direction of the line integral around the boundary of the surface. Sketch (a) has the line integral approximately zero while for sketch (b) it is positive.

Figure 40 (adapted from http://www.youtube.com/watch?v=9iaYNaENVH4) shows two vector fields over H a surface and its bounding curve. The line integral part of Stokes’ theorem, C F · dx, has been split into four sections, one along each edge of the surface. The orientation of the line integral has been chosen to be positive and is shown with red arrows. Looking at the bottom of sketch (a), we see that field lines and path element dx are aligned therefore the dot product will be positive, along left and right sides respectively the field lines and dx are perpendicular therefore the line integral here contributes nothing, finally along the top field lines and dx are in opposite directions therefore giving us a negative dot product. Adding these to get the overall line integral will give us zero (or close to) as the top and bottom sections cancel each other. This is in agreement with R what we would expect from the surface integral part of Stokes’ theorem, S(∇ × F) · dA, since the homogeneous field lines will not induce any rotation, so ∇ × F = 0. Conversely for the field shown in sketch (b), at all 4 sections of the line integral the field lines are parallel to dx and so the dot product will produce a positive result, making the overall line integral positive. Again this agrees with the surface integral part of Stokes’ theorem as the circular field lines will induce a rotation and so a positive curl, which in turn will cause the surface integral to be positive. This is a very rough argument, far from a proof, but with any luck you can see how it might be that the surface integral of the curl of a vector field over S is related to the line integral of the vector field around the bounding curve C. Now for a more rigorous proof.

Proof of Stokes’ theorem: The basic setup is a differentiable vector field, F(x, y, z), and a surface S ⊂ R3 bounded by a closed curve C, as shown in figure 41. The surface S can be described parametrically by a continuously differentiable map x(u, v): U → R3 2 with x(u, v) = (x1(u, v), x2(u, v), x3(u, v)) . If the boundary of the parameter domain U ⊂ R is a closed curve Ce, given parametrically as u(t) = (u(t), v(t)), t1 ≤ t ≤ t2, then the points of the boundary C of S are x(u(t)), again with t1 ≤ t ≤ t2. Now consider the right hand side of Stokes’ theorem, writing everything as a two-dimensional area integral over the region U in the u-v plane. Let’s write it out in full first – it will help us to appreciate

80 3 2 Figure 41: The surface S ⊂ R with its bounding curve C. Also shown is the parameter domain U ⊂ R with its bounding curve Ce, in the parametrised coordinate system u, v. Under the mapping (u, v) 7→ x(u, v), Ce → C. the utility of index notation! Z Z ∂x ∂x I = (∇ × F) · dA = (∇ × F) · ( × ) du dv S U ∂u ∂v Z ∂F ∂F  ∂x ∂x ∂x ∂x  ∂F ∂F  ∂x ∂x ∂x ∂x  = 3 − 2 2 3 − 2 3 + 1 − 3 3 1 − 3 1 U ∂x2 ∂x3 ∂u ∂v ∂v ∂u ∂x3 ∂x1 ∂u ∂v ∂v ∂u ∂F ∂F  ∂x ∂x ∂x ∂x  + 2 − 1 1 2 − 1 2 du dv ∂x1 ∂x2 ∂u ∂v ∂v ∂u

Now we’ll rewrite the integrand using the epsilon and (Kronecker) delta symbols; the expression is much more concise, and can be manipulated as follows:

∂Fk ∂xl ∂xm ∂Fk ∂xl ∂xm (∇ × F) · (xu × xv) = ijk ilm = (δjlδkm − δjmδkl) ∂xj ∂u ∂v ∂xj ∂u ∂v ∂F ∂x ∂x ∂F ∂x ∂x = k j k − k k j ∂xj ∂u ∂v ∂xj ∂u ∂v ∂F ∂x  ∂x ∂F ∂x  ∂x = k j k − k j k ∂xj ∂u ∂v ∂xj ∂v ∂u ∂F ∂x ∂F ∂x = k k − k k (using the chain rule in reverse) ∂u ∂v ∂v ∂u   2 ¨   2 ¨ ∂ ∂xk ∂¨xk ∂ ∂xk ∂¨xk = F − F ¨ − F + F ¨ ∂u k ∂v ¨k ∂u∂v ∂v k ∂u ¨k ∂v∂u (using the product rule in reverse) ∂  ∂x  ∂  ∂x  = F k − F k ∂u k ∂v ∂v k ∂u

Written in this way, the surface integral I has been expressed as an area integral, and as a bonus the integrand has turned out to be in just the right form to enable us to use Green’s theorem in the plane.

81 ∂xk  ∂xk  The ‘plane’ is now the u-v plane, with P (u, v) = Fk ∂u and Q(u, v) = Fk ∂v . Hence, Z      ∂ ∂xk ∂ ∂xk I = Fk − Fk du dv (now use Green’s theorem) U ∂u ∂v ∂v ∂u I   ∂xk ∂xk = Fk du + Fk dv (note this is a line integral in the u,v plane) Ce ∂u ∂v Z t2   ∂xk du ∂xk dv = Fk + dt (now use chain rule in reverse on the term in brackets) t1 ∂u dt ∂v dt Z t2 I dxk = Fk dt = F · dx . t1 dt C Hence Stokes’ theorem follows from Green’s theorem in the plane, which was proved earlier.

14.3 The divergence theorem

The divergence theorem gives us a relationship between volume integrals and surface integrals, just as Stokes’ theorem related surface integrals to line integrals. Recall its content: if F is a continuously differentiable vector field defined over a volume V ⊂ R3 with bounding surface S, then Z Z F · dA = ∇ · F dV S V

As before, dA = nb dA, and now the unit normal nb should be chosen to point out of the volume V . Aside: It may not look like it, but the divergence theorem is actually a higher dimensional version of Green’s theorem in the plane. This can be seen by rewriting Green’s theorem as follows. Recall Green’s theorem: I Z ∂Q ∂P  I = P dx + Qdy = − dx dy , (14.1) C A ∂x ∂y where C is a closed curve which bounds an area A in the x-y plane. We can parametrise the curve with dx a parameter t as x(t) = (x(t), y(t)); then the tangent at any point on the curve is given by dt . Now we can write the line integral in terms of t:

I  dx dy  I = P + Q dt , (14.2) C dt dt and (though this may seem a little odd right now) let us define the following 2-D vectors:

F = (Q, −P ) dy dx N = ( , − ) , dt dt so that the integrand of equation (14.2) can be written as the following dot product: I I = F · N dt . (14.3) C

dx Now N is normal to the curve C, as can be checked by taking its dot product with the tangent dt : dx dy dx dx dy N · = − = 0. dt dt dt dt dt We may also write: q 2 2 ds N = n |N| = n dy  + dx  = n , b b dt dt b dt

82 where s is the arc length and n is the unit normal. Now we can write equation (14.3) as I = H F·n ds dt = H b C b dt C F · nb ds. R Finally with F = (Q, −P ) we can rewrite the RHS of equation (14.1) as A ∇·F dA and so we get Green’s theorem in the following form: I Z F · nb ds = ∇ · F dA C A which is clearly a lower dimensional form of the divergence theorem Z Z F · nb dA = ∇ · F dV. S V This is another example of the analogies between the big theorems that were mentioned at the end of section 10.1. With this aside out of the way, we return to the proof of the full theorem.

Proof of the divergence theorem: Suppose that, in components, the vector field in the statement of the theorem is F = (F1,F2,F3). Then we can write

F = F1 + F2 + F3 where F1 = F1 e1, F2 = F2 e2 and F3 = F3 e3. We’ll start by proving the theorem for F3. Suppose that V projects onto a region A in the x-y plane, and assume further that V is vertically simple, meaning that each point in the interior of V lies between exactly two points above and below it on the boundary of V , with all three of these points projecting onto the same point on the x-y plane in the interior of A. This means that S, the boundary of V , can be split into two halves as S = SL ∪ SU where SL (‘lower’) contains all of the ‘below’ points on S, and SU (‘upper’) contains all of the ‘above’ points, as illustrated in figure 42.

SU

z

y SL

x

Figure 42: A vertically simple volume, and the corresponding split of its boundary S as S = SL ∪ SU .

Much as in method 2 for doing surface integrals, we’ll parametrise SL and SU using x and y, with the z coordinates of points on the two surfaces being given by two functions g and h, say, so that on SL, z = g(x, y), while on SU , z = h(x, y). Now consider the volume integral side of the divergence theorem, a triple integral in x, y and z. Opting

83 to do the z integral first, which by Fubini’s theorem is allowed, we have

Z ZZ Z h(x,y) ! ∂F3 ∇ · F3 dV = dz dx dy V A g(x,y) ∂z ZZ  z=h(x,y) = F3(x, y, z) z=g(x,y) dx dy A ZZ  = F3(x, y, h(x, y, z)) − F3(x, y, g(x, y)) dx dy = (∗) . A On the other (‘surface’) side of the theorem, we can write Z Z Z F3 · dA = F3 · dA − F3 · dA S SU SL where both surface integrals on the RHS are to be taken with ‘upwards’ pointing (i.e. positive z com- ponent) normals. Note that all normals in the integral on the LHS point out of V , which on SL means downwards. The minus sign in front of the second term on the RHS converts the ‘upwards-normals’ integral to the downwards-normals version, so as to match the LHS.

Now treat SL as a parametrised surface with coordinates x(x, y) = (x, y, g(x, y)). By method 1, we have

Z ZZ ∂x ∂x F3 · dA = F3(x(x, y)) · × dx dy SL A ∂x ∂y ZZ = F3(x, y, g(x, y)) e3 · ((1, 0, gx) × (0, 1, gy)) dx dy A ZZ ZZ = F3(x, y, g(x, y)) e3 · (−gx, −gy, 1) dx dy = F3(x, y, g(x, y)) dx dy . A A Likewise, Z ZZ F3 · dA = F3(x, y, h(x, y)) dx dy SU A and hence Z ZZ  F3 · dA = F3(x, y, h(x, y)) − F3(x, y, g(x, y)) dx dy = (∗) S A and we’ve proved that Z Z ∇ · F3 dV = F3 · dA . V S In the same way (but doing the x or y integrals first) Z Z ∇ · F1 dV = F1 · dA V S and Z Z ∇ · F2 dV = F2 · dA . V S

Adding these up and using F = F1 + F2 + F3, Z Z ∇ · F dV = F · dA , V S as required. Notice that this is very similar to the way that Green’s theorem in the plane was proved earlier. Given the aside that began this subsection, this might not come as a huge surprise.

84 Figure 43: Parabolic surface z = 1 − (x2 + y2).

14.4 Further examples

Bonus example 9 Verify Stokes’ theorem for the vector field F(x, y, z) = (y, z, x) and the parabolic surface z = 1 − (x2 + y2), z ≥ 0, shown in figure 43. We first need to find the bounding curve C, in order to calculate the line integral part of Stokes’ theorem. It can be found, see figure, by locating the intersection of the surface and the z = 0 plane.

z = 0 = 1 − (x2 + y2) ⇒ x2 + y2 = 1, the unit circle. H Next we are going to parametrise the curve and calculate I1 ≡ C F·dx. As seen earlier, a parametrisation for a unit circle in R2 is x(t) = cos t , y(t) = sin t , and to situate it in the z = 0 plane we simply set z(t) = 0. Using this we can write x(t), F(x(t)) and dx(t)/dt in terms of the parameter t:

x(t) = (cos t, sin t, 0) ; F(x(t)) = (sin t, 0, cos t); dx(t) = (− sin t, cos t, 0) . dt

So now we are ready to do the line integral:

I Z 2π I1 = F · dx = (sin t, 0, cos t) · (− sin t, cos t, 0) dt C 0 Z 2π = − sin2 t dt 0 Z 2π 1 = 2 (cos(2t) − 1) dt = −π . 0

85 R Now let’s tackle the surface integral: I2 ≡ S(∇ × F) · dA. We will start in Cartesian coordinates and calculate the integrand using ‘method 2’, the level surface method. First off,

e1 e2 e3 ∂ ∂ ∂ ∇ × F = = (−1, −1, −1) . ∂x ∂y ∂z y z x

Next we recall from section 9how to calculate the area element dA = nb dA. Since we can express our surface as a level set of a scalar field i.e. f(x, y, z) = z + x2 + y2 = 1, and ∂f ∂f ∂f ∇f(x, y, z) = e + e + e = (2x, 2y, 1) , ∂x 1 ∂y 2 ∂z 3 our integrand is given by: (−1, −1, −1) · (2x, 2y, 1) (∇ × F) · dA = dx dy = (−2x − 2y − 1) dx dy , e3 · (2x, 2y, 1) which leaves us ready to compute the double integral: Z I2 = (−2x − 2y − 1) dx dy . x2+y2≤1 Quickest at this stage is to spot that the integration region is symmetrical in both the x and y directions, so the integrals of −2x and −2y both vanish; this leaves us with Z I2 = (−1) dx dy = −(area of unit disk) = −π . x2+y2≤1 Alternatively, we change to polar coordinates (x = r cos θ, y = r sin θ), with the two parameters r and θ running between 0 and 1 and 0 and 2π respectively. (Projecting the surface integral onto the x,y plane so that our region for the double integral is the unit circle.) The change of variables replaces dA = dx dy by dA = rdrdθ; this comes from the Jacobian, as discussed in section 10.5. Hence Z Z 2πZ 1 I2 = (∇ × F) · dA = (−2r cos θ − 2r sin θ − 1) r dr dθ S 0 0 Z 2π 2 2 1  = − 3 cos θ − 3 sin θ − 2 dθ 0  2 2 1 2π = − 3 sin θ + 3 cos θ − 2 θ 0 = −π . H R Either way, we have obtained the same result as before, and C F · dx = S(∇ × F) · dA, as required. Bonus example 10 Use the divergence theorem to compute Z F · dA S where F = (y2z, y3, xz) and S is the surface of the cube |x| ≤ 1 , |y| ≤ 1 , 0 ≤ z ≤ 2 . Answer: ∇ · F = 3y2 + x, so Z Z F · dA = (3y2 + x) dV S V Z 1 Z 1 Z 2 = (3y2 + x) dz dx dy −1 −1 0 Z 1 Z 1 = 2 (3y2 + x) dx dy −1 −1 Z 1  1 1 = 2 3y2x + x2 dx dy −1 2 −1 Z 1 2 12  31 = 2 6y dy = y −1 = 8 . −1 3

86 Bonus example 11 Verify the divergence theorem by calculating both left and right hand sides of Z Z F · dA = ∇ · F dV , S V when F = (7x, 0, −z), S is the sphere x2 + y2 + z2 = 4, and V is the volume inside it. Let us start with the surface integral. Since the surface is a sphere, which does not sit in a single-valued R R fashion above any single plane, we use the parametric form: S F·dA = U F(x(u, v))·(xu ×xv) du dv. As in section 9, the (radius 2) sphere can be parametrised as x(u, v) = (2 sin(u) cos(v), 2 sin(u) sin(v), 2 cos(u)), with 0 ≤ u ≤ π, 0 ≤ v ≤ 2π, and so (as we calculated in example 7 above) (xu × xv) = 2 sin(u) x. Now we construct our integral in terms of the parameters u and v: I Z π Z 2π F(x(u, v)) · (xu × xv) du dv = (14 sin(u) cos(v), 0, −2 cos(u)) · (2 sin(u)x) dv du U 0 0 Z π Z 2π = (56 sin3(u) cos2(v) − 8 cos2(u) sin(u)) dv du 0 0 Z π  v sin(2v) 2π = 56 sin3(u) + − 8 cos2(u) sin(u)v du 0 2 4 0 Z π = (56π sin3(u) − 16π cos2(u) sin(u)) du 0 Z π = (56π sin(u)(1 − cos2(u)) − 16π cos2(u) sin(u)) du 0 Z π = (−72π sin(u) cos2(u) + 56π sin(u)) du 0  (− cos3(u)) π = −72π + 56π(− cos(u)) = 64 π . 3 0 Next, the volume integral. The first step is to calculate the divergence of F:  ∂ ∂ ∂  ∇ · F = , , · (7x, 0, −z) = 6 . ∂x ∂y ∂z Hence the integral is Z 4  6 dV = 6 πr3 = 64 π . V 3 This was much simpler than the surface integral, and in fact we didn’t have to integrate at all – we just used the formula for the volume of a sphere!

H z 3y Bonus example 12 Evaluate the line integral C F · dx with F = (y, 2 , 2 ) around the curve C given by the intersection of the sphere x2 + y2 + z2 = 6z, and the plane z = x + 3. The curve is a circle lying in the plane z = x + 3. If we use Stokes’ theorem then we need to think about how to set up the surface integral for a surface with C as its boundary. If we do this by using x, y as parameters then we will need the projection of C onto the x, y-plane which is given by: x2 + y2 + (x + 3)2 = 6(x + 3) = 2x2 + y2 = 9, an ellipse. H R The line integral can be done directly, or we can apply Stokes’ theorem: C F · dx = S(∇ × F) · dA. The easiest surface to consider that has C as its boundary is the flat disk S in the z = x + 3 plane (we could have used either parts of the sphere that have C as boundary but that would be more complcated). Let’s start by calculating the curl of F :

e1 e2 e3 ∂ ∂ ∂ ∇ × F = = (1, 0, −1) ∂x ∂y ∂z y z/2 3y/2 And now let’s find dA using method 2, describing S as (part of) a level set and parametrising it using x and y: ∇f dA = dx dy e3 · ∇f

87 Figure 44: Intersection of sphere x2 + y2 + z2 − 6z = 0 and plane z = x + 3.

Taking f(x, y, z) = z − x so the plane is f(x, y, z) = 3, ∇f = (−1, 0, 1) , e3 · ∇f = 1 , and our integrand is (∇ × F).dA = −2 dx dy. The region of integration A is the interior of the ellipse 2x2 + y2 = 9 in the x,y plane. Finally we can use a simple change of√ variables to√ convert the ellipse to a circle and make the area integration even simpler: if we set x¯ = 2x, dx¯ = 2dx, then our ellipse becomes the circle x¯2 + y2 = 9, and we can apply the usual coordinate transformations as follows (A¯ (a circle) is the transformation of region A (an ellipse)): Z Z √ Z (∇ × F) · dA = −2 dx dy = − 2 dx¯ dy S A A¯ √ Z 2π Z 3 = − 2 r dr dθ 0 0 √ Z 2π √ 9 = − 2 2 dθ = −9 2π . 0

Alternatively, we can do the line integral directly around the ellipse 2x2 + y2 = 9. This can be written 2 2 in the standard form as x√ + y = 1 and using the parametrisation from the table in section 9.1, (3/ 2)2 32 x(t) = √3 cos(t), y(t) = 3 sin(t) and so z(t) = x(t)+3 = √3 cos(t)+3. We can then find the line element 2 2 along the path to be dx = ( √−3 sin(t), 3 cos(t), √−3 sin(t)) dt, and so the integral is 2 2 I Z 2π F · dx = (3 sin(t), √3 cos(t) + 3 , 9 sin(t)) · ( √−3 sin(t), 3 cos(t), √−3 sin(t)) dt 2 2 2 2 2 2 C 0 Z 2π   = − √9 sin2 t + √9 cos2 t + 9 cos t − 27√ sin2 t dt 2 2 2 2 2 2 0 √ = − √9 π + √9 π − 27√ π = −9 2π , 2 2 2 2 2 as before.

Bonus example 13 The next example is a little more general: Suppose B(x) is defined everywhere in 3 3 R R , and that S is a closed surface in R . Show that S(∇ × B) · dA = 0, (i) using Stokes’ theorem, and (ii) using the divergence theorem.

88 Figure 45: The closed surface is split into two open surfaces; S+ is bounded (positively) by curve C and S− is bounded by C¯. The unit normal is oriented outwards as usual. Note that C¯ is just C traversed backwards.

(i) Using Stokes’ theorem, the proof takes a little work. First imagine the closed surface split into two surfaces S+ and S−, bounded by the curves C and C¯ respectively, as shown in figure 45. Now: Z Z Z (∇ × B) · dA = (∇ × B) · dA + (∇ × B) · dA . S S+ S− Next, apply Stokes’ theorem: Z Z I I (∇ × B) · dA + (∇ × B) · dA = B · dx + B · dx S+ S− C C¯ I I = B · dx − B · dx = 0 . C C

(ii) Using the divergence theorem, the result is a little easier to see: Z Z Z (∇ × B) · dA = ∇ · (∇ × B) dV = 0 dV = 0 , S V V since the divergence of a curl is zero. Try to prove it using index notation!

Bonus example 14 One final quick example: show that the volume enclosed by a closed surface S is 1 R 3 S x · dA. 1 R First off, remember that x = (x, y, z). Now let’s show that 3 S x · dA is indeed equal to volume by applying the divergence theorem: Z Z Z 1 1 3 x · dA = 3 ∇ · x dV = dV = V, as required. S V V

One last request: if you spot any typos in these notes, or if you find that anything is particularly obscure, please let me know! (At [email protected])

89