MAM2083F 2021 Vector Calculus for Engineers 0.1. Functions Mathematics is really not about numbers; it’s about functions. In your ο¬rst-year courses, you learnt that a function is a rule that assigns to each element π₯ of a set π΄ an element π¦ of a set π΅. Often we write something like π¦ = π (π₯), which then gives the function a name, π . The basic idea is that π somehow transforms π₯ into π¦ : we call π¦ the value of the function π at the point π₯. This transformation might work in diο¬erent ways; the rule that assigns π¦ to π₯ might be given by a formula, or might be found by doing an experiment or consulting a table or looking at a graph. In fact, this rule might depend on π₯ : for example, the absolute value function is deο¬ned by ( |π₯| = −π₯ π₯<0 π₯ π₯≥0 for all π₯ ∈ R. In more extreme examples, you might encounter functions that are given by a formula for certain values of π₯, but by a completely diο¬erent method for others. Whenever possible, I try to introduce a new function by writing something like π : π΄ → π΅. This has the advantage of specifying the name π , the domain π΄ and the codomain π΅ of the function. However, sometimes I choose to be less formal, and write something cos π₯ . Here I haven’t given the function a name and it isn’t immediately like π¦ = 1 + sin π₯ clear what the domain and the codomain are: you somehow have to work this out. In your ο¬rst-year courses, you worked mainly with functions whose domains and codomains were both subsets of R. For such functions, it is often convenient to study the behaviour of the function by looking at its graph, which is a subset of the cartesian plane R2 . In MAM2083F, we are more interested in functions whose domains and codomains are subsets of Rπ or Rπ , where either π > 1 or π > 1. The graph of such a function is a subset of Rπ+π , so it’s not as easy to visualise. 0.2. Limits and continuity When I started talking about "graphs", you probably thought of a curve in R2 . However, not all functions are continuous, so even if π΄ and π΅ are subsets of R, the graph of a function π : π΄ → π΅ need not be a nice smooth curve in R2 . 1 The concept of continuity is very closely related to the idea of a limit. In a sense, the limit of a function π : π΄ → π΅ at a point π is the value which the function would have at the point π if it were continuous at π. It is useful to think of the function π as being some kind of a "black box", that takes a number π₯ as an input and somehow transforms this into an output π (π₯). Rather than do treat this totally abstractly, let’s imagine that π is a machine, or a piece of electronic circuitry. For example, π might be a power supply, that converts alternating current into direct current. In this analogy, π₯ is the input voltage, while π (π₯) is the output voltage. Suppose that this power supply is designed to convert 220V of alternating current into 5V of direct current, which you can use to charge your smartphone. The input is unlikely to be exactly 220V, but fortunately your smartphone is probably able to tolerate a voltage that is slightly under or over 5V. You would not be able to use this power supply if its output were outside this range. Even if an input voltage of exactly 220V produces an output voltage of precisely 5V, you wouldn’t be happy to use this power supply if you knew that a tiny deviation in the input voltage could result in an output voltage that is outside the range that your phone can tolerate. This is the whole idea behind continuity: if the function that relates output voltages to input voltages "jumps" in some way near 220V, then the power supply can’t be trusted. Let’s put π = 220V and β = 5V. Suppose your phone can tolerate an output voltage between β − π and β + π, where π is a relatively small positive amount, while you know that the input voltage π₯ is certain to lie between π − πΏ and π + πΏ, where πΏ is another small amount. Thus the question is whether an input voltage that is between π − πΏ and π + πΏ always results in an output voltage between β − π and β + π. output voltage β +π β β −π π−πΏ π π+πΏ input voltage If this isn’t the case, then you can’t trust the power supply. In a sense, π measures how much variation your phone can tolerate in the output voltage, while πΏ measures how much variation is acceptable in the input voltage. 2 Of course, the power supply isn’t actually a "black box": if you could look inside, you would see that it’s made up of electronic components, such as resistors, capacitors and so on. A clever engineer should be able to work out how all these components interact with one another. By consulting the datasheets for these components and applying the appropriate formulas, this engineer should be able to calculate what the output voltage the power supply will produce for any given input. With this information, you will be able to see whether the power supply can be trusted. In a similar way, a function π can often be broken down into simpler parts. A clever mathematician is able to ο¬gure out whether π is continuous at π₯ = π by looking at these parts and how they ο¬t together. Most of the important results about limits say things like "If π and π both have limits at π₯ = π, then so does π + π, with lim ( π (π₯) + π(π₯)) = lim π (π₯) + lim π(π₯) ". These π₯→π π₯→π π₯→π results are all proved using π’s and πΏ’s, as we have just been discussing. Unfortunately, you probably weren’t taught these proofs in ο¬rst year, as some people mistakenly believe that engineers don’t have to know them. However, I hope that the example above makes you realise that this isn’t true: on the contrary, engineers are constantly working with errors and uncertainties and need to know whether a slight variation in one quantity could result in an unacceptably large variation in another. If you know anything at all about alternating current, then you will know that the story above is simplistic: for example, the input might vary not only in voltage, but also in frequency. The output might change as certain components heat up, or it might suο¬er from "ripple". This means that the input might not depend on a single number π₯ and its output π (π₯) might have more than one component. This ο¬ts in with what we are going to talk about in MAM2083F: functions which have more than one argument or whose values are not just a single number. 0.3. Diο¬erentiability You should know from ο¬rst year that one of the most important applications of limits is to deο¬ne the idea of a derivative. I’m not going to repeat most of the story here; in particular, you should be familiar with the notion of a tangent line and you should know that the derivative can be interpreted as an "instantaneous rate of change". You should also know all the rules of diο¬erentiation, including the derivatives of the trig functions sin, cos, tan and sec and the inverse trig functions arcsin, arccos and arctan. As before, let π΄ and π΅ be subsets of R. Definition 0.1. We say that a function π : π΄ → π΅ is diο¬erentiable at π ∈ π΄ if π (π₯) − π (π) π₯→π π₯−π π ′(π) = lim exists. If this is the case, then π ′(π) is known as the derivative of π at the point π. 3 (1) If π is diο¬erentiable at π, then the graph of π¦ = π (π₯) has a tangent line at the point (π, π (π)). The equation of this tangent line is π¦ = π (π) + π ′(π) (π₯ − π) . Note that this line has slope π = π ′(π). π¦ π¦ = π (π₯) π¦ = π (π) + π ′(π)(π₯ − π) (π, π (π)) π₯ An important observation is that near the point (π, π (π)), the graph of π¦ = π (π₯) looks very much like its tangent line. This is the idea behind the linear approximation π (π₯) ≈ π (π) + π ′(π) (π₯ − π) , (2) which in turn motivates important results such as Taylor’s Theorem. We can make this "approximation" a little more precise. Suppose for each π₯ ∈ π΄, we put β = π₯ − π, so that π₯ = π + β. As you well know, we can write equation (1) in the form π (π + β) − π (π) . β β→0 π ′(π) = lim For each β ≠ 0, put π (β) = π (π + β) − π (π) − π ′(π). β (3) Then π (π + β) − π (π) − π ′(π) = π ′(π) − π ′(π) = 0. β β→0 β→0 In other words, π (β) → 0 as β → 0. Remarkably enough, this can be used to prove that the function π is diο¬erentiable at the point π ∈ π΄. Although we’ve used the fact that π is diο¬erentiable at the point π to prove that π (β) → 0 as β → 0, the converse is also true: we’ll show that if π (β) → 0 as β → 0, then the function π is diο¬erentiable at π. lim π (β) = lim Before we prove this converse, let’s complete our explanation of how π (β) can be used to make the linear approximation (2) more precise. It’s not diο¬cult to rewrite the equation π (π + β) − π (π) π (β) = − π ′(π) β in the form π (π + β) = π (π) + π ′(π)β + π (β)β, 4 which in turn can be written as π (π₯) = π (π) + π ′(π) (π₯ − π) + π (β)β. (4) Thus π (β)β is the diο¬erence between the actual value of π (π₯) and the approximate value π (π) + π ′(π) (π₯ − π) predicted by (2). π¦ π¦ = π (π₯) π¦ = π (π) + π ′(π)(π₯ − π) π (β)β π (π) π π₯ π+β Since π (π₯) is the π¦-coordinate of a point on the graph of π¦ = π (π₯) and π (π)+ π ′(π) (π₯ − π) is the π¦-coordinate of the corresponding point on the tangent line, the fact that π (β)β → 0 as π₯ → π means that the graph and the tangent line get closer and closer together as you approach the point (π, π (π)). Notice that π (π₯) − π (π) − π ′(π) π₯−π is the diο¬erence between the slope of the secant line joining the points (π, π (π)) and (π₯, π (π₯)) and the slope of the tangent line through (π, π (π)). The fact that this diο¬erence tends to 0 explains why the secant line tends towards the tangent line as π₯ → π. π (β) = π¦ π¦ = π (π₯) secant line tangent line (π, π (π)) π₯ (π₯, π (π₯)) π (β)β π (π₯) − π (π) (π, π (π)) β=π₯−π 5 (π₯, π (π)) slope of secant line π (π₯) − π (π) π₯−π slope of tangent line π ′(π) You’ve probably noticed that π (β)β is actually the product of two factors, both of which tend to 0 as π₯ → π. This tells us that diο¬erence between π (π₯) and π (π)+ π ′(π) (π₯ − π) gets small very quickly as π₯ → 0. As we shall see, this is actually what makes the function π diο¬erentiable. It’s time for us to prove the converse result I mentioned earlier. Since π ′(π) appears in the formula π (π + β) − π (π) − π ′(π), β when we use this formula to deο¬ne π (β), we are obviously assuming that π is diο¬erentiable. Suppose however that we have somehow found a quantity π (β) that tends to 0 as β → 0, and which is such that π (β) = π (π₯) = π (π) + π (π₯ − π) + π (β)β (5) for all π₯ ∈ π΄ for some constant π. (Remember that β = π₯ − π.) You will recognise that π¦ = π (π) + π (π₯ − π) is the equation of a line that passes through (π, π (π)) and has slope π. Equation (5) tells us that the graph of π¦ = π (π₯) gets closer and closer to this line as π₯ → π. To show that π is diο¬erentiable at π, we look at π (π₯) − π (π) ( π (π) + π (π₯ − π) + π (β)β) − π (π) = lim π₯→π π₯→π π₯−π π₯−π π (π₯ − π) + π (β) (π₯ − π) = lim π₯→π π₯−π = π + lim π (β) lim π₯→π = π. This calculation shows not only that π is diο¬erentiable at π, but also that π ′(π) = π. Thus the line we’ve just been talking about is actually the tangent line. The point is that we were able to introduce this line, and show that its slope is π ′(π), without assuming that the function π is diο¬erentiable. The fact that π is diο¬erentiable follows from equation (5) and that π (β) → 0 as β → 0; notice that we don’t need an explicit formula for π (β). So we’ve proved the converse. This means that π being diο¬erentiable at π is equivalent to equation (5) holding for all π₯ ∈ π΄, where π is a constant and π (β) → 0 as β → 0. You might think that this is all very abstract. However, the linear approximation (2) is one of the most important ideas in Calculus. As I have already mentioned, it is the motivation for such ideas as Taylor’s Theorem. In the form of equation (4), it can be used to prove important results such as the Chain Rule. In MAM2083F, we are going to use these ideas to deο¬ne the notion of diο¬erentiability for functions of several variables. We will see that for such functions, the idea that "a function is diο¬erentiable 6 if its derivative exists" doesn’t work very well. Instead, we will deο¬ne diο¬erentiability using something like equation (5). 0.4. The Riemann integral As you know very well, we use integrals to calculate areas, volumes, arclengths, averages and so on. Most of the important applications of integrals, such as ο¬nding areas and volumes, involve breaking breaking something complicated into the sum of a large number of tiny parts and then estimating this sum in some way. In your ο¬rst-year courses, one of the most important results you learn is the Fundamental Theorem of Calculus, which establishes the link between integrals and antiderivatives. In those courses, you spend a lot of time learning various "techniques of integration", which are mainly clever tricks for ο¬nding antiderivatives. All this is important, but I want to spend a little time revising how we deο¬ne the notion of an integral, using Riemann sums. In MAM2083F we will extend this to functions which are deο¬ned on various subsets of Rπ , or which take on values which are vectors in Rπ , but it helps to remind ourselves how it is done . In ο¬rst year, you usually start with the story of calculating the area under the graph of a function π¦ = π (π₯) on an interval [π, π]. π¦ π¦ = π (π₯) π π π₯ So that we can actually get somewhere, let’s assume that π : [π, π] → R is a reasonably nice function, with π (π₯) ≥ 0 for all π₯ ∈ [π, π]. At this stage, I’m not going to explain what I mean by "reasonably nice": we’ll decide what we actually mean by this later. The reason why we want π (π₯) ≥ 0 is so that we can talk about the region bounded by π¦ = π (π₯) and the lines π¦ = 0, π₯ = π and π₯ = π. We’ll drop this requirement quietly as soon as we no longer need it. The ο¬rst step is to divide the interval [π, π] into subintervals [π₯0 , π₯ 1 ], [π₯ 1 , π₯ 2 ], [π₯2 , π₯ 3 ], . . . , [π₯ π−1 , π₯ π ]. We can do this by choosing π₯ 0 , π₯ 1 , π₯ 2 , π₯ 3 , . . . , π₯ π so that π = π₯0 < π₯ 1 < π₯2 < π₯3 < · · · < π₯ π = π. 7 π π₯0 π₯1 π₯ π−1 π₯ π π π₯ π−1 π₯ π We call π = {π₯0 , π₯ 1 , π₯ 2 , π₯ 3 , . . . , π₯ π } a partition of the interval [π, π]. Select a "sample point" π₯ ∗π from each subinterval [π₯ π−1 , π₯ π ] and form the Riemann sum π Õ π=1 π (π₯ ∗π ) (π₯ π − π₯ π−1 ) (6) As you know, we can interpret this Riemann sum in terms of areas of rectangles: π¦ π¦ = π (π₯) π₯ 0 π₯ ∗ π₯ 1π₯ ∗ 1 2 π₯2 π₯ 3∗ π₯3 π₯4∗ π₯4 π₯ This suggests that the Riemann sum (6) is an approximation to the "area under the curve". There are many ways in which to choose a sample point π₯ ∗π from each subinterval [π₯ π−1 , π₯ π ]. In theory, we could choose these sample points at random, but it is natural to make these choices systematically. For example, we could choose each π₯ ∗π to be the right-hand endpoint π₯ π of the subinterval [π₯ π−1 , π₯ π ]. This means that π₯ ∗π = π₯ π for all π ; the corresponding Riemann sum is the "right-hand sum" π Õ π (π₯ π ) (π₯ π − π₯ π−1 ) . π=1 Another possibility is to choose each π₯ ∗π to be the left-hand endpoint π₯ π−1 of the subinterval [π₯ π−1 , π₯ π ]. This gives us the "left-hand sum" π Õ π (π₯ π−1 ) (π₯ π − π₯ π−1 ) . π=1 You should be familiar with this from ο¬rst-year. Stewart discusses left-hand and righthand sums in detail and goes on to talk about midpoint sums, etc. 8 When we started this story, I asked you to assume that the function π : [π, π] → R is "reasonably nice", without explaining exactly what I meant by this. I will need to add some more conditions later, but for now, let’s now agree that part of being "reasonably nice" means that π (π₯) is bounded on the interval [π, π]. This means that we can ο¬nd numbers π, π such that π ≤ π (π₯) ≤ π for all π₯ ∈ [π, π]. We call these numbers π, π bounds on π (π₯). If π is bounded on [π, π], then it is also bounded on each of the subintervals [π₯ π−1 , π₯ π ], so that for each π, we can ο¬nd numbers π π , π π such that π π ≤ π (π₯) ≤ π π (7) for all π₯ ∈ [π₯ π−1 , π₯ π ]. I’m going to assume that for each π, π π and π π are respectively the biggest and the smallest numbers with these properties, so that if π ′π , π ′π are any numbers satisfying π ′π ≤ π (π₯) ≤ π ′π for all π₯ ∈ [π₯ π−1 , π₯ π ], then π ′π ≤ π π and π π ≤ π ′π . For a given function π and a given partition π, these numbers π π and π π are unique. Definition 0.2. The lower sum of π associated with the partition π = {π₯0 , π₯ 1 , π₯ 2 , π₯ 3 , . . . , π₯ π } is πΏ( π , π) = π Õ π π (π₯ π − π₯ π−1 ) , π=1 while the upper sum is π( π , π) = π Õ π π (π₯ π − π₯ π−1 ) , π=1 where π π and π π are as deο¬ned above. Suppose now we have chosen a sample point π₯ ∗π from each subinterval. From (7), it follows that π π ≤ π (π₯ ∗π ) ≤ π π for each π. This means that if π Õ π=1 π (π₯ ∗π ) (π₯ π − π₯ π−1 ) is any Riemann sum of π associated with the partition π = {π₯ 0 , π₯ 1 , π₯ 2 , π₯ 3 , . . . , π₯ π }, then πΏ( π , π) ≤ π Õ π=1 π (π₯ ∗π ) (π₯ π − π₯ π−1 ) ≤ π( π , π). (8) If for each π, we can ο¬nd points π’ π , π£ π ∈ [π₯ π−1 , π₯ π ] with π (π’ π ) = π π and π (π£ π ) = π π , then πΏ( π , π) is the Riemann sum obtained by choosing π₯ ∗π = π’ π for each π, while π( π , π) is the Riemann sum obtained by choosing π₯ ∗π = π£ π for each π. In this case, πΏ( π , π) is the smallest Riemann sum of the function π associated with the partition π, while π( π , π) 9 is the largest. However, in what we are going to do, it’s not necessary to assume that the points π’ π and π£ π exist, since we just need the numbers π π and π π . You might have noticed that I haven’t assumed that the partition π is regular, in the sense that all the subintervals generated by π are of the same length. This means that there need not be any particular relationship between the lengths of the diο¬erent subintervals or between the lengths of the subintervals and the number of points in π. Thus there is no point in simply taking limits as π → ∞ ; we have to be a bit more clever. Let’s think what happens when we use diο¬erent partitions of the interval [π, π]. Obviously, the number of subintervals might change and also their endpoints. Since π π and π π depend on these subintervals, the lower and upper sums will also vary. Definition 0.3. Let π and π be two partitions of the same interval [π, π]. We say that π is a reο¬nement of π if π ⊆ π. (The symbol "⊆" means "is a subset of".) Sometimes, we prefer to say that the partition π is ο¬ner than the partition π or that π is coarser than π. Thus π is a reο¬nement of π if every endpoint of a subinterval in π is also an endpoint of an interval in π. Each of the subintervals in π has either been left unchanged, or has been cut up into shorter intervals in π. π π Notice that any interval [π, π] has a coarsest partition, the partition {π, π}. In a sense, this isn’t actually a "partition", since it involves only one subinterval, the interval [π, π] itself. For any partition π of [π, π], we have that {π, π} ⊆ π. Notice that π (π − π) ≤ πΏ( π , {π, π}) ≤ π( π , {π, π}) ≤ π (π − π) , (9) where π, π are bounds on π (π₯). If you draw some pictures, you will see that if π is a reο¬nement of the partition π, then πΏ( π , π) ≤ πΏ( π , π) ≤ π( π , π) ≤ π( π , π). (10) In other words: if we replace a partition of the interval [π, π] by one of its reο¬nements, the lower sum will get bigger and the upper sum will get smaller. (8) tells us that any Riemann sum associated with π is "squeezed" between πΏ( π , π) and π( π , π). 10 Now consider two partitions π, π of [π, π] that are not necessarily reο¬nements of one another. Notice that π ∪ π is also a partition of [π, π] and it is ο¬ner than both π and π. Together, (9) and (10) tell us that π (π − π) ≤ πΏ( π , π) ≤ πΏ( π , π ∪ π) ≤ π( π , π ∪ π) ≤ π( π , π) ≤ π (π − π) . In particular, this means for any pair of partitions π, π, π (π − π) ≤ πΏ( π , π) ≤ π( π , π) ≤ π (π − π) . In summary: if we look at ο¬ner and ο¬ner partitions of the interval [π, π], the associated lower sums will get bigger and bigger, but they will always be smaller than any one of the upper sums. In the same way, the upper sums will get smaller and smaller, but they will always be bigger than any one of the lower sums. Let π( π ) be the maximum of all the lower sums of π on the interval [π, π] and let π( π ) be the minimum of all the upper sums. You can think of π( π ) as being the "limit" of the lower sums and π( π ) as being the "limit" of the upper sums, in the sense that πΏ( π , π) → π( π ) and π( π , π) → π( π ) as we consider ο¬ner and ο¬ner partitions of [π, π]. For any pair of partitions π, π, π (π − π) ≤ πΏ( π , π) ≤ π( π ) ≤ π( π ) ≤ π( π , π) ≤ π (π − π) . After all this, we can say what we mean by a function π being "reasonably nice" and deο¬ne the integral of this function on the interval [π, π] : Definition 0.4. We say that a function π is Riemann integrable on [π, π] if it is bounded on [π, π] and π( π ) = π( π ). If this is the case, then we deο¬ne the Riemann integral of π on [π, π] to be ∫ π π π (π₯) dπ₯ = π( π ) = π( π ). It is useful to have an example of a bounded function which is not Riemann integrable: Example 0.5. Dirichlet’s function on [0, 1] is deο¬ned by ( π(π₯) = 1 if π₯ is rational 0 if π₯ is irrational . This is a "highly discontinuous" function: any interval of the real line contains both rational and irrational numbers, and thus points where π(π₯) = 1 and points where π(π₯) = 0. It follows that πΏ(π, π) = 0 and π(π, π) = 1 for any partition π of [0, 1]. (Can you see why?) Thus π(π) < π(π), and so π is not Riemann integrable on [0, 1]. One of the basic rules of integration says something like If π and π are both Riemann integrable on [π, π], then so is π + π, with ∫ π π ( π (π₯) + π(π₯)) dπ₯ = ∫ π π 11 π (π₯) dπ₯ + ∫ π π π(π₯) dπ₯. You can easily prove this result by showing that πΏ( π + π, π) = πΏ( π , π) + πΏ(π, π) and π( π + π, π) = π( π , π) + π(π, π) for any partition π. From this it follows that π( π + π) = π( π ) + π(π) and π( π + π) = π( π ) + π(π), which is suο¬cient to prove the result. Most of the basic rules of integration can be proved in the same way. If we know that a function π is Riemann integrable on [π, π], then we can ο¬nd the ∫ π value of π π (π₯) dπ₯ by calculating either π( π ) or π( π ). If necessary, we can ο¬nd these by considering a suitable sequence of partitions, for example, the regular partitions of [π, π]. It can be shown that if π is continuous on [π, π], then π is Riemann integrable on [π, π] ; I’m not going to prove this. Neither am I going to give a proof of the Fundamental Theorem of Calculus, even though this follows very easily from the ideas which we have just been discussing. You will see that the Fundamental Theorem of Calculus plays a very important rôle in the later part of this course. 12