# MA10192: Mathematics 1 - Department of Mathematical Sciences

MA10192: Mathematics 1 Lecture notes: Chapters 1-9 Semester 1, 2005 Gunnar Traustason 1 1 Based on the notes of my predecessors André Léger and Alastair Spence Contents 1 Exponentials and logarithms 1.1 The real numbers . . . . . . . . . . . . . . . . . . . . . . . 1.2 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . 1.2.2 Inverses . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Exponentials . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.1 Powers . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.2 The Exponential Function . . . . . . . . . . . . . . 1.4 Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.1 The logarithm function . . . . . . . . . . . . . . . 1.5 Various examples and applications of the exponentials and 1.5.1 Equations with Exponentials and Logs . . . . . . . 1.5.2 Examples from Chemical Engineering . . . . . . . 1.5.3 Application of Logs - Parameter Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . the logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Trigonometry 2.1 Angles and the unit circle . . . . . . . . . . . . . . . . . . . . 2.2 The right angled triangle . . . . . . . . . . . . . . . . . . . . 2.3 The trigonometric functions for arbitrary angles . . . . . . . . 2.4 Trigonometric equations . . . . . . . . . . . . . . . . . . . . . 2.4.1 Some trigonometric equations . . . . . . . . . . . . . . 2.4.2 To Convert a Sum to a Harmonic Form . . . . . . . . 2.5 The inverses to the trigonometric functions . . . . . . . . . . 2.5.1 The inverse sine function sin−1 x or arcsin x . . . . . . 2.5.2 The Inverse Cosine Function (cos−1 (x) or arccos(x)) . 2.5.3 The Inverse Tangent Function (tan−1 (x) or arctan(x)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 4 4 4 5 5 7 7 7 9 9 9 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 11 11 13 16 16 17 19 19 20 20 3 Inequalities 21 3.1 Solving inequalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2 Sketching Reciprocal Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4 Limits and Asymptotes 4.1 Definition and basic properties of limits . . . . 4.2 Calculating limits with help of standard limits 4.3 Asymptotes . . . . . . . . . . . . . . . . . . . . 4.4 Physical Example of Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 25 26 28 31 5 Differentiation 5.1 Definition and geometric interpretation . 5.2 Common Derivatives . . . . . . . . . . . 5.3 Higher Order Derivatives . . . . . . . . 5.4 Rules for Differentiation . . . . . . . . . 5.5 Logarithmic Differentiation . . . . . . . 5.6 Implicit Differentiation . . . . . . . . . . 5.7 Derivatives of Inverse Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 32 33 33 34 34 36 36 . . . . . . . . . . . . . . . . . . . . . 1 . . . . . . . 5.8 5.9 5.10 5.11 5.12 5.13 5.14 5.15 5.16 Parametric Differentiation . . . . . . . . . . . . . . . Application to a real life situation . . . . . . . . . . Application of the derivative for evaluation of limits: Stationary points . . . . . . . . . . . . . . . . . . . . Global max and min on a closed bounded interval . Curve Sketching . . . . . . . . . . . . . . . . . . . . Application to Optimisation . . . . . . . . . . . . . . Differentials - Estimating Small Changes . . . . . . . Leibniz Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . L’Hopital’s Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 37 38 39 41 41 42 43 43 6 Taylor and Maclaurin Series 6.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . 6.2 Calculating Maclaurin series and polynomials . . . 6.3 Estimating the error term . . . . . . . . . . . . . . 6.4 Manipulation of Maclaurin Series . . . . . . . . . . 6.5 Taylor Series . . . . . . . . . . . . . . . . . . . . . 6.6 Newton’s Method for solving non-linear equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 45 46 48 49 49 50 7 Integration 7.1 Primitives . . . . . . . . . . . . . . . 7.2 Integration by parts and substitution 7.3 Primitives and areas . . . . . . . . . 7.4 Properties of Definite Integrals . . . 7.5 Techniques of Integration . . . . . . 7.5.1 Substitution . . . . . . . . . . 7.5.2 Integration by Parts . . . . . 7.5.3 Integrals using Trig Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 52 54 55 56 57 57 58 59 8 Ordinary Differential Equations (ODE’s) 8.1 ODE of lst order . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Separable equations . . . . . . . . . . . . . . . . . . . . . . . . 8.3 An application . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.4 2nd order homogenous linear ODE’s with constant coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 60 66 67 68 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Functions in several variables 70 9.1 Partial derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 9.2 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 9.3 The Chain Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 2 Chapter 1 Exponentials and logarithms You can read more in J/S sections §1.1 ,§1.7 and §1.10 - §1.12. 1.1 The real numbers These have evolved through the times as follows: I. The natural numbers, N (for counting) 0, 1, 2, . . . II. The integers, Z (for debit-credit) . . . , −2, −1, 0, 1, 2, . . . III. The rationals, Q (for dividing into parts) m/n where m, n ∈ Z and n 6= 0. These can be arranged on the “rational line” −5/3 • 0 1/2 • • 1 • 2 • → Q The rationals can also be represented as finite or infinite periodic decimals: 1/3 = 0.33 · · · 3/2 = 1.5 With these we can perform the arithmetic operations +, −, • and /. IV. The real numbers, R We want to use numbers for measuring and evaluating various terms within the natural sciences length, area, mass, energy, pressure, · · · Unfortunately, Q doesn’t suffice for this. 3 Example. ↑ Q a2 = 12 + 12 = 2 (Pythagoras) 1• • · a· ·· ·• • ◦ 1 a → Q But there is no rational a such that a2 = 2. This means that the rational line has “holes” and we can’t even use the rationals to evaluate lengths of simple straight line segments. We need to extend the rational numbers to deal with this handicap. This we do by filling in all these holes by new numbers. The√result are the√real numbers. How can these be represented? For example, if we denote the number a above by 2. What is 2? Notice that 1.42 < 2 < 1.52 1.412 < 2 < 1.422 1.4142 < 2 < 1.4152 ⇒ √ 1.4 < √2 < 1.5 1.41 < √2 < 1.42 1.414 < 2 < 1.415 .. . We can continue indefinitely and what we get is an infinite non-periodic decimal √ 2 = 1.41421356 · · · The real numbers: All decimals (finite, infinite, periodic, non-periodic). 1.2 Functions This is another fundamental notion for natural sciences. Often various terms are related to each other through a formula. For example a particle with a mass m that moves with speed v has kinetic energy E = 1/2 · mv 2 . Here E is a function in v, namely E = f (v) where f (v) = 1/2 · mv 2 . 1.2.1 Definition A function f is determined by a domain Df and a “rule” that assigns, to every element x in the domain, a value f (x). The set of all the values is denoted by Vf and sometimes called the range of the function. Usually f (x) is determined from a formula. Example. f (x) = √ x − 1, x ≥ 1. Here Df = [1, ∞) and Vf = [0, ∞)i. 1.2.2 Inverses Definition. We say that f is injective if distinct elements in Df always have distinct values (i.e. a 6= b ⇒ f (a) 6= f (b)). Examples. (a)The function f (x) = x3 , x ∈ R 4 is injective as it is strictly increasing and thus no value occurs twice. (b) The function f (x) = x2 , x ∈ R is on the other hand not injective as there are values that occurs more than once. For example f (1) = f (−1). If f is injective then there is a unique source for each value (as no value occurs more than once). There is thus a function F that reverses the process: has Vf as its domain, Df as its range and takes each value back to its source. f → y = f (x) iff x = F (y) x y ← Df F Vf Notice that DF = Vf VF = Df F (f (x)) = x f (F (y)) = y Example. The function f (x) = x3 , x ∈ R has as inverse F (x) = 1.3 1.3.1 √ 3 x, x ∈ R. Exponentials Powers For any real number a, a2 = a × a and subsequently an = a × a × · · · × a for any positive integer. We want | {z } n times to extend the definition to the more general case when n is a real number. A. an where n is an integer. Example. divide by 2 ↑ .. . 1 2−2 = 2·2 = 14 1 −1 2 =2 20 = 1 21 = 2 22 = 2 · 2 = 4 23 = 2 · 2 · 2 = 8 .. . multiply by 2 ↓ Similarly for an for an arbitrary a. In particular a−n = As 1 a/b 1 . an = b/a (explanation: 1 1 · b/a b/a = = = b/a) a/b a/b · b/a 1 5 we have in particular (a/b)−n = (b/a)n . The Exponential Laws 1. an × am = an+m . 2. an ÷ am = an−m . 3. (an )m = an×m . 4. (ab)n = an bn , similarly a n b = an bn . Notice also that 5. a0 = 1, for any a 6= 0. 6. 1n = 1. 7. a−n = 1/an . 8. If an = am then n = m. The main point to make here is that all these laws are natural. Instead of memorising them, I suggest that you recall instead each time you use them why they are natural. Examples 1. 22 × 23 = 25 = 32 2. (22 )3 = 26 = 64 3. 22 ÷ 23 = 2−1 = 1 21 4. (3x)3 = 27x3 2 5. 52 = 25 4 2 2 −2 6. 3 = 32 = 9 4 = 1 2 B. an where n is a real number and a > 0. What is the logical definition of 21/3 ? If the power laws above are still to hold, we should have 1 So we should set 21/3 = √ 3 (21/3 )3 = 2 3 ·3 = 21 = 2. 2. Similarly √ 3 22/3 = (21/3 )2 = ( 2)2 . So the following general definition is very natural. √ Definition. am/n = ( n b)m . √ Now what about irrational numbers. What is for example 2 2 ? This can be defined according to the following principle √ 1.4, 1.41, 1.414, . . . → 2√ 21.4 , 21.41 , 21.414 , . . . → 2 2 √ What this means is that if the first sequence is a sequence of rationals√that has 2 as a limit then the second sequence is going to tend to some limit. This limit we can define as 2 2 . Similarly for ax in general where x is a real number. 6 More examples √ 1. (32)1/2 = (25 )1/2 = 25/2 = 22 .21/2 = 4 2 √ 1/2 1/2 3 1/2 2. 4x3 = 22 x3 = 22 x = 2x3/2 1/4×3 3. 163/4 = (16) 1.3.2 = 161/4 3 = 23 = 8 The Exponential Function let a > 0, a 6= 1. The function f (x) = ax , x ∈ R is called the exponential function with base a. 10 9 Blue: y = (1.5)x Green: y = 2x Red: y = 3x Light Blue: y = (0.5)x 8 7 6 5 4 3 2 1 1.5x 2x 3x 0.5x 0 !1 !3 !2 !1 0 1 2 3 Figure 1.1: The Exponential Functions In general, we obtain an exponentially increasing function in x if a > 1, and exponentially decreasing if 0 < a < 1. Here the domain is Df = R and the range is Vf = (0, ∞). Example. Suppose that we have a population of 10 millions. Supposing that we have the constant population growth rate of 1% per year, what is the population going to be in 10 years time? Solution. The answer is 10 · (1.01)10 ≈ 11.05 millions. An important special case for the exponential functions is when the base a is the irrational number e = d x 2.71828182 . . . . The function f (x) = ex is often written exp(x) it has the following key property that dx e = ex and crops up frequently (as we will see) when dealing with differential equations. 1.4 Logarithms Example. We continue from last example. After how many years will the population double in size? Solution. We are now interested in the inverse problem as we want to solve the equation (a = 1.01) ax = 2. That is we want to find the source for the exponential function f (x) = ax that gives the value 2. The answer is denoted loga 2. So F (x) = loga x is the inverse function to f (x) = ax . With a calculator we see that the answer is loga 2 ≈ 69.7 years. 1.4.1 The logarithm function The function loga x is defined to be the inverse of the function ax . It thus has as domain the interval (0, ∞) (the range of the function ax ) and range (−∞, ∞) (the domain of ax ). Also by the inverse property y = loga x iff x = ay . 7 Natural Log graph 3 2 y 1 0 !1 !2 !3 !1 !0.5 0 0.5 1 x 1.5 2 2.5 3 Figure 1.2: The log Function y = loga x In other words: to which power must a be raised to obtain x? Answer loga x. If a = e then y = loge x = ln x. This is called the natural logarithm Example. log2 8 = 3 since 23 = 8 log3 (1/9) = −2 since 3−2 = 1/9 √ √ log5 ( 5) = 1/2 since 51/2 = 5. Since loga x is strictly increasing or decreasing and since this is the inverse to ax we have the following properties If loga x = loga y then x = y If ln x = ln y then x = y aloga x = x eln x = x x loga a = x ln ex = x Moreover we have the following laws: The logarithm laws 1. 2. 3. 4. 5. 6. loga (xy) = loga (x) + loga (y) loga (x/y) = loga (x) − loga (y) loga xn = n · loga x loga 1/x = − loga x loga 1 = 0 loga a = 1 ln xy = ln x + ln y ln x/y = ln x − ln y ln xn = n · ln x ln 1/x = − ln x ln 1 = 0 ln e = 1 Proof of 1 and 2 Suppose that x = an and y = am . Notice that it follows that n = loga x and m = loga y. Then (1) loga xy = loga an · am = loga an+m = n + m = loga x + loga y (2) loga x/y = loga an /am = loga an−m = n − m = loga x − loga y. In fact it is sufficient to use ln. All the other logarithms can be calculated from this one using the following change-of-base formula: loga x logb x = . loga b In particular if we choose a = e we have logb x = 8 ln x . ln b 1.5 1.5.1 Various examples and applications of the exponentials and the logarithms Equations with Exponentials and Logs Eq 1. ln 4x = 3. Solution. Taking exponentials of both sides gives eln 4x = e3 ⇔ 4x = e3 1 ⇔ x = e3 4 Eq 2. 2x = 5. Solution. Taking natural logs of both sides gives ln 2x = ln 5 ⇔ x ln 2 = ln 5 ln 5 ⇔ x= . ln 2 Eq 3. ln(x + 1) = ln x + 3. Solution. Taking exponentials eln(x+1) = eln x+3 = eln x e3 = xe3 ⇔ x + 1 = xe3 1 = x(e3 − 1) 1 . ⇔ x= 3 e −1 ⇔ Eq 4. ln(x + x2 ) = ln x + ln x2 . Solution. The RHS is equivalent to ln x3 using property 3 of ln. Hence taking exponentials x + x2 = x3 ⇔ x x2 − x − 1 = 0. √ So that x = 0 or x = 1±2 5 . But the arguments of log must be strictly positive so x = 0 and x = √ allowed.Therefore x = 1+2 5 is the only solution. 1.5.2 √ 1− 5 2 aren’t Examples from Chemical Engineering pH for acids pH is a measure of the strength of an acid (Broented-Larry theory of acids and bases - acids are proton donors), where the formula pH = − log10 [H + ] gives the concentration in mol/dm−3 . Hence, acids with high [H + ] have low pH and conversely, bases have low [H + ] and thus high pH. 9 Chemical Decay A chemical, c, decays exponentially according to the rule c = 10e−kt where t is time and k is unknown. After 30 hours c = 2.5. Find k. Solution. Concentration at t = 30 is c = 2.5. Therefore we must solve 2.5 = 10e−30k . This gives 1 1 = e−30k ⇔ ln = ln e−30k = −30k 4 4 1 1 1 ⇔ k = − ln = − . (−2 ln 2) 30 4 30 1 ⇔ k= ln 2. 15 Carbon Dating A constant proportion of the carbon atoms in any living creature is made up of the radioactive isotope 14 C of carbon. This proportion remains constant in any living creature. However, when a living organism dies it ceases its metabolism of carbon and the process of radioactive decay into normal carbon begins. This full fills the equation (a solution to a certain differential equation that arises from experiment) N (t) = N (0)e−kt where N (0) is the amount of 14 C when the animal died and N (t) is the amount t years later. This can be used to estimate how long time ago the animal died. Example. Given the decay constant k ≈ 0.0001216 find how long ago an animal died if it has only 88.55% of its 14 C left. Solution. If 88.55% of 14 C is remaining then the ratio of the initial amount of amount N (t) found at our unknown time t is such that 0.8855 = 14 C denoted N (0) to the N (t) = e−kt . N (0) Taking natural logs on both sides gives ln(0.8855) = −kt = −(0.0001216)t ⇔ t = − ln(0.8855) = 1000. 0.0001216 So we can conclude that the animal died 1000 years ago. 1.5.3 Application of Logs - Parameter Estimation Consider an equation of the form y = kxn where k and n are unknown constants. Question: Is it possible to find values of k and n given certain values of x and y from the graph of y = kxn ? (Recall the equation of a straight line y = mx + c for y-intercept c and slope m). Method: Take ln and the result is ln y ln y |{z} = ln(kxn ) = ln k + ln xn = n |{z} ln x + |{z} ln k X Y c which looks like the equation of a straight line except we have ln y and ln x instead of y and x. If we plot ln y against ln x then gradient = n and intercept on ln y axis is ln k. 10 Chapter 2 Trigonometry You can read more in J/S: 1.5, 1.6 and 1.8. 2.1 Angles and the unit circle S B θ A R Figure 2.1: Circle of radius R. Let S equal the length of the arc from A to B. Then θ= S R radians Here we consider a oriented angle. It is positive if we move counterclockwise and negative if we move clockwise. For example, for a quarter circle S = 1. 60o = π 3 radians 2. 45o = π 4 radians 3. 30o = π 6 radians πR 2 , hence θ = π/2 radians or 90o . Remember Generally we convert from Degreees to Radians by θ = θo π 180 radians Recall. The area of the sector that the angle θ cuts out of a circle of radius R is given by A = 2.2 The right angled triangle 11 θR2 2 . Consider a right angled triangle. hypotenuse c opposite b Pythagoras: a2 + b2 = c2 x adjacent a Figure 2.2: Right Angled Triangle From the triangle we define the value of the trigonometric functions cos, sin and tan for angles 0 ≤ x ≤ π/2. • sin x = b c • cos x = a c • tan x = b a Remarks. 1) We have that tan(x) = b/a = (2) cos2 x + sin2 x = (a/c)2 + (b/c)2 = a2 +b2 c2 b/c a/c = = c2 c2 sin x cos x . = 1. Two triangles to remember From the following two triangles (fig. 2.3 and 2.4) one can read off the exact values of the trigonometric functions in π/6, π/4 and π/3. • sin π4 = cos π4 = √12 and tan π4 = 1. • sin • sin π 3 π 6 √ = 3 2 , π 3 cos = 12 , cos π 6 1 2 and tan π 3 = 3 2 and tan π 6 = = √ = √ 3. √1 . 3 √ 2 45o = 1 π 4 1 Figure 2.3: Isoceles Triangle 12 30 = √ 2 60 = π 6 3 π 3 1 Figure 2.4: Half an Equilateral Triangle Laws 1. As the sum of the acute angles in a right angled triangle is π/2, the other acute angle is π/2 − x. From this one can thus read directly from the triangle c b x a Figure 2.5: Right Angled Triangle that: cos(π/2 − x) = b/c = sin x sin(π/2 − x) = a/c = cos x tan(π/2 − x) = a/b = 1/ tan x = cot x. 2.3 The trigonometric functions for arbitrary angles 13 Consider a circle of radius r with the centre at the origin. ŷ r y θ x̂ x Figure 2.6: Cartesian (x̂, ŷ) and polar r, θ coordinates Let θ be as in diagram. Then we define cos(θ) = sin(θ) = tan(θ) = x r y r y . x In particular if r = 1 then cos(θ) = x and sin(θ) = y. Notice that Dcos = R Vcos = [−1, 1] Dsin = R Vsin = [−1, 1]. By looking at the unitcircle one can read off the following table: x cos sin tan 0 1 0 0 π/4 √ 1/√2 1/ 2 1 π/2 0 1 undef. 3π/4√ −1/ √ 2 1/ 2 −1 π −1 0 0 5π/4√ −1/√2 −1/ 2 1 3π/2 0 −1 undef. 7π/4 √ 1/ √ 2 −1/ 2 −1 2π 1 0 0 Notice also that cos(x + 2π) = cos x, sin(x + 2π) = sin x, tan(x + π) = tan x. 14 Geometric presentation of tan: ŷ ·· t 1 · θ y x x̂ Figure 2.7: Geometric presentation of tan The gradient of the line that forms the angle θ is y/x = tan(θ). But this gradient is also equal to t/1. Hence t = tan(θ). From this presentation it is clear that tan(θ) → ∞ when θ → π/2− and tan(θ) → −∞ when θ → −π/2+ . Notice that Dtan = R \ {· · · , −π/2, π/2, 3π/2, · · · }, Vtan = R For the graphs of the functions cos, sin and tan, see either your written notes or look at section 1.6 in J/S. The signs of sin, cos, sin can be read easily from the unit circle. We get the following scheme + + − + − + − − − + + − sin cos tan Laws 2. From the unit circle ·· ·· 1 ·· x ·· ·· ··· · ·· ·· ·· ·· Figure 2.8: Laws 2 15 one can read off directly the following laws: cos(−x) = cos(x), cos(π − x) = − cos(x), sin(−x) = − sin(x), sin(π − x) = sin(x), tan(−x) = − tan(x), tan(π − x) = − tan(x), 2.4 2.4.1 cos(π + x) = − cos(x), sin(π + x) = − sin(x), tan(π + x) = tan(x). Trigonometric equations Some trigonometric equations Let u be a given angle. From the unit circle (see figure 2.8) we see that cos v = cos u ⇔ v = u + n · 2π or v = −u + n · 2π sin v = sin u ⇔ v = u + n · 2π or v = (π − u) + n · 2π tan v = tan u ⇔ v = u + n · π where n can be any integer. Examples. (1) cos x = √ 3/2 Solution. We know from one of the triangles that we should remember that one solution is x = π/6. According to the general scheme above the general solution is therefore x = π/6 + n · 2π or x = −π/6 + n · 2π, n ∈ Z. (2) sin 3x = sinx. Solution. If v = 3x and u = x then according to general situation we have 3x = x + n · 2π or 3x = π − x + n · 2π m 2x = n · 2π or 4x = π + n · 2π m x=n·π or x = π/4 + n · (π/2) where n ∈ Z. (3) sin 5x = cos 3x. Solution. First use sin 5x = cos(π/2 − 5x). Then we want to solve cos(π/2 − 5x) = cos 3x. Now we can use the general method π/2 − 5x = 3x + n · 2π or π/2 − 5x = −3x + n · 2π m 8x = π/2 − n · 2π or 2x = π/2 − n · 2π m x = π/16 + n · (π/4) or x = π/4 + n · π where n ∈ Z. (4) tan 2x = − tan x. 16 Solution. We use tan(−x) = − tan x. Thus we need to solve tan 2x = tan(−x). The solution according to the general method is 2x = −x + n · π ⇔ 3x = nπ ⇔ x = n · (π/3) where n ∈ Z. Laws 3. Here are some more formulas that one meets frequently. (For more formulas see J/S page 26) cos(x + y) = cos x · cos y − sin x · sin y sin(x + y) = sin x · cos y + cos x · sin y cos 2x = cos2 x − sin2 x = 2 cos2 x − 1 = 1 − 2 sin2 x = 2 sin x · cos x. sin 2x Examples. (1) Calculate the exact value of sin 75o . Solution. We have sin 75o sin(45o + 30o ) = sin 45o · sin 30o + cos 30o · sin 45o √ 3 1 1 1 ·√ = √ · + 2 2 2 2 √ 3+1 √ . = 2 2 = (2) Find the exact value of cos π/8. Solution. Solving the equation cos 2x = 2 · cos2 x − 1 for cos x, gives cos2 x = In particular, 1 + cos 2x . 2 √ √ 1 + cos π/4 1 + 1/ 2 2+1 √ . cos π/8 = = = 2 2 2 2 2 It follows that p√ cos π/8 = 2.4.2 2+1 . 23/4 To Convert a Sum to a Harmonic Form (Read more in J/S page 15/16). Given a, b and u find c and φ so that cos (x + φ) a cos(x) + b sin(x) = c | {z } | {z } sum of cos and sin harmonic function for amplitude c and phase shift φ. • Step 1: Find P = (a, −b) on x, y plane • Step 2: Draw line from P to origin. √ Length OP is given by c = a2 + b2 and φ is the polar angle of P. 17 y (a, −b) φ x Figure 2.9: Harmonic Sum Description Sketching Harmonic Solution To sketch for general harmonic function y = c cos (ωx + φ) note the following. 1. Observe one wavelength of the cosine function has length 2π/ω. 2. The beginning of our cosine wave now starts from x = − ωφ and one wavelength ends at x = − ωφ + It is out of phase by φ units in x. 2π ω . 3. Also note our wave is magnified by constant c, so the range of y is between y ∈ [−c, c], rather than y ∈ [−1, 1]. Harmonic Function: y=c*cos(wx+phi)) 3 c 2 y 1 0 !!/" (!/2 !#)" (2!!#)/" !1 !2 !3 !2 0 2 4 6 8 10 12 x Figure 2.10: Harmonic Sketch Examples of converting a sum to a harmonic form √ 1. cos(x) − sin(x) = c cos(x + φ). Now a = 1, b = −1 so that P = (1, 1). Therefore c = 2 and φ = π4 . √ Hence cos(x) − sin(x) = 2 cos x + π4 . √ √ √ 2. cos(x) − 3 sin(x) = c cos(x + φ). Now a = 1, b= − 3 so that P = (1, + 3). Therefore c = 2 and √ φ = − π3 . Hence cos(x) + 3 sin(x) = 2 cos x + π3 . √ 3. − sin(x) + 4 cos(x) = c cos(x + φ). Now a = 4, b = −1 so that P = (4, 1). Therefore c = 17, but finding φ is not so straightforward. Looking at the triangle φ satisfies tan(φ) = 14 or sin(φ) = √117 . So φ is the angle whose sin is √117 , such that φ = sin−1 √117 . This leads us on to inverse trig functions. 18 y √ 17 1 φ x 4 Figure 2.11: Harmonic Example 3 2.5 2.5.1 The inverses to the trigonometric functions The inverse sine function sin−1 x or arcsin x Consider y = sin(x) restricted to the interval − π2 ≤ x ≤ π 2 and −1 ≤ y ≤ 1. sin(x) 1 0.8 0.6 0.4 y 0.2 0 !!/2 !/6 !/2 !0.2 !0.4 !0.6 !0.8 !1 !1.5 !1 !0.5 0 x 0.5 1 1.5 Figure 2.12: sin(x) The inverse sine function sin−1 (x) or (arcsin(x)) is defined as follows. For −1 ≤ x ≤ 1, y = sin−1 (x) if x = sin(y) and −π/2 ≤ y ≤ π/2. In words ’y is the angle whose sine is x’ and lies between −π/2 and π/2. sin(x) !/2 1.5 1 !/6 y 0.5 0 !0.5 !1 !1.5 !1 !0.8 !0.6 !0.4 !0.2 !!/2 0 x 0.2 0.4 0.6 0.8 1 Figure 2.13: y = sin−1 (x) Since arcsin x is the inverse of sin x, −π/2 ≤ x ≤ π/2, we have Darcsin = [−1, 1], Varcsin = [−π/2, π/2]. 19 Also arcsin(sin x) = x if −π/2 ≤ x ≤ π/2 sin(arcsin x) = x if −1 ≤ x ≤ 1. Warning. arcsin(sin π) = arcsin(0) = 0 but not π. Examples 1. sin−1 2. sin−1 2.5.2 1 2 = π6 since sin − 12 = − π6 π 6 = 1 2 The Inverse Cosine Function (cos−1 (x) or arccos(x)) The function cos x, 0 ≤ x ≤ π is injective. The inverse is called cos−1 or arccos. (For the graph see your handwritten notes or J/S page 20). So arccos(x) = y ⇔ x = cos(y), and 0 ≤ y ≤ π. Note that Darccos = [−1, 1], Varccos = [0, π]. Also 0≤x≤π arccos(cos x) = x if cos(arccos x) = x if −1 ≤ x ≤ 1. Examples √ 1. cos−1 − 23 = 2. cos−1 2.5.3 1 2 = 2π 3 π 3 The Inverse Tangent Function (tan−1 (x) or arctan(x)) The function tan x, −π/2 < x < π/2 is injective. The inverse is called tan−1 or arctan. (For the graph see your handwritten notes or J/S page 20). So arctan(x) = y ⇔ x = tan(y), and − π/2 < y < π/2. Note that Darctan = R, Varctan = [−π/2, π/2]. Also arctan(tan x) = x if −π/2 < x < π/2 tan(arctan x) = x if x ∈ R. Examples 1. tan−1 (1) = π/4 √ 2. tan−1 (−1/ 3) = −π/6. 20 Chapter 3 Inequalities 3.1 Solving inequalities We will often have to deal with inequalities later on in the course. For example in order to sketch a graph to a function we need to solve f 0 (x) > 0 to find out where the function is increasing. Example 1. Solve −1 < 1 − 4x ≤ 3. Solution. We deal with the left hand side (LHS) and right hand side (RHS) of the inequality seperately: −1 < 1 − 4x add one to both sides 0 < 2 − 4x add 4x to both sides 4x < 2 divide both sides by 4 1 x< 2 or 1 − 4x ≤ 3 subtract 1 from both sides −4x ≤ 2 divide both sides by 4 1 −x ≤ 2 multiply each side by -1 and so reflect the inequality 1 x≥− 2 Hence combining the solutions from the LHS and RHS we have − 21 ≤ x < 21 . 2 One has to be extra careful when dealing with inequalities. Example. Solve 1 = 1. x−2 Solution. We multiply through by x − 2 one both sides. This gives 1 = x − 2 ⇔ x = 3. Example 2. Solve the inequality 1 >1 x−2 False attempt. We multiply again through by x − 2. This gives 1 > x − 2 ⇔ x < 3. 21 However if we check the inequality on x = 0 (which is less than 0) we should have 1 > 1. −2 But this is absurd as the LHS is negative. 2 Where did we cheat? The problem is that when multiplying with x − 2 we might (for some values of x) be multiplying with negative number. But then the inequality should change. For example −1 < 2 but (−1) · (−1) > (−1) · 2. There is a way around this: Solution to Example 1. Subtract 1 from both sides. This gives 1 1 1 >1 ⇔ − >0 x−2 x−2 1 (x − 2) 1 − >0 ⇔ x−2 x−2 1−x+2 >0 ⇔ x−2 3−x ⇔ >0 x−2 What have we gained by doing this? Now we can write a sign table for this fraction. Notice that the numerator is zero when x = 3 and the denominator is zero when x = 2. x 3−x x−2 3−x x−2 + - 2 + 0 o + + + 3 0 + 0 + - From the table we read that the fraction is strictly positve when 2 < x < 3. Answer: 2 < x < 3. Remark. Instead of solving this inequality algebraically one could have done it grahphically. Look at 1 the graph of x−2 (see figure 3.3 (b)). It is clear that the value of this function is strictly greater than 1 if and only if x is strictly between 2 and 3. Example 3. Solve x2 > 4. Solution. Here again one has to be careful. One cannot simply argue that x2 > 22 ⇒ x > 2. There are two solutions to the equation x2 = 4, namely −2 and 2. When x < −2 or x > 2 we have that the inequality holds wheras it does not hold when −2 ≤ x ≤ 2. Answer: x < −2 or x > 2. Example 4. Solve x> 1 . x Solution. Firstly x 1 x2 − 1 − >0⇔ > 0. 1 x x 22 Next we write a sign table. x x2 − 1 x x2 −1 x + - −1 0 0 0 0 o + 1 0 + 0 + - + + + From the table we read when the fraction is strictly greater than zero. Answer. −1 < x < 0 or x > 1. Graphical Solution Graphs of y=1/x and y=x 3 2 y 1 0 !1 !2 !3 !3 !2 !1 0 x 1 2 3 Figure 3.1: Plot of y = 1/x and y = x Example 5. Solve x+3 ≤ 2. x−1 Solution. We have x+3 ≤2 x−1 ⇔ ⇔ ⇔ ⇔ x+3 2 − ≤0 x−1 1 x + 3 2(x − 1) − ≤0 x−1 x−1 x + 3 − 2(x − 1) ≤0 x−1 5−x ≤0 x−1 The numerator is zero when x = 5 and the denominator is zero when x = 1. x 5−x x−1 3−x x−2 + - 1 + 0 o + + + 5 0 + 0 + - Answer: x < 1 or x ≥ 5. 23 Graphical Solution Graphs of y=(x+3)/(x!1) and y=2 10 y 5 0 !5 !5 0 5 10 x Figure 3.2: Plot of y = 3.2 x+3 x−1 and y = 2 Sketching Reciprocal Functions How does one sketch in general a reciprocal function. For example if we want to sketch the graph for could do this in few steps as follows: Sketch: i) y = x1 , ii) y = 1 x−2 and iii) y = x−1 x−2 . Note y = = x−2+1 x−2 =1+ (x!1)/(x!2) 3 2 2 2 1 1 1 0 0 0 y 3 !1 !1 !1 !2 !2 !2 !3 !3 !2 !1 0 x (a) y = 1 x−2 1/(x!2) 3 y y 1/x x−1 x−2 1 1 x 2 3 !3 !3 !2 !1 0 x (b) y = 1 2 3 1 x−2 Figure 3.3: Reciprocal Functions 24 x−1 x−2 , !3 !3 !2 !1 0 x (c) y = 1 x−1 x−2 2 3 we Chapter 4 Limits and Asymptotes 4.1 Definition and basic properties of limits What do we mean by 1 =0 x (“the limit for 1/x is zero as x tends to infinity”) alternatively expressed lim x→∞ 1 → 0 as x → ∞ x (“1/x tends to zero as x tends to infinity”)? Loosely speaking, 1/x can be made as close to zero as we please by choosing x big enough. How big x needs to be chosen depends ofcourse on how close we want to be to zero: |1/x − 0| < 0.1 if x > 10 |1/x − 0| < 0.01 if x > 100 |1/x − 0| < if x > ω = 1/ (Recall If x is a real number, the modulus of x, written |x| is defined as x x≥0 |x| = −x x < 0 Examples: |3| = 3, | − 2| = −(−2) = 2). Generally. We write lim f (x) = A x→a or f (x) → A as x→a to mean that f (x) can be made as close to A as we please by choosing x close enough to a. Rules of limits. Suppose lim f (x) = A, x→a and where A, B are some real numbers. Then (1) f (x) + g(x) → A + B 25 lim g(x) = B x→a (2) f (x) · g(x) → A · B (3) f (x)/g(x) → A/B (if B 6= 0). Also if f (x) → b as x → a and g(x) → c as x → b. Then (4) g(f (x)) → c as x → a. Examples. (1) We have limx→0 sin x = 0 we have, using (1)-(3) that sin2 x + 1 02 + 1 = = −1. x→0 sin x − 1 0−1 lim (2) Since e−x → 0 as x → ∞ and sin x → 0 as x → 0 we have from (4) that sin(e−x ) → 0 as x → ∞. Warning In (1)-(3) we are assuming that A, B are real numbers. One should never apply “false formulas” like 0 · ∞ = 0, ∞/∞ = 1, 0/0 = 0. This leads to a catastrophe! Example 3. What is x2 − 3x + 2 ? x→1 x−1 Solution. We have that x2 − 3x + 2 and x − 1 both tend to 0 as x → 1. We can’t however conclude that the 2 fraction x −3x+2 tends to 0/0 = 1. Instead use factorisation x−1 lim x2 − 3x + 2 (x − 1)(x − 2) = = x − 2 → 1 − 2 = −1 x−1 x−1 as x → 1. Definition. By x → a+ we mean that x tends to a from above/right. Similarly x → a− means that x tends to a from below/left. Example 4. limx→0+ limx→0− Since these are different the limit limx→0 4.2 |x| x |x| x |x| x = limx→0+ = limx→0− x x =1 −x x = −1. does not exist on the other hand. Calculating limits with help of standard limits I. Comparison of ln x, xα and ax as x → ∞. Let α > 0 and a > 1. One can show that the growth of ln x is slower than the growth of xα which then is slower than the growth of ax . (Compare the graphs of these three functions). In other words ln x →0 xα α x →0 ax as x→∞ as x→∞ 26 or equivalently xα →∞ ln x x a →∞ xα as x→∞ as x→∞ Example 5. Calculate ex + x2 + ln x x→∞ 3ex + 2x Solution. We shorten with the stongest term in the denominator. lim ex + x2 + ln x 3ex + 2x 2 = → 1 + xex + lnexx 3 + (2/e)x 1+0+0 1 = 3+0 3 as x → ∞. (Notice that since 2/e < 1 we have that (2/e)x tends to zero). II. Some standard limits of type “0/0” when x → 0 You should know the following standard limits (important for differentiation of ln x, sin x and ex ). As we will see we can also calculate other limits from these standard ones. Standard limits. sin(x) x ex − 1 lim x→0 x ln(1 + x) lim x→0 x lim x→0 = 1 (4.1) = 1 (4.2) = 1. (4.3) Example 6. Calculate lim x→0 Solution. We have sin 5x 3x sin 5x 5x sin 5x = · → 1 · 5/3 = 5/3. sin 3x 5x 3x Example 7. Calculate 2 ex − 1 lim . x→0 ln 1 + 7x Solution. We have 2 2 2 ex − 1 ex − 1 7x x2 ex − 1 7x x = · · = · · →1·1·0=0 2 2 ln 1 + 7x x ln 1 + 7x 7x x ln 1 + 7x 7 as x → 0. 27 4.3 Asymptotes Definition: An asymptote to a curve is a straight line to which the curve approaches as the distance from the origin increases. Look at the graphs in figure 4.1. It is clear from the graphs that the horizontal line y = 0 is an assympot for y = e−x , and y = 1/x as x → ∞. Also y = 1 is an asympote for y = 1 − e−x when x → ∞. In fact lim e−x x→∞ lim 1 x→∞ x −x lim 1 − e x→∞ = 0 = 0 = 1. Also y = 0 is an horizontal asympote as x → −∞. Which also follows from lim x→−∞ 1 = 0. x On the other hand there is no horizontal asympote when x → ∞ for y = ex and indeed limx→∞ ex = ∞. For (c) the situation is different. We don’t have any horizontal asympote but x = 0 is a vertical asymptote. As x approaches 0 from the right we have that y → −∞. Graph of y=exp(!x) and y=exp(!2x) Graph of y=exp(x) 1.5 Graph of y=ln(x) 5 5 4 4 1 3 2 3 2 0 y y 1 y 0.5 0 !1 1 !2 !0.5 !3 0 !4 0.5 1 1.5 2 (a) Ex1: y = 2.5 x 3 e−x , 3.5 4 y= 4.5 !1 5 0 0.2 0.4 e−2x 0.6 0.8 1 x 1.2 1.4 1.6 1.8 2 !5 0 0.2 0.4 0.6 0.8 (b) Ex2: y = ex Graph of y=1!exp(!x) 1.5 4 3 1 2 1 0.5 !1 !2 0 !3 !4 !5 !5 !4 !3 !2 !1 0 x 1 (d) Ex4: y = 2 3 4 5 1.2 1.4 1.6 (c) Ex3: y = ln(x) Graph of y=1/x 5 0 1 x y 0 y !1 !0.5 1 x 0 0.5 1 1.5 2 2.5 x 3 3.5 (e) Ex5: y = 1 − Figure 4.1: Some asymptotes 28 4 e−x 4.5 5 1.8 2 I. How to find horizontal asymptotes analytically. We have that y = a is a horizontal asymptote to y = f (x) if and only if lim f (x) = a or x→∞ lim f (x) = a. x→−∞ II. How to find vertical asymptotes analytically. We have that x = a is a vertical asymptote if and only if lim f (x) = ±∞ or x→a+ lim f (x) = ±∞. x→a− (A candidate for x = a we normally find where f (a) is not defined). Example 1. Find all vertical and horizontal asympotes to y= x−2 . 2x + 3 Then sketch the graph. Solution. Step 1. Horizontal asymptotes. We have x−2 2x + 3 = → 1 − x2 2 + x3 1/2. As x → ∞ and also as x → −∞. So y = 0 is a horizontal asymptote as x → ±∞. (You can write this line as a dotted line in your coordinate system). x−2 is not defined when 2x + 3 = 0 ⇔ x = −3/2. So Step2. Vertical asymptotes. We have that the fraction 2x+3 x = −3/2 is a candidate for a vertical asymptot. When x is little bigger than x = −3/2 we have that x−2 −7/2 ≈ = −big 2x + 3 +small So lim x→−3/2+ x−2 = −∞. 2x + 3 When x is little less than −3/2, we have that x−2 −7/2 ≈ = +big 2x + 3 −small and lim x→−3/2− x−2 = ∞. 2x + 3 Thus x = −3/2 is a vertical asymptot both when we approach −3/2 from the left and from the right. Step 3. Sketch the graph. This you can do by first making a table. (It is a good practise also to check where the curve meets the x-axis and the y-axis). See figure 4.2. 29 (x!2)/(2x+3) 3 2 y 1 0 3/2 !2/3 !1 !2 !3 !3 !2 !1 0 x 1 2 Figure 4.2: Plot of y = 3 x−2 2x+3 Example 2. Find all the horizontal and vertical aympotes to y= 2x + 1 x and sketch the graph. Solution. Step 1. Horizontal asymptotes. We have 2x + 1 x = 2+ 1 x → 1/2. As x → ∞ and also as x → −∞. So y = 0 is a horizontal asymptote as x → ±∞. (You can write this line as a dotted line in your coordinate system). Step2. Vertical asymptotes. We have that the fraction 2 + 1/x is not defined when x = 0. So x = 0 is a candidate for a vertical asymptot. When x is little bigger than 0 we have that 2 + 1/x ≈ 2 + 1 = 2 + big = big +small So lim 2 + 1/x = ∞. x→0+ When x is little less than 0, we have that 2 + 1/x ≈ 2 + 1 = 2 − big = −big −small and lim− 2 + x→0 1 = −∞. x Thus x = 0 is a vertical asymptote both when we approach 0 from the left and from the right. (You can add this line as a dotted line to your coordinate system). Step 3. Sketch the graph. See figure 4.3. 30 (2x+1)/(x) 8 7 6 5 4 y 3 2 1 0 !1 !2 !3 !3 !2 !1 0 x 1 Figure 4.3: Plot of y = 4.4 2 3 2x+1 x Physical Example of Limits B The recommended correlation for viscosity of liquids is ln µ = A + T +C where µ is the viscosity, T is temperature, with A, B constants. The constant c is given by C = 17.71 − 0.19Tb where Tb is the normal boiling point in Kelvin. Hence for n-Propane c = −26.18 Question 1: Plot ln µ for A = −1 and B = 2. Question 2: What is the viscosity as T → ∞? Solution 1: For plot see below. Solution 2: Taking exponentials µ = exp −1 + 2 e−1 limT →∞ exp T −26 = e−1 . 2 T −26 = exp(−1) × exp !1+2/(x!26) 8 7 6 5 4 y 3 2 1 0 !1 !2 !3 20 21 22 23 24 25 x 26 27 28 Figure 4.4: Plot of y = −1 + 31 29 30 2 T −26 2 T −26 . Hence limT →∞ µ = Chapter 5 Differentiation 5.1 Definition and geometric interpretation Let us consider some examples. Example 1 Suppose a car is moving on a straight road (x-axis). Its displacement (distance) from the origin at time t is given by x = s(t). After time t + ∆t the displacement is s(t + ∆t). Then the instantaneous velocity v(t) at time t is defined by s(t + ∆t) − s(t) change in distance travelled v(t) = lim = ∆t→0 ∆t change in time For notation purposes we define lim ∆t→0 s(t + ∆t) − s(t) ds(t) = = rate of change of distance with respect to time ∆t dt Acceleration a(t) of the car at time t is then given by d dv(t) = a(t) = dt dt ds(t) dt = d2 s(t) dt2 Example 2 Consider the change in surface area of a sphere (e.g. an expanding balloon). Then we define • Surface area Sa with radius r is given by Sa = 4πr2 2 • After some time the surface area has changed such that Sa = 4π (r + ∆r) 4π r2 + 2r∆r + ∆r2 − 4πr2 4π 2r∆r + ∆r2 Change in Area 4π(r + ∆r)2 − 4πr2 = = = = 4π (2r + ∆r) Change in Radius ∆r ∆r ∆r Now using limit rules lim ∆r→0 Change in Area = 8πr = Rate of change of area with respect to radius Change in Radius Now for the general mathematical defininition: Let f (x) be a function defined on a real open interval and let x0 be any point in the interval, then Definition The limit lim∆x→0 f (x0 +∆x)−f (x0 ) ∆x is said to be the derivative of f (x) at x0 and it is denoted f 0 (x0 ) or 32 df (x0 ) dx . So f 0 (x0 ) is the rate of change in the value at x = x0 with respect to the input. Geometric Interpretation We have that f 0 (x0 ) can be interpreted as the gradient of the tangent line to the curve y = f (x) at the point (x0 , f (x0 ). (See your handwritten notes or J/S 2.1 for a figure). 5.2 Common Derivatives f (x) f (x) f (x) f (x) f (x) f (x) f (x) f (x) = = = = = = = = f 0 (x) f 0 (x) f 0 (x) f 0 (x) f 0 (x) f 0 (x) f 0 (x) f 0 (x) xn ex ekx ln(x) (x > 0) ax sin x cos x tan x = = = = = = = = nxn−1 ex kekx 1 x (ln a) ax cos x − sin x 1 cos2 x In the fifth case we prove the derivative by rearranging f (x) such that f (x) = ax = elna x = ex ln a , hence differentiating we pull down ln(a) and then rearrange ex ln a as ax . Example 1 Prove that (ex )0 = ex . We have ex+h − ex ex eh − ex eh − 1 = = ex → ex · 1 h h h as h→0 Here we have used one of the standard limits from last chapter. The formula (xn )0 = nxn−1 can be useful when differentiating 1/xn or expressions involving roots. Example 2. (1/x)0 = (x−1 )0 = (−1) · x−2 = −1/x2 . √ Example 3. ( x)0 = (x1/2 )0 = 5.3 1 2 · x−1/2 = 1 √ . 2· x Higher Order Derivatives We denote the second derivative by d2 y dx2 = d dx dy dx . Hence to differentiate sin(x) twice we have d2 (sin(x)) d (cos(x)) = − sin(x) = dx2 dx 2 d3 y d y d Similarly for third order derivatives dx 3 = dx dx2 Example 2 d y Show that y = e2x satisifes dx 2 − 4y = 0. If y = e2x then d dy d d2 y d 2x = = 2e2x = 2 e = 2.2e2x = 4e2x = 4y 2 dx dx dx dx dx 33 5.4 Rules for Differentiation You should know these rules. Here u and v are functions of x and k is a constant. Then 1. Sum Rule d dx (u + v) = du dx + 2. Factor Rule For k constant dv dx dk dx = 0, and d dx (ku) = k du dx dv = u dx + v du dx d d d Example: dx 3x + 1 sin(x) = 3x2 + 1 dx (sin(x))+sin(x) dx 3x2 + 1 = 3x2 + 1 cos(x)+6x sin(x) 1 du d 1 du dv u dv u 4. Quotient Rule dx v = v 2 v dx − u dx = v dx − v 2 dx 2 2 x 1 1−x2 d x2 + 1 .1 − x.2x = x(x+1−2x = (1+x Example: dx 2 +1)2 2 )2 x2 +1 = (x2 +1)2 3. Product Rule d dx (uv) 2 dy du dy = du . dx 5. Chain Rule If y = y(u) and u = u(x) then dx 2 Example: If y = ln x + 1 . Let y(u) = ln(u) and u(x) = x2 + 1 then dy dy du 1 2x = . = .2x = 2 dx du dx u x +1 2 Example: If y = (sin(x) + x) , then let u = sin(x) + x, hence dy du = 2u = 2 (sin(x) + x) (cos(x) + 1) dx dx Examples Find 1. d dx 3. d dx tan(x) = 4. d dx (x ln x) = x. x1 + ln(x).1 = 1 + ln(x) sin(x) d 2. dx = x12 (x cos(x) − sin(x)) x 2 ex d dx sin(x) cos(x) = 1 cos2 (x) cos2 (x) − sin(x) (− sin(x)) = 1 cos2 (x) . Let y(u) = eu , u(x) = x2 . Then applying the chain rule: dy dx = dy du du . dx 2 = eu .2x = 2xex dy dy du ln 2x2 + 1 . Let y(u) = ln(u), u = 2x2 + 1. Then dx = du . dx = u1 · 4x = 2x4x 2 +1 d 6. dx sin(cos(x2 )) Let f (x) = sin(u), u = cos(x2 ) = cos(v), v = x2 . Then df df du dv 2 2 dx = dx . dv . dx = cos(cos(x ). − sin(x ) .2x 2 2 2 2 dy d d x2 2 x2 7. dx y(x) = dx sin xex . Let y = sin(u), u = xex . Then du and dx = cos(xex )ex 1 + 2x2 dx = e +2x e 5. d dx 5.5 Logarithmic Differentiation (Read more in J/S §3.7 page 57). Generally suppose that we have some function y = y(x) and that we want to differentiate it. Let u = ln y then du du dy 1 dy = · = · . dx dy dx y dx Hence dy d =y· ln y. dx dx This can often be useful as sometimes it is much easier to differentiate ln y than y. Let us cnsider an example. 34 2 1 We want to differentiate y(x) = x 4 e−x cos(−3x). We take ln on both sides. This gives 1 2 ln(y(x)) = ln x 4 + ln e−x − ln cos3 (x) 1 ln(x) − x2 − 3 ln(cos(x)) 4 = Now using chain rule on ln(y(x)) we find that 1 dy y dx 11 1 − 2x − 3 (− sin(x)) 4x cos(x) 1 − 2x + 3 tan(x) 4x = = ⇓ dy dx 1 y − 2x + 3 tan(x) 4x 2 1 1 x 4 e−x − 2x + 3 tan(x) cos3 (x) 4x = = Examples 1. If y = x3x find dy dx . Now ln(y) = ln x3x = 3x ln(x), hence differentiating 1 dy y dx dy dx 3 2. If y = ex x sin2 (x) find dy dx . 1 + 3 ln(x) = 3 (ln(x) + 1) x = 3x. = 3x3x (ln(x) + 1) = 3 ln ex − ln(x) − ln sin2 (x) = x3 − ln(x) − 2 ln (sin(x)) Now ln(y) Differentiating with respect to x gives: 1 dy y dx = 1 3x − − 2 x 2 1 sin(x) (cos(x)) ⇓ dy dx 3. If y = sin(x) 1 (1+x2 ) 2 e−x then find dy dx . 3 = ex x sin2 (x) 1 1 2 3x − − 2 (cos(x)) x sin(x) Now ln(y) = ln(sin(x)) = 1 ln(1 + x2 ) − ln (e−x 2 Differentiating with respect to x gives: 1 dy 1 1 1 = (cos(x)) − (2x) + 1 y dx sin(x) 2 1 + x2 x = cot(x) − +1 1 + x2 ⇓ dy sin(x) x = = cot(x) − + 1 1 dx 1 + x2 (1 + x2 ) 2 e−x 35 5.6 Implicit Differentiation You can read more in J/S §3.8. Sometimes we don’t know the function y = y(x) explicitly but only implicitly from a formula. Let’s look at an example. If x2 + 4xy + y 2 = 100, find x yields dy dx in terms of x and y. We denote y 0 = 2x + 4y + 4xy 0 + 2yy 0 = dy dx , hence differentiating with respect to 0 ⇓ 0 = − (2x + 4y) y (4x + 2y) ⇓ dy dx 5.7 = − x + 2y 2x + y Derivatives of Inverse Functions You can read more in J/S §3.9. One can determine the derivative of the inverse function F (x) to f (x), using 1 dy = dx dx dy where the right hand side should be expressed in x. Let us look at an example. Example 1. Find the derivative of ln x. Solution. As ln x is the inverse of ex , we have y = ln x ⇔ x = ey . Thus 1 1 dy 1 = = y = . dx dx e x dy Example 2. Find the derivative of arcsin x. Solution. We have y = arcsin x ⇔ x = sin y and − π/2 ≤ y ≤ π/2 Thus dy 1 1 = = . dx dx cos y dy We need to express this in x = sin y. But cos y = ± q p 1 − sin2 y = ± 1 − x2 and as cos y is positive in the interval [−π/2, π/2], it follows that (arcsin x)0 = √ 36 1 . 1 − x2 5.8 Parametric Differentiation You can read more in J/S §3.10. Sometimes we have x and y as functions of a parameter t (often time), so that x = x(t) and y = y(t). Consider the circle prescribed by x = 2 cos(t), y = 2 sin(t) for 0 ≤ t < 2π. Then x2 + y 2 = 4. ŷ 2 y t x x̂ Figure 5.1: Paramaterised Circle To find dy dx we use dy dx = dy dt dx dt in terms of t. Hence for a circle dy dt dx dt Therefore dy = dx At (x, y) = (0, 1) we have circle. dy dx dy dt dx dt = 2 cos(t) = −2 sin(t). =− x cos(t) =− . sin(t) y = −0/1 = 0 corresponding to a zero rate of change of y in x at the top of the Example If x = t2 and y = t3 find dy dx . dy = dx 5.9 dy dt dx dt = 3t2 3 3√ = t= x 2t 2 2 Application to a real life situation Example. Sand falls from a chute and forms a conical pile in such way that the vertical angle θ emains constant. (See figure from your handwritten notes. Or draw one yourself). Suppose that the radius of the base of the cone is r = r(t) and that the height is h = h(t). Show that if r increases at a rate α cm/s then the volume increases at a rate πrhα cm3 /s. Solution. Step 1. Mathematical formulation. We have already drawn a figure to understand what is going on. given: r0 (t) = α need: v 0 (t) where v(t) is the volume at the timepoint t sec. 37 Step 2. We need a formula for v that we can differentiate. πr2 h . 3 Thinking ahead we don’t know h0 (t). However (look at the figure) tan(θ) = r/h. Thus h = r/ tan(θ) and v= v= π πr2 · r/ tan(θ) = · r3 . 3 3 tan(θ) Step 3. We differentiate v with respect to time. We use the chain rule dv dv dr π π r = · = · 3r2 · α = · r · · α = π · rhα. dt dr dt 3 tan(θ) 3 θ 5.10 Application of the derivative for evaluation of limits: L’Hopital’s Rule Suppose f, g are differentiable functions defined on an open interval. If either lim f (x) = lim g(x) = 0 x→x0 x→x0 or lim f (x) = lim g(x) = ±∞ x→x0 x→x0 then lim x→x0 f (x) f 0 (x) = lim 0 g(x) x→x0 g (x) Examples 1. Find limx→0 cos(x)−1 . x In this case f (x) = cos(x) − 1 and g(x) = x. We have f (0) = g(0) = 0. Thus lim x→0 2. Similarly find limx→0 cos(x) − 1 − sin(x) − sin(0) = lim = =0 x→0 x 1 1 sin(x) x 0 sin(x) (sin(x)) cos(x) = lim = lim = cos(0) = 1 0 x→0 x→0 x→0 x 1 (x) lim 3. Calculate limx→0 sin(x)−x . x3 First we try to apply L’Hopitals rule lim x→0 sin(x) − x cos(x) − 1 0 = lim = x→0 x3 3x2 0 We still have the indeterminate form. 00 . So let’s try to apply L’Hopitals rule again. cos(x) − 1 − sin(x) 1 = lim =− 2 x→0 x→0 3x 6x 6 lim and we conclude that 1 sin(x) − x =− 3 x→0 x 6 lim 38 4. Find limx→∞ ln(x) x2 . Here we deal with the indeterminate form ∞/∞. Differentiating the numerator and denominator we find ln(x) x→∞ x2 lim 5. Find limx→∞ = lim 1 x Using L’Hopital’s rule once 2x 1 = 0 Using L’Hopital again = lim x→∞ 2x2 x→∞ x2 ex . We use L’Hopitals rule twice. lim f (x) = lim x→∞ 5.11 x→∞ 2 2x = lim x = 0 x→∞ e ex Stationary points Let y = f (x) be differentiable. The points a for which f 0 (a) = 0 are called stationary points. We consider four cases. Case 1. x f 0 (x) f (x) - & - x0 0 + + % + In this case we have local minimum at x0 . (see figure 5.3 (b)) 39 Case 2. x f 0 (x) f (x) + + % x0 0 + - & - In this case we have local maximum at x0 . (see figure 5.3 (a)) Case 3. x f 0 (x) f (x) + + % x0 0 + + + % + In this case we have neither a local maximum nor local minimum (what we have is a terrace point (see figure 5.3 (c)). Case 4. x f 0 (x) f (x) - & - x0 0 - & - Again we have a terrace point. The second derivative test: Sometimes one can read from the second derivative whether we have a local maximum or local minimum. Assume f (x) is twice differentiable at a stationary point x0 (so f 0 (x0 ) = 0) then 1. If f 00 (x0 ) > 0 then f has a local minimum at x0 . 2. If f 00 (x0 ) < 0 then f has a local maximum at x0 . Consider f (x) = x2 and g(x) = −x2 then f has a local minimum since f 00 (x) = 2 > 0 and g has a local maximum since g 00 (x) = −2 < 0. (See figure 5.2) !x*x) 15 10 10 5 5 0 0 y y x*x) 15 !5 !5 !10 !10 !15 !4 !15 !3 !2 !1 0 x (a) y = 1 2 3 4 x2 !4 !3 !2 !1 0 x (b) y = 1 2 3 4 −x2 Figure 5.2: Local Minimum and Maximum Example Consider f (x) = x4 − 2x2 . Then f 0 (x) = 4x3 − 4x = 4x(x − 1)(x + 1), hence there are three turning points at x = 0, −1, 1. Using f 00 (x) = 12x2 − 4, the turning points are such that at x = 0 we have a local maximum (f 00 (0) = −4 < 0 ) and at x = −1, 1 we have local minima (f 00 (±1) = 8 > 0). Local maxima and minima occur at critical points f 0 (x) = 0 where f 0 changes sign. 40 4 3.5 4 4 3.5 3.5 3 3 2.5 2.5 2 2 (1) f =0 3 (1) 2.5 (1) f >0 f <0 y y y 2 1.5 1.5 1 1 0.5 0.5 f(1)>0 f(1)<0 f(1)>0 1.5 1 f(1)=0 f(1)=0 0 0 0 !0.5 !0.5 !0.5 !0.5 !0.5 !0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 f(1)>0 0.5 0 0.5 1 1.5 2 x 2.5 3 3.5 4 0 0.5 (a) Local Maxima 1 1.5 2 2.5 3 3.5 4 x x (b) Local Minima (c) No Max,Min Figure 5.3: Local Minimum and Maximum, No max/min 5.12 Global max and min on a closed bounded interval Fact. Every continuous function on [a, b] has a largest value (global max) and a smallest value (global min). Furthermore if x1 , . . . , xm are the stationary points then global max = max {f (a), f (b), f (x1 ), . . . , f (xm )} global min = min {f (a), f (b), f (x1 ), . . . , f (xm )}. 4 2 y 0 !2 !4 !6 !8 0 1 2 3 4 5 6 7 x Figure 5.4: Multiple Maxima and Minima Example Find the global maximum and minimum of f (x) = 3 1+x2 on [−2, 2]. 6x 0 Clearly f is differentiable such that f 0 (x) = − (1+x 2 )2 . There is only one turning point (f (x) = 0) at x = 0. Now for x < 0 it is clear that f 0 (x) > 0 and for x > 0 we see f 0 (x) < 0. Hence x = 0 is a local maximum with value f (0) = 3. Now we test the interval points: f (−2) = We have global minimum 5.13 3 5 3 5 and f (2) = 35 . occuring at x = ±2. Curve Sketching Read more in J/S p97 §4.4. We went through an example in lectures that I gave out as handout. Here are some more examples. 41 fig:prog31 1. Sketch y = x ln(x) for 0 < x < ∞. • At x = 1 we have y = 0 and as x → ∞, y → ∞. • At x = 0 we use L’Hopitals rule such that limx→0 x ln(x) = limx→0 limx→0 −x = 0 • We seek stationary points, −1 1 e. −1 therefore x = e = y = (e−1 ) ln(e−1 ) = −e dy dx = ln(x) + 1, hence at turning point The stationary point is a minimum since = − 1e 2 d y dx2 ln(x) x−1 dy dx = = limx→0 1 x −x−2 = = 0 → ln(x) = −1, 1 x > 0 and has value 1.5 y 1 0.5 0 !0.5 !0.5 0 0.5 1 1.5 2 x Figure 5.5: y = x ln(x) 2. Sketch y = xe−x for 0 < x < ∞. • As x → ∞, y → 0, and at x = 0 y(0) = 0 • Critical points when dy dx = e−x − xe−x = 0, hence when (1 − x)e−x = 0, so when x = 1 and y = e−1 dy dx • Sign table shows that as x < 1, > 0 and for x > 1, dy dx < 0, so the stationary point is a maximum. 0.5 0.4 0.3 0.2 y 0.1 0 !0.1 !0.2 !0.3 !0.4 !0.5 !0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 x Figure 5.6: y = xe−x 5.14 Application to Optimisation Cut a square of side xm from each corner of a 5m by 2m rectangular sheet. Fold along dotted lines to make a rectangular open box. Find values of x that makes volume V maximum. Now length of box is 5 − 2x, width is 2 − 2x and height is x. Hence volume is such that V = x(5 − 2x)(2 − 2x) = x(10 − 14x + 4x2 ) Thus dV = 12x2 − 28x + 10. dx Turning point occurs for 12x2 − 28x + 10 = 0, hence using the standard formula for roots of a quadratic we have x = 0.44 or 1.89. We can discount x = 1.89 since width can not be negative. We can then show V is 2 maximum since ddxV2 = 24x − 28 < 0. 42 5 − 2x x x x 2 − 2x 2 x 5 5.15 Differentials - Estimating Small Changes Read more in J/S §4.5. Instead of writing dy dx = f 0 (x), we write dy = f 0 (x) dx Can interprete this as small change dx in the input causes a small change dy in the output. Good approximation if dx is small. Example How does the surface area of a spherical pellet change as radius changes from 1cm to 1.01cm. What is the relative change in surface area in terms of the relative change in radius? Surface area S = 4πr2 , hence dS = S 0 dr such that dS = (8πr)dr. If at r = 1cm, then dr = 0.01 then change in surface area dS = 8π(1)(0.01) = 0.08π. The relative change in area dS S = 8πrdr 4πr 2 = 2r dr The relative change in volume V = 43 πr3 is then 5.16 dV V = 4πr 2 dr 4 3 3 πr = 3r dr Leibniz Rule By Binomial Theormem (a + b)2 = a2 + 2ab + b2 = a2 b− + 2ab + a0 b2 . Using notation f = f (0) , 2 d f dx2 = f (2) etc, then d2 (f g) dx2 d3 (f g) dx3 = f (2) g (0) + 2f (1) g (1) + f (0) g (2) = f (3) g (0) + 3f (2) g (1) + 3f (1) g (2) + f (0) g (3) 43 df dx = f (1) , Example If y = x4 ex we set f (x) = x4 and g(x) = ex then d3 (f g) dx3 3 k X 3 d f d3−k g(x) = k dxk dx3−k 0 = f (3) g (0) + 3f (2) g (1) + 3f (1) g (2) + f (0) g (3) = x4 ex + 3 4x3 ex + 3 4.3x2 ex + (4.3.2x) ex = ex x4 + 12x3 + 36x2 + 24x 44 Chapter 6 Taylor and Maclaurin Series Read more in J/S Chapter 5. 6.1 Definitions We are going to see how we can approximate, as closely we want, with polynomials many of the functions that we have encountered previously in this course. This is how sin x, cos x, ex , . . . are calculated by your calculator. But how do we find the polynomial of degree n that best approximates a given function f (x). Let us first deal with polynomials and see how we can decipher the polynomial from f (0), f 0 (0), f (2) (0), . . .. Example. Take a polynomial f (x) = a0 + a1 x + a2 x2 + a3 x3 + a4 x4 of degree 4. Then f 0 (x) = a1 + 2a2 x + 3a3 x2 + 4a4 x3 f (2) (x) = 2a2 + 3 · 2 · a3 x + 4 · 3 · a4 x2 f (3) (x) = 3 · 2 · a3 + 4 · 3 · 2 · a4 x f (4) (x) = 4 · 3 · 2 · a4 . We therefore have that f (0) = a0 0 f (0) = a1 f 00 (0) = 2a2 f (3) (0) = 3 · 2 · a3 f (4) (0) = 4 · 3 · 2 · a4 which implies that a0 = f (0) a1 = f 0 (0) a2 = f (2) (0)/2! a3 = f (3) (0)/3! a4 = f (4) (0)/4!. Hence f (2) (0) 2 f (3) (0) 3 f (4) (0) 4 x + x + x . 2! 3! 4! More generally: if f (x) = a0 + a1 x + · · · + an xn , then f (x) = f (0) + f 0 (0)x + f (x) = f (0) + f 0 (0)x + f (2) (0) 2 f (n) (0) n x + ··· + x . 2! n! 45 Definition. Let f (x) be any function that is n-times differentiable at 0. Then the polynomial f (2) (0) 2 f (n) (0) n x + ··· + x 2! n! Pn (x) = f (0) + f 0 (0)x + is called the Maclaurin polynomial of degree n for f (x). So how well does this polynomial approximate f (x)? Fact. If f (x) is an (n + 1)-times differentiable function defined on some open interval containing 0. Then f (x) = f (0) + f 0 (0)x + · · · + {z | Pn (x) f (n+1) (0) n f (n+1) (z) n+1 x + x n! } |(n + 1)! {z } error term where z = z(x) depends on x but is always between 0 and x. Normally (for us) we have for given x that error term → 0 as n → ∞, or equivalently Pn (x) → f (x) as n → ∞. We often express the limit as an infinite sum and write f (x) = f (0) + f 0 (0)x + f (2) (0) 2 f (3) (0) 3 x + x + ··· 2! 3! and refer to it as the Maclaurin series for f (x). (Warning: The formula is not always valid for all x. Sometimes only in certain interval around 0 and sometimes in fact only for x = 0 (which is rare for us)). 6.2 Calculating Maclaurin series and polynomials Example 1. Find the Maclaurin Series for f (x) = ex . f (x) = exp(x), f (0) = 1 0 f 0 (0) = 1 00 f 00 (0) = 1 f (x) = exp(x), f (x) = exp(x), Hence the Maclaurin Expansion for exp(x) is given by ex = 1 + x + x2 x3 x4 + + + ... 2! 3! 4! (It is valid for all real numbers x). The Maclaurin expansion becomes more accurate by adding successively higher order terms. (see figure 6.1) 46 2 1.5 1 0.5 y 0 !0.5 !1 !1.5 !2 !2 !1.5 !1 !0.5 0 x 0.5 1 1.5 2 Figure 6.1: Maclaurin Series y = ex Example 2 Calculate p4 (x) for f (x) = sin(x). f (x) = sin(x), f (0) = 0 f 0 (x) = cos(x), f 0 (0) = 1 f 00 (x) = − sin(x), f 00 (0) = 0 f 000 (x) = − cos(x), f 000 (0) = −1 f (iv) (x) = sin(x), f (iv) (0) = 0 Hence p4 (x) 0+x+0· = = x− x3 x4 x2 + +0· 2! 3! 4! x3 6 More useful examples 1. 1 1−x = 1 + x + x2 + x3 + x4 + · · · = P∞ n=0 xn and is valid for |x| < 1. (Recall that this is the formula for geometric series. Which can be proved as follows: (1 + x + x2 + . . . + xn )(1 − x) = (1 + x + x2 + · · · + xn ) − (x + x2 + · · · + xn + xn+1 ) = 1 − xn+1 and thus 1 + x + x2 + · · · + xn = 1 1 − xn+1 → 1−x 1−x as n → ∞.) 2. (1 + x)α = 1 + αx + α(α−1) 2 x 2 + . . . . For example (1 + x)1/2 = 1 − x2 2! + x4 4! − x6 6! 4. ln(1 + x) = x − x2 2 + x3 3 − . . . is valid for |x| < 1 3. cos(x) = 1 − x 2 + 18 x2 + . . . . + ... One way of deriving the last formula without going straight to the definitions is to notice first that 1 (ln(1 + x))0 = 1+x 1 = 1 − (−x) = 1 + (−x) + (−x)2 + (−x)3 + · · · = 1 − x + x2 − x3 + · · · Then we think backwards. Which series would have this last expression as it’s derivative and the constant term 0 (after all ln(1 + 0) = 0). The answer is ln(1 + x) = x − x2 x3 x4 + − + ··· 2 3 4 47 6.3 Estimating the error term Recall. f (x) = f (0) + f 0 (0)x + · · · + | {z Pn (x) f (n+1) (0) n f (n+1) (z) n+1 x + x n! } |(n + 1)! {z } error term where z = z(x) depends on x but is always between 0 and x. Example 1. Calculate e such that the error is at most 1/10000. Solution. xn ez x2 + ··· + + xn+1 ex = 1 + x + 2! n! (n + 1)! | {z } | {z } Pn (x) error term where z lies between 0 and x. In particular for x = 1 this gives e=1+1+ 1 ez 1 + ··· + + 2! n! (n + 1)! | {z } error term where 0 ≤ z ≤ 1. We want n big enough so that the error term is at most 1/10000. We do some estimation. The worst case would be if z = 1. Now ez e 3 3 1 ≤ < = = . (n + 1)! (n + 1)! (n + 1)! 1 · 2 · 3 · · · (n + 1) 2 · 4 · 5 · · · (n + 1) So we want 2 · 4 · 5 · · · (n + 1) to be at least 10000. We make an inspection 2·4·5·6 = 240 2·4·5·6·7 = 1680 2·4·5·6·7·8 = 13440 (not enough) (not enough) (Bingo!). So we need to take n + 1 = 8, i.e. n = 7. Conclusion. e ≈ 1 + 1 + 1 2! + ··· + 1 7! (with error less than 1/10000). Example 2. Estimate the error in approximating sin x by the Maclaurin polynomial P3 (x) of degree 3 in the interval −0.1 < x < 0.1. Solution. Let f (x) = sin x. We have sin x x3 f (5) (z) 5 = x− + 0 · x4 + x 3!{z 5! | } P3 (x)=P4 (x) = x− sin z 3 x3 + x 6 120 where z lies between 0 and x. We now estimate the error term sin z 5 1 1 5 −5 −8 120 · x ≤ 120 (0.1) ≤ 120 · 10 ≈ 8 · 10 . Conclusion. The error is at most 8 · 10−8 (very small indeed). 48 6.4 Manipulation of Maclaurin Series Sometimes we can calculate the Maclaurin Series without going straight to the definiton using some clever manipulations instead. Example 1. Calculate the Maclaurin Series for sin x2 . Solution. We use the fact that we already know the Maclaurin Series for sin x. We have y3 y5 y7 + − + ··· . 3! 5! 7! sin y = y − Putting y = x2 then gives sin x2 = x2 − x10 x12 x6 + − + ··· 3! 5! 7! Example 2. Calulate the Maclaurin polynomial P3 (x) of degree 3 for ex sin x. Solution. We know that ex = 1 + x + x3 x2 + + (higher terms) 2! 3! and sin x = x − x3 + (higher terms). 3! Therefore ex sin x x2 x3 x3 + + h.t.) · (x − + h.t) 2 6 6 x3 x3 − + h.t. = x + x2 + 2 6 1 = x + x2 + x3 + h.t. 3 = (1 + x + Answer. P3 (x) = x + x2 + x3 /3. 6.5 Taylor Series We might want to approximate f (x) near a general point a (not neccessarily 0). This we can achieve using the work for Maclaurin series as follows: let x = a + h and g(h) = f (a + h). Using the Maclaurin expansion we get g(h) = g(0) + g 0 (0)h + g 00 (0) 2 · h + ··· 2! That is f (a + h) = f (a) + f 0 (a)h + f 00 (a) 2 · h + ··· 2! That is (since x = a + h ⇔ h = x − a) f (x) = f (a) + f 0 (a)(x − a) + f 00 (a) (x − a)2 + . . . 2! This last series is called the Taylor series for f (x) around a. 49 Example Find the first 3 terms in the Taylor series of sin(x) about c = π/4. Solution. We have P3 (x) = f (π/4) + f 0 (π/4) · (x − π/4) + f 00 (π/4) f (3) (π/4) · (x − π/4)2 + (x − π/4)3 . 2! 3! We calculate next the coefficents: 1 f (π/4) = √ 2 1 f 0 (π/4) = √ 2 f (x) = sin(x), f 0 (x) = cos(x), 1 f 00 (π/4) = − √ 2 1 f 000 (π/4) = − √ 2 f 00 (x) = − sin(x), f 000 (x) = − cos(x), Hence, 6.6 1 1 −1 −1 P3 (x) = √ + √ · (x − π/4) + √ · (x − π/4)2 + √ · (x − π/4)3 . 2 2 2 2 6 2 Newton’s Method for solving non-linear equations Read more in Evans p534 and J/S §4.6 page 104 Our aim is to find the solution of f (x) = 0. Numerical method using Taylor Series. We start with a intial guess x1 (rough approximation) for the solution. This could be arrived at by considering a graph for the function for example. Next we want to improve the approximation. In reality the solution is x1 + h where h is the error (hopefully small but we want to make it even smaller). We estimate h using Taylor series 0 = f (x1 + h) = f (x1 ) + f 0 (x1 ) · h + ≈ f (x1 ) + f 0 (x1 ) · h f 00 (x1 ) 2 · h + ··· 2! This implies that (if things have gone well) h≈− f (x1 ) . f 0 (x1 ) So an improved approximation should be x2 = x1 − f (x1 ) . f 0 (x1 ) We can iterate this progress in order to get better and better approximations x3 = x2 − f (x1 ) f 0 (x1 ) .. . xn+1 = xn − 50 f (xn ) . f 0 (xn ) If the method works (not always the case) the sequence x1 , x2 , x3 , . . . tends to the solution of the equation f (x) = 0. Example. Let f (x) = ex − 2x − 1 = 0. Solution. In this case f 0 (x) = ex − 2. We start with an initial guess x1 = 1.3 for the root of the equation. Using Newton’s method x2 = x3 + e1.3 − 2(1.3) − 1 = 1.259 e1.3 − 2 e1.259 − 2(1.259) − 1 1.259 − = 1.257 e1.259 − 2 1.3 − 51 Chapter 7 Integration Read more in Evans Chapter 15, J/S §14 Integration has many applications. For example we can use it to 1. calulate areas, volumes, mass, energi, . . . 2. solve differential equations. We start with the reverse of differentiation. We will see that this is closely related to the problem of finding an area under the curve of a given function. 7.1 Primitives A. Definitions. Definition. Let I be an open interval. The function F (x), x ∈ I is said to be a primitive to the function f (x), x ∈ I, 0 if F (x) = f (x). Remark. Then also (F (x) + c)0 = F 0 (x) + c0 = f (x) + 0 = f (x) for any constant c. Conversely if F (x) and G(x) are two primitives to f (x), then (G(x) − F (x))0 = G0 (x) − F 0 (x) = f (x) − f (x) = 0 and G(x) − F (x) is some constant c. Thus if F (x) is one primitive to f (x) then any primitive is of the form F (x) + c with c constant. We use the notation Z f (x) dx = F (x) + c (sometimes referred to as the indefinite integral of f (x)). Some general rules. Z Z (f (x) + g(x)) dx Z af (x) dx = f (x) dx + Z = a f (x) dx 52 Z g(x) dx where a is a constant. In general the problem of finding primitives is more difficult than differentiation. For example there is no simple product rule that gives the primitive to f (x)g(x) when we know the primitives to f (x) and g(x). B. Some primitives. Z a dx = ax + c Z Z Z (a constant) xα dx = xα+1 +c α+1 1 dx x = ln |x| + c ex dx = ex + c (α 6= −1 a constant) Z cos x dx = sin x + c Z sin x dx = − cos x + c Z 1 dx cos2 x Z 1 dx 2 Z sin x 1 dx 1 + x2 Z 1 √ dx 1 − x2 = tan x + c = − cot x + c = arctan x + c = arcsin x + c In fact all these follow from formulas we have got for differentiation. Just differentiate the RHS and check that you get what is under the intergral on the LHS. C. Two useful rules. Generally we also have: Z and f 0 (x) dx = ln |f (x)| + c f (x) Z (7.-12) 1 · F (ax) + c a f (ax) dx = (7.-12) where a is a constant and F (x) is the primitive to f (x). Proof of 7.1. If y = ln |u| and u = f (x), then Proof of 7.2. If y = 1 a dy dx · F (u) and u = ax, then 1 a = · dy du dy dx · du dx = = 1 a dy du · 1 u · f 0 (x) = f 0 (x) f (x) . 2 · a = F 0 (u) = f (ax). 2 Example 1. We have Z cos 5x dx = 1 · sin 5x + c 5 Warning. One can not generalise this and take the Primitve of the outer function divided by the inner derivative. For example Z sin x2 cos x2 dx 6= + c. 2x 53 Example 2 Z cos x dx = ln | sin x| + c sin x A part from these methods there are basically two methods that one uses when calculating primitives: “integration by parts” and “substitution”. 7.2 Integration by parts and substitution A. Integration by parts. Theorem If F (x) is a primitive to f (x) then Z Z f (x) · g(x) dx = F (x) · g(x) − F (x) · g 0 (x) dx Proof Must show that the RHS is a primitive to f (x) · g(x). But Z (F (x)g(x) − F (x)g 0 (x) dx)0 = F 0 (x)g(x) + F (x)g 0 (x) − F (x)g 0 (x) = F 0 (x)g(x) = f (x)g(x) 2. Remark. The way this result can be useful is when the integral on the RHS is simpler than the one of the LHS. Notice that the new product F (x) · g 0 (x) that we integrate on the RHS, comes from integrating one of f (x), g(x) and differentating the other. Sometimes it may be better to change the order and work with g(x) · f (x) instead if that leads to a simpler integral on the RHS. Example 1. Calculate R x · ex dx. Solution. Integrating or differenting ex makes no difference. However, it is better to differentate x than integrating it. So we change the order (here f (x) = ex , g(x) = x, F (x) = ex , g 0 (x) = 1) Z Z x x e · x dx = e · x − ex · 1 dx = xex − ex + c. Example 2. Calculate R ln x dx. Solution. We use a common trick. We write ln x = 1 · ln x and then apply integration by parts (f (x) = 1, g(x) = ln x, F (x) = x, g 0 (x) = 1). Z Z 1 1 · ln x = x · ln x − x · x Z = x · ln x − 1 dx = x · ln x − x + c. B. Substitution. Suppose that x is a differentable function in t. Then Z Z dx f (x) dx = f (x) · · dt. dt Here we should think of the LHS as expressed in x and the RHS as expressed in t. 54 Method. (i) Replace f (x) by an expression in t. (ii) Replace dx by We now have an integral of a function in t. dx dt · dt (an expression in t). (iii) This method is often useful as the expression in t can be much simpler. Example 1. Calculate Solution. Let t = √ R x· √ x − 1 dx. x − 1. Soving for x gives x = t2 + 1. We then have √ t = x−1 x = dx = dt t2 + 1 2t and Z x· √ Z x − 1 dx = Z = = = Example 2. Calculate R cos x 1+sin2 x (t2 + 1)t · 2t dt (2t4 + 2t2 ) dt 2 5 2 3 ·t + ·t 5 3 2 √ 2 √ · ( x − 1)5 + ( x − 1)3 + c 5 3 dx. Solution. We work here a bit differently. We observe that the derivative of sin x is cos x and therefore dt if we put t = sin x then dt = dx · dx = cos x · dx. Having though ahead like this we now begin the calculations t = sin x dt = cos x · dx and Z 7.3 cos x dx 1 + sin2 x = 1 · dt 1 + t2 arctan(t) = arctan(sin x). = Primitives and areas Consider a function f (x) that is integrable (has primitive) and with positive values on an open interval I. Consider the graph of this function (draw a figure or look at your handwritten notes). Let A(x) be the area under the curve between a and x (where x ≥ a). If we take a small ∆x then the region between x and x + ∆x is approximately a rectangle with height f (x) and width ∆x. Therefore A(x + ∆x) − A(x) f (x) · ∆x ≈ = f (x) ∆x ∆x Hence A(x + ∆x) − A(x) = f (x). ∆x So A(x) is a primitive to f (x). Let then F (x) be any primitive to f (x). Then A0 (x) = lim ∆x→0 A(x) = F (x) + c 55 (7.-32) for some constant c. As the area between a and a is 0, we have A(a) = 0 and (7.3) gives c = −F (a). The area between a and b is therefore A(b) = F (b) + c = F (b) − F (a) . Definition. Rb If a f (x) is finite, f (x) is said to be integrable and Z a b b f (x)dx = F (b) − F (a) = [F (x)]a or F (x)|ba where F (x) is an indefinite integral (antiderivative) of f (x). See Handout Sheet 15: The Definite Integral Examples h 3 i2 R2 1. 1 x2 dx = x3 = 1 2. R 1/2 3. R2 0 1 dx 1 x 4. R1 6. R1 3 (2x + 1) dx = 23 3 1 8 − 1 3 = 8 3 − 1 3 4 1/2 (2x + 1) |0 = 7 3 =2− 1 8 = 15 8 2 = [ln(x)]1 = ln(2) − ln(1) = ln(2) 1 dx 0 x 2 = [ln(x)]1 = ln(1) − ln(0) = ∞ The integrand does not exist. R 2 2 5. x22x +4 dx = ln(x + 4) + k = ln k(x + 4) 2x dx 0 x2 +4 7.4 1. 2. 3. 4. 5. 6. 1 = ln(x2 + 4) 0 = ln(5) − ln(4) = ln 5 4 Properties of Definite Integrals Rb Rb Rb (f (x) ± g(x)) dx = a f (x)dx ± a g(x)dx Rb Rb cf (x)dx = c a f (x)dx a Rb Rc Rb If c ∈ [a, b] then a f (x)dx = a f (x)dx + c f (x)dx Rb Ra f (x)dx = − b f (x)dx a Ra f (x)dx = 0 a R R b b a f (x)dx ≤ a |f (x)|dx a 7. Mean Value Theorem for integrals. If f (x) is continuous, then there is a point c ∈ (a, b) such that Rb f (x)dx = (b − a)f (c). Geometrically, the is area under y = f (x) is equal to the area of rectangle a height f (c). 56 x2!2 abs(x2!2) 16 14 14 12 12 10 10 8 8 1 0.5 y y y 16 6 6 4 4 2 Area 1 Area 3 0 Area 3 Area 2 0 Area 2 !2 !4 0 Area 1 2 !2 !3 !2 !1 0 x 1 2 3 4 !4 !3 !2 !1 0 x 1 2 3 !0.5 4 fig:prog36 7.5 0 0.2 0.4 0.6 0.8 1 1.2 x R R (a) Rule 6 (x2 − 2) = A1 − A2 + A3 (b) Rule 6 |x2 − 2| = A1 + A2 + A3 (c) Rule 7: Mean Value Theorem Techniques of Integration Read J/S page 314 Chapter17 7.5.1 Substitution A change of variables often makes the integration easier. In theory x = g(u) then Hence for definite integrals: Z b Z x=b f (x)dx = a Z = g 0 (u) and dx = g 0 (u)du. u=β f (g(u)) g 0 (u)du where f (x)dx = x=a dx du a = g(α), b = g(β) u=α Examples - Indefinite Integral Substitution R 2 1 1. Solve (4x − 1) dx. Set u = 4x − 1, then du dx = 4 and dx = 4 du. Z 2. Solve R Z 2 (4x − 1) dx = ∴ √ 1 dx. 1−x2 Z ∴ u2 1 du = 4 4 Set x = sin(u) then √ 1 dx = 1 − x2 dx du Z Z 1 4 1 3 u 3 +c= 1 3 (4x − 1) + c 12 = cos(u) and dx = cos(u)du. Z 1 q u2 du = cos(u)du = du = u + c = sin−1 (x) + c 2 1 − sin (u) tan2 (x)dx. Set u = tan(x), then du = sec2 (x)dx = (1 + u2 )dx Z Z Z Z Z u2 1 1 tan2 (x)dx = du = 1 − du = 1du− du = u−arctan(u)+c = tan(x)−x+c 1 + u2 1 + u2 1 + u2 3. Solve R 4. Solve R cos(2x + 5)dx. Set u = 2x + 5, then du = 2dx Z Z 1 1 1 cos(2x + 5)dx = cos(u)du = sin(u) + c = sin(2x + 5) + c 2 2 2 5. Solve R x2 x3 −5 dx. Set u = x3 − 5, then du = 3x2 dx Z x2 dx 3 x −5 = 1 3 Z 1 3 Z 1 1 1 du = ln(u) + c = ln(x3 − 5) + c u 3 3 or Z x2 dx 3 x −5 = 3x2 1 dx = ln(x3 − 5) + c −5 3 x3 57 Examples - Definite Integral Substitution R2 2 dx 1. Solve 1 ln x(x) dx. Set x = eu , then du = eu and dx = eu du, then ln2 (x) dx = x 2 Z ∴ 1 2. Solve R1 0 2 √x dx. x3 +1 Z x=2 x=1 ln2 (x) dx = x Set u = x3 + 1 then Z 1 ∴ 0 3. Solve Z 1 0 7.5.2 R1 x dx. 0 4x+2 x dx = 4x + 2 2 6 u=ln(2) u=0 du dx du dx u2 u e du = eu ln(2) Z u2 du = 0 Z 2 1 3 u 3 ln(2) = 0 1 3 (ln(2)) 3 2 2 1 2 √ = u2 = 2−1 3 3 1 du 1 1 u2 = 4 and dx = 41 du with 3 1 1 3 (u − 2) . . du = 4 u 4 16 = 3x2 and x2 dx = 31 du. x2 1 √ dx = 3 3 x +1 Set u = 4x + 2 then Z Z Z 6 2 u−2 3 du = u 16 Z 1 4 (u − 2) = x. 6 1− 2 2 3 3 6 = [u − 2 ln(u)]2 = (4 − 2 ln(3)) u 16 16 Integration by Parts Read J/S page 325, Evans page 447 The formula for integrating by parts is obtained by integrating the product rule for differentiation. d dv du (uv) = u +v dx dx dx d du dv = (uv) − v ∴u dx dx dx Z Z Z d du dv dx = (uv)dx − v dx ∴ u dx dx dx Z Z dv du ∴ u dx = uv − v dx + c dx dx Rb R b b dv For definite integrals a u dx dx = [uv]a − a du dx vdx Why do we do this? Well hopefully parts. R v du dx is easier to integrate than Examples-Definite Integral Integration by Parts R1 dv 1. Find 0 x ln(x)dx. Set u = ln(x) and dx = x then v = Z 0 2. Find Z 0 1 R1 0 1 x2 2 R dv u dx dx. So if in doubt integrate by and du = x1 , hence integrating by parts 1 Z 1 2 1 Z x2 x 1 1 1 1 1 2 1 x ln(x)dx = ln(x) − . dx = [0 − 0] − xdx = − x =− 2 2 0 2 2 4 0 2 x 0 0 xe3x dx. Set u = x and dv dx = e3x , then du dx = 1 and v = 13 e3x . 1 Z 1 1 Z 1 1 3x 1 1 1 3x 1 1 1 3x 1 1 2 1 xe3x dx = x e3x − e .1dx = e3 − e dx = e3 − e = e3 − e3 +19 = e3 + 3 3 3 3 3 3 3 3 9 9 9 0 0 0 0 Rπ dv 3. Find 0 x cos xdx. Set u = x and dx = cos(x), then du dx = 1 and v = sin(x). Z π Z π Z π π π x cos xdx = [x sin(x)]0 − 1. sin(x)dx = 0 − sin(x)dx = [cos(x)]0 = cos(π) − cos(0) = −2 0 4. Find 0 R1 0 0 dv 1 ln(x)dx. Set u = ln(x) and dx = 1 then du dx = x and v = x. Z 1 Z 1 1 1 1 ln(x)dx = [x ln(x)]0 − x dx = [0 − 0] − [x]0 = −1 x 0 0 58 7.5.3 Integrals using Trig Formula R Rπ Recall that cos(2x) = 12 sin(2x) + c then how do we integrate 0 sin2 (x)dx. We can use the trig formula cos(2x) = 1 − 2 sin2 (x) and rearranging we find sin2 (x) = 21 (1 − cos(2x)), then Z 0 If you think R π 1 sin (x)dx = 2 sin2 (x)dx = 2 1 3 Z 0 π π 1 1 π (1 − cos(2x)) dx = x − sin(2x) = 2 2 2 0 sin3 (x) think again!!! 59 Chapter 8 Ordinary Differential Equations (ODE’s) You can read more in J/S Chapter 18,19 and Evans Chapter 19. To motivate our study we start with an example from real life. Example. A radioactive element disintegrates at a rate proportional to the amount that remains at any given time (A known fact). Mathematical formulation. Let y(t) be the amount that remains at time t. Then dy = −kt (∗) dt Problem. Find y(t) from (*). This is an example of an ODE. For the solution to be unique we need also an intial condition (IC). dy dt = −ky y(0) = y0 (IC). An ODE with a initial condition is often referred to as a “initial value problem”. 8.1 ODE of lst order We now turn to the mathematics. In general, an ODE of 1st order is an equation of the form dy = f (x, y) (**). dx (To be of first order indicates that only first derivatives occur. To be ordinary means that only functions in one variable are involved). A solution to (**) is then a function y(x), x ∈ I 0 for some open interval I such that y (x) = f (x, y(x)). Example. The function y = e−3t is a solution to dy = −3y dx 60 since y 0 = −3e−3x = −3y. We now move on to the problem of finding the solutions for ODE’s of particular form. Definition. An equation of the form dy + g(x)y = h(x) dx is called a linear ODE of lst order. If h(x) = 0, it is said to be homogenous (or unforced). If h(x) = 6 0, it is said to be nonhomogenous (or forced). Solution method (using integrating factor) Step 1. Take a primitive G(x) to g(x) and form eG(x) (the integrating factor, IF) Step 2. Multiply with IF on both sides y 0 · eG(x) + y · g(x) · eG(x) = h(x) · eG(x) m G(x) 0 (y · e ) = h(x) · eG(x) . Step 3. Integrate y · eG(x) Z = h(x)eG(x) dx m y = e−G(x) · Z h(x) · eG(x) dx A. Homogenous equations. Example 1. Solve dy − 2y = 0. dx Solution. We go through the three steps. I As −2x is a primitive to −2, we have IF = e−2x . II (ye−2x )0 = 0 · e−2x = 0. III ye−2x = c ⇔ y = c · e2x . Answer. y = c · e2x , where c is constant. Example 2. Solve dy − x · y = 0. dx Solution. 61 2 I. IF = e−1/2·x . 2 2 II. (y · e−1/2·x )0 = 0 · e−1/2·x = 0. 2 III. ye−1/2·x = c. 2 Answer. y = c · e1/2·x , c constant. B. Nonhomogenous equations We can still use the integrating factor method. Here we often need to do more work in terms of integration however. Example 3. Solve dy − x · y = x. dx Solution. Here we have 2 I. IF = e−1/2·x . 2 2 II. (y · e−1/2·x )0 = x · e−1/2·x . III. We therefore have y · e−1/2·x Z 2 = t = −1/2 · x2 dt = −x dx 2 x · e−1/2·x dx Z = −et dt = −et + c = −e−1/2·x + c. 2 This implies that 2 2 2 2 y = −e1/2·x · e−1/2·x + c · e1/2·x = −1 + c · e1/2·x . 2 This method has some advantages and disadvantages. Advantage. The method is quite general and works at least in theory. Disadvantage. The integration can be difficult. We’ll now describe an alternative method that is not so general but easier and works in fact very often. Alternative method for non-homogenous equations. We want to solve dy + g(x) · y = 0. dx Step 1. We find one particular solution yp . (Using guess work) Step 2. We find the general solution yh to dy + g(x) · y = 0 dx 62 Then y = yp + yh is the general solution to our original equation. This is because dy + g(x) · y dx dyp dyh + + g(x) · yp + g(x) · yh dx dx dyp dyh = ( + g(x)yp ) + ( + g(x)yh ) dx dx = h(x) + 0 = = h(x). Example 3 (again) dy − xy = x. dx Solution. Step 1. Find yp . (The general idea is to try to imitate the RHS, so y should be a polynomial. Since xy should be of degree 1, y should be a constant). Clearly y = −1 works. yp = −1. (8.-15) Step 2. Find yh . We need to solve dy − xy = 0. dx But this we solved in Example 2 and we know from this solution that 2 yh = c · e−1/2·x . (8.-15) 2 Answer. y = yp + yh = −1 + c · e1/2·x . C. Guessing a particular solution If we want to use the second method it is good to have some general idea where to look for a particular solution and the general idea is that we try to choose y similar to the RHS. Here are some examples. Example 4. Find a particular solution to dy + x · y = x3 . dx Solution. We try a polynomial and since x · y should be of degree 3, we try to choose y as a polynomial of degree 2. So y dy dx = ax2 + bx + c = 2ax + b. So we must have x3 = dy +x·y dx 2ax + b + x(ax2 + bx + c) = ax3 + bx2 + (2a + c)x + b. = Comparing the LHS with the RHS gives that a = 1, b = 0 and 2a + c = 0. Which implies that a = 1, b = 0 and c = −2a = −2. Hence 63 Answer. yp = x2 − 2. Example 5. dy dt + 2y = 4 · e−3t . Solution. Try y = Ae−3t . Then dy dt = −3Ae−t and the equation becomes 4e−3t = −3Ae−3t + 2Ae−3t = −Ae−3t . Hence A = −4. Answer. yp = −4 · e−3t . Example 6. Solve dy + y = 2 · e−t . dt Solution. If we try the same method here it fails: y = Ae−t gives dy dt = −Ae−t and the equation becomes 2e−t = −Ae−t + Ae−t = 0 which can never work! If one tries here instead y = Ate−t then dy = Ae−t − Ate−t . dt 2 · e−t = A(1 − t)e−t + At · e−t = Ae−t . Which works for A = 2. Hence Answer. y = 2t · e−t . Generally: dy dt + cy = e−ct . Try y = At · e−ct . D. Initial value problems This time we add some intial condition that determines the solution fully. So we want to solve dy dt − y = cos(2t) y(0) = y0 Method. First we find a general solution to the differential equation and then we use the initial condition to determine it fully. Example 7. Solve dy dt − y = cos(2t) y(0) = 0 Solution (using guess work). Step 1. Particular solution yp . We try y dy dt = A · sin 2t + B · cos 2t = 2A · cos 2t − 2B · sin 2t. 64 Then our equation becomes dy − y = (2A − B) · cos 2t + (−2B − A) · sin 2t dt cos 2t = which gives us the equation system 2A − B = 1 (i) −A − 2B = 0. (ii) Then (i)+2(ii) gives that −5B = 1 ⇔ B = −1/5. Then (ii) gives A = −2B = 2/5. Hence we have a particular solution yp = 2/5 · sin 2t − 1/5 · cos 2t. Step 2. The general homogenous part yh . We want to solve Here the integrating factor is e−t dy − y = 0. dt and the equation can be rewritten as (ye−t )0 = 0 ⇔ ye−t = c ⇔ y = cet . Thus yh = cet , c constant. Step 3. Determine y fully using the initial condition. We have y = yp + yh = 2/5 · sin 2t − 1/5 · cos 2t + c · et . The initial condition then gives 0 = y(0) = 2/5 · 0 − 1/5 + c ⇔ c = 1/5. Answer y = 2/5 · sin 2t − 1/5 · cos 2t + 1/5 · et . Example 8. Solve dy x · dx − y = x3 , x > 0 y(1) = 1 Solution. (Using the IF-method). First we transform the equation on standard form. In this case 1 dy − · y = x2 . dx x Step 1. Solve the differential equation using IF-method. The integrating factor is e− ln x = (eln x )−1 = x−1 = 1/x. According to the IF-method the equation can now be rewritten as (y · 1 0 ) x = x2 · 1 =x x ⇓ 1 y· x = y = 1/2 · x2 + c ⇓ 1/2 · x3 + cx. 65 Step 2. Use the initial condition to determine c. 1 = y(1) = 1/2 + c ⇔ c = 1/2. Answer: y = 1/2 · x3 + 1/2 · x. 8.2 Separable equations Sometimes an equation dy = f (x, y) dx can be written of the form g(y) dy = f (x) dx. It is then called separable. Solution method. Interate both sides Z Z g(y) dy = f (x) dx and the solve for y. Example 1. Solve dy dx = y2 y(0) = 1 Solution. After separation of variables then equation becomes 1 = dx ⇔ y2 1 =x+c y −1 ⇔ y= . x+c − The initial condition then gives y(0) = 1 ⇔ 1 = y(0) = Answer. y = −1 ⇔ c = −1. c −1 x−1 . Example 2. Solve √ =x y y(0) = 0 dy dx Solution. After separation of variables, we have 1 √ √ dy = x dx ⇔ 2 y = x2 /2 + c ⇔ 4y = (x2 /2 + c)2 . y The initial condition then gives 0 = y(0) ⇔ c2 = 0 ⇔ c = 0. Answer: y = x2 16 . 2 66 8.3 An application A vessel has initially 200 liters of a salt solution with salt concentration 10 grams per liter. A salt solution is now added that has a lower salt concentration of 2 grams per liter. This happens at rate 8 liters per hour. At the same time liquid is removed at the rate 8 liters per hour (we assume that the salt solution is well mixed during the whole procedure). We want to know how the amount of salt in the container changes with time. Mathematical formulation. Let y(t) be the amount of salt (in grams) in the container after t hours. Initially the concentration is 10 grams per liter and as we have 200 liters in the container, it follows that the initial amount of salt in the container is y(0) = 10 · 200 = 2000 grams. What is the rate of changes in the amount of salt w.r.t. time? The mixture that comes in has concentration 2 grams per liter and as there are 8 liters that come in per hour. We have that the amount of salt that comes in per hour is 0 yin = 2 · 8 = 16 grams. How much goes out depends on the concentration at the given time t. After t hours the amount of salt in the container is y(t) grams and as there are 200 grams in the container we have that the concentration is y(t)/200 grams per liter. There are 8 liter that flow out per hour so the amount of salt that goes out per hour is 0 yout = 8 · y(t)/200 = y(t)/25 grams per hour. The total rate of change is therefore 1 dy = 16 − · y. dt 25 We therefore need to solve the initial value problem dy dt + 1/25 · y = 16 y(0) = 2000. Solution. Step 1. A particular solution yp . As the RHS is a contstand we try y = c, constant. The derivative of y is then 0 and the equation becomes 1 · c ⇔ c = 25 · 16 = 400. 25 yp = 400. Step 2. The homogenous part. We want to solve dy 1 + · y = 0. dt 25 1 The integrating factor here is e 25 ·t and the equation becomes 1 (y · e 25 ·t )0 = 0 ⇔ y · e1/25·t = c ⇔ y = ce−1/25·t . yh = ce−1/25·t . Step 3. Determine y fully. 67 y = yp + yh = 400 + c · e−1/25·t . The initial condition gives 2000 = y(0) = 400 + c ⇔ c = 1600. Answer. y(t) = 400 + 1600 · e−1/25·t . Remark. Notice that y(t) → 400 as t → ∞. This fits as the concentration should eventually become close to 2 grams per liter (as the incoming mixture) which would give 2 · 200 = 400 grams in the container. 8.4 2nd order homogenous linear ODE’s with constant coefficients We consider here equations of the form a· dy d2 y + cy = 0. +b· dt2 dt where a, b and c are constants. Solution method Step 1. Solve the polynomial equation ar2 + br + c = 0. Suppose the solutions are r1 and r2 . Step 2. We consider three cases. Case 1. r1 6= r2 and both are real. In this case the general solution is y = Aer1 t + Ber2 t . Case 2. r1 = r2 . (Here the root is always real). The general solution is y = (A + Bt)er1 t . Case 3. r1 = α + iβ and r2 = α − iβ (β 6= 0).Here the general solution is y = eαt (A cos βt + B sin βt). Example 1. y 00 − 4y = 0. Solution. Here r2 − 4 = (r − 2)(r + 2) = 0 ⇔ r = −2, or r = 2. So the answer is y = A · e2t + B · e−2t , where A, B are constants. Example 2. y 00 + 4y. Solution. Here r2 + 4 = 0 ⇔ r4 = −4 ⇔ r = ±2i and the solution becomes y = A cos 2t + B sin 2t 68 where A, B are constants. Example 3. y 00 + 2y + 1 = 0. Solution. Here r2 + 2r + 1 = (r + 1)2 = 0 ⇔ r = −1. The general solution is therefore y = (A + Bt)e−t . 69 Chapter 9 Functions in several variables You can read more in J/S §28.1-28.4, 28.6,29.1-29.2. Physical terms often depend on more than one factor. Example. (The ideal gas law) p·V R where T is temperature, V volume and R is the gas constant. Here T is a function in two variables. T = T (p, V ) = We may be interested in the rate of change of T with respect to p and V . This leads to two partial derivatives ∂T ∂p ∂T ∂V 9.1 = = V we differentiate w.r.t. p keeping V constant R p we differentiate w.r.t. V keeping p constant. R Partial derivatives In general if f (x, y) is a function in two variables then we define the two partial derivatives as before: ∂f ∂x ∂f ∂y “differentiate w.r.t. x keeping y fixed” “differentiate w.r.t. y keeping x fixed”. Let’s compare the situation here with the one variable case. Functions in one variable. y = f (x). We have seen before that if we change x to x + ∆x then the resulting change ∆y in the output is circa ∆y ≈ f 0 (x) · ∆x. Functions in several variables. z = f (x, y). Suppose that we change x to x + ∆x and y to y + ∆y. Then the resulting change in the output is ∆z = f (x + ∆x, y + ∆y) − f (x, y) [f (x + ∆x, y + ∆y) − f (x, y + ∆y)] + [f (x, y + ∆y) − f (x, y)] f (x + ∆x, y + ∆y) − f (x, y + ∆y) f (x, y + ∆y) − f (x, y) = · ∆x + · ∆y ∆x ∆y ∂f ∂f ≈ · ∆x + · ∆y. ∂x ∂y = 70 Example 1 Let z = f (x, y) = x3 cos(2y) + 2x2 + y. • Find ∂f ∂x and evaluate at (x, y) = (2, 0). ∂f = 3x2 cos(2y) + 4x ∂x • Find ∂f ∂y ∂f (2, 0) = 12 + 8 = 20 ∂x and evaluate at (x, y) = (2, 0). ∂f = −2x3 sin(2y) + 1 ∂y ∂f (2, 0) = 0 + 1 = 1 ∂x Higher derivatives. We can repeat differentating w.r.t. either x or y. ∂2f ∂x2 ∂2f ∂y 2 ∂2f ∂x∂y ∂2f ∂y∂x “differentiate twice w.r.t. x “differentiate twice w.r.t. y “differentiate first w.r.t y and then w.r.t. x “differentiate first w.r.t x and then w.r.t. y. Example 2 (Continuation of Example 1). We have ∂2f ∂x2 = = = 2 ∂ f ∂y∂x = = = ∂2f ∂x∂y = = = ∂2f ∂y 2 = = = 2 ∂ f Remark. The equation ∂x∂y = we work with in this course). ∂2f ∂y∂x ∂ ∂f ( ) ∂x ∂x ∂ (3x2 · cos 2y + 4x) ∂x 6x · cos 2y + 4 ∂ ∂f ( ) ∂y ∂x ∂ (3x2 · cos 2y + 4x) ∂y −6x · sin 2y ∂ ∂f ( ) ∂x ∂y ∂ (−2x3 · sin 2y + 1) ∂x −6x · sin 2y ∂ ∂f ( ) ∂y ∂y ∂ (−2x3 · sin 2y + 1) ∂y −4x3 · cos 2y. holds for all reasonably well behaved functions (for example everything 71 Example 3 - Hemisphere The hemisphere of radius 1 is given by the formula x2 +y 2 +z 2 = 1 for z ≥ 0. Then z = f (x, y) = ∂f We wish to differentiate to find ∂f ∂x and ∂y . Recall the chain rule 1 √ f (x) = 1 − x2 2 = u p 1 − x2 − y 2 . where u = 1 − x2 , hence applying the chain rule df df du 1 1 x = = u− 2 (−2x) = − 1 dx du dx 2 (1 − x2 ) 2 Hence for z = f (x, y) = 1 − x2 − y 2 12 let f (x, y) = √ u for u = 1 − x2 − y 2 and then ∂z df ∂u −x = = 1 ∂x du ∂x (1 − x2 − y 2 ) 2 ∂z df ∂u −y = = 1 ∂y du ∂y (1 − x2 − y 2 ) 2 Example 4 2 If f (x, t) = x2 − t2 , find ∂f ∂f ∂x , ∂t ∂f and show that t ∂f ∂x + x ∂t = 0. ∂f ∂x ∂f ∂t = 2 x2 − t2 .2x = 4x x2 − t2 = 2 x2 − t2 .(−2t) = −4t x2 − t2 ∂f Hence t ∂f ∂x + x ∂t = 0. Example 5 The volume of a cuboid is v = xyz hence ∂V ∂x ∂V ∂y ∂V ∂z = yz = xz = xy Example 6 If u(x, t) = sin(x − 2t) show that ∂u ∂t + 2 ∂u ∂x = 0. ∂u ∂t ∂u ∂x Hence ∂u ∂t = −2 cos(x − 2t) = cos(x − 2t) + 2 ∂u ∂x = 0. Example 7 2 ∂u ∂t ∂u ∂x ∂2u ∂x2 1 − x4t √ e t 1 x2 2 ∂ u = t− 2 e− 4t satisfies ∂u ∂t = ∂x2 the Heat equation. 2 2 1 x2 1 x2 x −2 1 3 x2 x 1 = t− 2 e− 4t t − t− 2 e− 4t = t− 2 e− 4t − 4 2 4t2 2t x2 1 x2 2x x = t− 2 e− 4t − = − 3 e− 4t2 4t 2t 2 2 2 2 x x x2 x2 1 x2 1 2x 1 1 x x2 x = − 3 e− 4t2 − 3 e− 4t2 − = − 3 e− 4t2 + 5 e− 4t2 = t− 2 e− 4t − 4t 4t2 2t 2t 2 2t 2 2t 2 4t 2 Show that u(x, t) = 72 9.2 Applications A. Local max and min It is useful here to compare the situation with functions in one variable. Functions in one variable. If we are looking for a local max or local min x0 then a neccessary condition is that f 0 (x0 ) = 0. That is x0 , needs to be a stationary point. Then furthermore a. If f 00 (x0 ) > 0 then x0 is a local min. b. If f 00 (x0 ) < 0 then x0 is a local max. Remark. If f 00 (x0 ) = 0 then anything can happen. Functions in two variables. A neccessary condition here is that ∂f ∂f (x0 , y0 ) = 0, and (x0 , y0 ) = 0. ∂x ∂y Such a point (x0 , y0 ) is called a stationary point. Before saying more we need some notation: Notation. fx , fxy , . . . are shorthand notations for 0 , . . . are shorthand notations for fx0 , fxy ∂f ∂ 2 f ∂x , ∂x∂y , . . .. ∂f ∂2f ∂x (x0 , y0 ), ∂x∂y (x0 , y0 ), . . .. Now suppose that (x0 , y0 ) is a stationary point. Then furthermore 0 0 0 2 0 0 a. If fxx fyy − (fxy ) > 0 and both fxx > 0 and fyy > 0 then (x0 , y0 ) is a local min. 0 0 0 2 0 0 < 0 then (x0 , y0 ) is a local max. < 0 and fyy ) > 0 and both fxx fyy − (fxy b. If fxx 0 2 0 0 fyy − (fxy ) < 0 then (x0 , y0 ) is a saddle point. (See your handwritten notes for a drawing). c. If fxx 0 0 0 2 Remark. If If fxx fyy − (fxy ) = 0 then anything can happen. We refer oftern to these cases as the four possible characteristics of a stationary point (x0 , y0 ). B. Optimisation. Example Consider a closed rectangular box of volume V fixed and of dimensions x, y, z. We will show that the box with minimal surface area is a cube. Solution. It is intuitively clear that there is some rectangular box of volume V that has smallest surface area. Well volume is given by V = xyz and the surface area by S = 2xy + 2yz + 2xz. Substituting in V z = xy into the surface area equation we obtain S = 2xy + 2V 2V + x y 73 Then the critical points in the x and y direction are given by ∂S 2V = 0 ⇒ 2y − 2 = 0 ∂x x 2V ∂S = 0 ⇒ 2x − 2 = 0 ∂y y ⇒ x2 y = V ⇒ xy 2 = V Hence V = xyz = x2 y = xy 2 implies x = y = z, a cube. All that is left to do is show that the critical point is a minimum. 4V ∂2S = = 4 since V = x3 ∂x2 x3 ∂2S 4V = =4>0 ∂y 2 y3 ∂2S = 2>0 ∂y∂x 2 2 2 ∂ S ∂ S ∂ S − = 4 × 4 − 22 = 12 > 0 ∂x2 ∂y 2 ∂y∂x Hence the cube is a box with the minimal surface area for a given volume. C. Differentials (small changes) The Total Derivative dz is defined as ∂f ∂f dx + dy dz = |{z} |{z} |{z} ∂x ∂y small change in x estimate of change in z small change in y So dz estimates the change in z due to the change dx in x and dy in y. Example If z = 2x2 y 3 find the total derivative dz at x = 1, y = 2. dz = = ∂f ∂f dx + dy ∂x ∂y 4xy 3 dx + 6x2 y 2 dy Hence at x = 1, y = 2 we obtain dz = 32dx + 24dy. Hence the relative change is given by dz z dz z = = 4xy 3 6x2 y 2 dx + dy 2x2 y 3 2x2 y 3 dx dy 2 +3 x y Alternatively when asking for relative changes take logs of z = 2x2 y 3 so that ln(z) = ln(2) + 2 ln(x) + 3 ln(y) Now we differentiate to obtain dz dx dy =2 +3 z x y Example. In the example above if dx = 0.1 and dy = 0.1 then the change in the output would be approximately dz = 32 · 0.1 + 24 · 0.1 = 5.6 and the relative change would be dz 0.1 0.1 =2· +3· = 0.35 z 1 2 (i.e. 35%). 74 9.3 The Chain Rule If z = z(x, y) with x = x(t), y = y(t) then dz = dt ∂z ∂x dx + dt ∂z ∂y dy dt Example 2 A. If z = ln(x2 + y 2 ) with x = e−t and y = et then dz ∂z dx ∂z dy = + dt ∂x dt ∂y dt 2x 2y −t t2 = −e + e 2t x2 + y 2 x2 + y 2 1 −t t2 −2xe = + 4yte x2 + y 2 B. If z = z(x, y) with x = x(s, t), y = y(s, t) then ∂z ∂s ∂z ∂t = = ∂z ∂x ∂z ∂x ∂x ∂z ∂y + · ∂s ∂y ∂s ∂x ∂z ∂y · + · ∂t ∂y ∂t · Example.(Polar coordinates). See figure from your handwritten lecturenotes. If z = z(x, y) and x = r cos θ and y = r sin θ then ∂z ∂r = = ∂z ∂θ ∂z ∂x ∂z ∂y · + · ∂x ∂r ∂y ∂r ∂z ∂z + sin θ · . cos θ · ∂x ∂y ∂z ∂x ∂z ∂y · + · ∂x ∂θ ∂y ∂θ ∂z ∂z = −r sin θ · + r cos θ · . ∂x ∂y = 75

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

### Related manuals

Download PDF

advertisement