Math 160 - Lecture Notes Chapter 3 Wes Galbraith Spring 2015 Section 3.1: Definition of the derivative Definition (Derivative of a function at a point). Let f be a function, and let x = a be a point in the domain of f . The derivative of f at a is the limit given by f (a + h) − f (a) . h→0 h f 0 (a) = lim If the limit f 0 (a) exists, we say that f is differentiable at x = a. Observe that by making the change of variables x = a + h, we may also write the derivative of f at a in the form f 0 (a) = lim x→a f (x) − f (a) . x−a Example (Finding derivatives using the definition 1). Let f (x) = x2 . Find f 0 (2) using the definition of a derivative. Solution: The derivative of f at x = 2 is given by the limit f (2 + h) − f (2) h→0 h f 0 (2) = lim (2 + h)2 − 22 h→0 h = lim 4 + 2h + h2 − 4 h→0 h = lim 2h + h2 h→0 h = lim = lim 2 + h h→0 = 2. 1 Example (Finding derivatives using the definition 2). Let f (x) = x2 . Find f 0 (−3) using the definition of a derivative. Solution: The derivative of f at x = −3 is given by the limit f (−3 + h) − f (−3) h→0 h f 0 (−3) = lim (−3 + h)2 − (−3)2 h→0 h = lim 9 − 6h + h2 − 9 h→0 h = lim −6h + h2 h→0 h = lim = lim −6 + h h→0 = −6. Example (Finding derivatives using the definition 3). Let g(x) = x3 . Find g 0 (3) using the definition of a derivative. Solution: The derivative of f at x = 3 is given by the limit g(3 + h) − g(3) h→0 h g 0 (3) = lim (3 + h)3 − 33 h→0 h = lim 27 + 27h + 9h2 + h3 − 27 = lim h→0 h 27h + 9h2 + h3 h→0 h = lim = lim 27 + 9h + h2 h→0 = 27. Example (Finding derivatives using the definition 4). Let u(x) = |x|. What is u0 (0)? Solution: u0 (0) does not exist. To see this, observe that for |h| h→0 h u0 (0) = lim must exist. Taking one sided limits, we find that lim+ h→0 |h| h = lim+ = lim+ 1 = 1, h→0 h h→0 h 2 but lim− h→0 |h| −h = lim− = lim− −1 = −1. h→0 h→0 h h Since the one sided limits are not equal to each other, u0 (0) does not exist. We say that u is not differentiable at x = 0. The function u(x) = |x| has a corner at x = 0. 2 Example (Finding derivatives using the definition 5). Let v(x) = x 3 . Find v 0 (0). Solution: The derivative v 0 (0) does not exist. To see this, note that v(h) − v(0) , x→0 h v0(0) = lim but 2 v(h) − v(0) h3 lim+ = lim+ h→0 h→0 h h = lim+ h→0 1 h1/3 = ∞. Thus v is not differentiable at x = 0 because v 0 (0) does not exist. We say that v has a cusp at x = 0 because the right hand limit is ∞, but the left hand limit is −∞. Example (Finding derivative using the definition 6). Let w(x) = x1/3 . What is w0 (0)? Solution: The derivative w0 (0) does not exist. This is because, if it does exist, (0 + h)1/3 − 01/3 . h→0 h w0 (0) = lim However, lim+ h→0 h1/3 (0 + h)1/3 − 01/3 = lim+ h→0 h h = lim+ h→0 1 h2/3 = ∞, so w0 (0) does not exist. We say that w has a vertical tangent line at x = 0, because the one sided limits above both approach positive infinity as h approaches zero. Example (Finding derivatives using the definition 7). Let F (x) = x1 . Find F 0 (1/2) using the definition of a derivative. 3 Solution: The derivative of F at x = 1/2 is given by the limit F (1/2 + h) − F (1/2) h→0 h F 0 (1/2) = lim = lim 1 1/2+h 1 1/2 h h→0 = lim − 1 1/2+h − 1 1/2 h h→0 · 1/2 + h 1/2 + h 1 − 2(1/2 + h) h→0 h(1/2 + h = lim = lim h→0 −2h h(1/2 + h) −2 h→0 1/2 + h = lim = −4. Example (Finding derivatives using the definition 8). Let G(x) = using the definition of a derivative. √ x. Find G0 (2) Solution: The derivative of G at x = 2 is given by the limit G(2 + h) − G(2) h→0 h √ √ 2+h− 2 = lim h→0 h √ √ √ √ 2+h− 2 2+h+ 2 √ ·√ = lim h→0 h 2+h+ 2 G0 (2) = lim h √ √ h→0 h( 2 + h + 2) = lim = lim √ h→0 1 √ 2+h+ 2 1 = √ . 2 2 Definition (Tangent and Normal Lines). The tangent line to a function f at x = a is the line which contains the point (a, f (a)), and whose slope is f 0 (a). The normal line to f at x = a is the line which contains the point (a, f (a)), and whose slope is − f 01(a) . 4 Example (Computing Tangent and Normal Lines 1). Find the tangent and normal line to F (x) = x1 at x = 1/2. We saw above that F 0 (1/2) = −4. Thus the tangent line has slope −4. The tangent line passes through the point (1/2, F (1/2)) = (1/2, 2). Using point slope form, we find the equation of the tangent line is given by T : y − 2 = −4(x − 1/2). 1 The slope of the normal line is − F 0 (1/2) = 41 , and it too passes through the point (1/2, 2). Thus the normal line is given by the equation 1 N : y − 2 = (x − 1/2). 4 Example (Computing Tangent and Normal Lines 2). Find the tangent and normal √ line to G(x) = x at x = 2. We saw above that G0 (1/2) = 2√1 2 . Thus the tangent line has slope 2√1 2 . The tangent line √ passes through the point (2, G(2)) = (2, 2). Using point slope form, we find the equation of the tangent line is given by √ 1 2 = √ (x − 2). 2 2 √ √ 1 = −2 2, and it too passes through the point (2, 2). The slope of the normal line is − F 0 (1/2) Thus the normal line is given by the equation √ √ N : y − 2 = −2 2(x − 2). T :y− Differentiability implies continuity Theorem (Differentiability implies continuity). If f is a function which is differentiable at x = a, then f must also be continuous at x = a. Example (Differentiability implies continuity 1). The function f (x) = x2 is differentiable at every point a: it is possible to draw a well defined tangent line at any point x = a. This tells us that f (x) = x2 must also be continuous everywhere. Example (Differentiability implies continuity 2). The contrapositive of the above theorem tells us that if a function f is not continuous at a point x = a, then f cannot be differentiable at x = a. For example, consider the function v : R → R defined by x, x 6= −1 v(x) = 1 x = −1 Then v is not continuous at x = −1, because v(−1) = 1, whereas limx→−1 = −1. This tells us that v cannot be differentiable at x = −1. Conclusion agrees with geometric intuition, because there is not a single well defined tangent line to v at x = −1. 5 Example (Continuity does not imply differentiability). Be aware that the converse of the above theorem is not true in general, and functions which are continuous at x = a are not always differentiable there as well. For instance, the function u(x) = |x| is certainly continuous at x = 0. However, as we have already seen, u is not differentiable at x = 0. Here is the proof that differentiability implies continuity: Proof. Assume that f is differentiable at x = a, so that f (a + h) − f (a) h→0 h f 0 (a) = lim exists. Introducing the change of variables x = a + h, we see that lim f (x) = lim f (a + h) x→a h→0 = lim [f (a + h) − f (a) + f (a)] h→0 (f (a + h) − f (a))h = lim + f (a) h→0 h f (a + h) − f (a) + lim f (a) h→0 h→0 h = lim h lim h→0 = 0 · f 0 (a) + f (a) = f (a). We conclude that f is continuous at x = a. Section 3.2: Thinking of f 0 as a function Recall that f is differentiable at a point x = a if the limit f 0 (a) exists. We can extend this definition so that we have a notion of what it means for a function to be differentiable on a subset of R. Definition (Differentiability on subsets of R). Let f be a function, and let A be a subset of R. We say that f is differentiable on A if for every point a in the set A, f is differentiable at a, i.e., the limit f 0 (a) exists. If f is differentiable on A, we can think of the derivative f 0 as a function whose domain is A, and whose value at a point x ∈ A is given by f 0 (x) = lim h→0 f (x + h) − f (x) . h 6 The notation f 0 is accredited to Sir Issac Newton. An equivalent way of writing the derivative as a function is with Leibniz notation. Expressed this way, the derivative of f is written as df , dx and the value of df dx at x = a is denoted df dx . x=a Example (Derivative as a function 1). Let f be the function defined by f (x) = x2 . Then f 0 is the function defined by f (x + h) − f (x) h→0 h f 0 (x) = lim (x + h)2 − x2 h→0 h = lim x2 + 2xh + h2 − x2 h→0 h = lim 2xh + h2 h→0 h = lim = lim 2x + h h→0 = 2x. df Since this limit exists for all real numbers x, the domain of f 0 = dx is R. The power of using this approach is that we can now find the derivative of f at any point x, without having to take a limit every time. For instance, f 0 (2) = 2(2) = 4. We can also write this using Leibniz notation as df dx = 2(2) = 4. x=2 If we want to find the derivative at a different point, say x = −3, we only have to plug in a different value of x into the function which we found above: f 0 (−3) = 2(−3) = −6, or equivalently, df dx = 2(−3) = −6. x=−3 7 Example (Derivative as a function 2). Let g(x) = x3 . Then g 0 is the function given by g(x + h) − g(x) h→0 h g 0 (x) = lim (x + h)3 − x3 h→0 h = lim x3 + 3x2 h + 3xh2 + h3 − x3 h→0 h = lim 3x2 h + 3xh2 + h3 h→0 h = lim = lim 3x2 + 3xh + h2 h→0 = 3x2 . dg = 3x2 to show what the derivative The domain of g 0 is all of R. We may alternatively write dx 0 of g is. Let’s evaluate g at the points x = 2 and x = −3: g 0 (2) = 3(2)2 = 12, which can also be written as dg dx = 12, x=2 and g 0 (−3) = 3(−3)2 = 27, which we could also write as dg dx = 27. x=−3 Example (Derivative as a function 3). Let F (x) = x1 . The derivative of F is the func- 8 tion F 0 , whose value at the point x is given by F 0 (x) = lim h→0 = lim F (x + h) − F (x) h 1 x+h 1 x 1 x+h 1 x − h h→0 = lim − h h→0 · x+h x+h 1 − 1 − hx h→0 h(x + h) = lim − x1 h→0 x + h = lim =− 1 . x2 This limit is defined for every real number x except for x = 0, so the domain of F 0 is (−∞, 0) ∪ (0, ∞). Example (Derivative as a function 4). Let G(x) = sin(x). Using the identity sin(x + h) = sin(x) cos(h) + cos(x) sin(h), we compute the derivative of G: G(x + h) − G(x) h→0 h G0 (x) = lim sin(x + h) − sin(x) h→0 h = lim sin(x) cos(h) + cos(x) sin(h) − sin(x) h→0 h = lim sin(x)(cos(h) − 1) + cos(x) sin(h) h→0 h = lim cos(h) − 1 sin(h) + cos(x) lim h→0 h→0 h h = sin(x) lim = sin(x) · 0 + cos(x) · 1 = cos(x). 9 Example (Derivative as a function 5). Let u(x) = √ x. We find u0 (x) as follows: u(x + h) − u(x) h→0 h √ √ x+h− x = lim h→0 h √ √ √ √ x+h− x x+h+ x ·√ = lim √ h→0 h x+h+ x u0 (x) = lim (x + h) − x √ √ h→0 h( x + h + x) = lim = lim √ h→0 1 √ x+h+ x 1 = √ . 2 x Since the final expression we got is defined only for non-negative values of x, the domain of u0 is [0, ∞). Derivatives of common functions It is also possible to think of the derivative as an operator on functions, that is, we think df d as a map which sends the function f to the function dx . This justifies of the derivative dx using operator notation to compute derivatives. For example, we may write d h 2i x = 2x dx to show that the derivative of the function f (x) = x2 is f 0 (x) = 2x. This notation makes it easy to list derivatives of functions which you will see frequently. • d [c] dx • d [xn ] dx • d [sin(x)] dx = cos(x) • d [cos(x)] dx = sin(x) • d [ex ] dx • d [log(x)] dx • d dx h = 0, where c is a constant which does not depend on x = n · xn−1 (this is called the power rule) = ex i |x| = = 1 x x |x| 10 Example (Computing derivatives with the power rule). The following examples illustrate the use of the power rule. 1. d [x3 ] dx = 3x2 2. d [x4 ] dx = 4x3 3. d [x5 ] dx = 5x4 4. d [ dx 5. d √ [ x] dx √ x3 ] = = = 23 x1/2 = 3√ x 2 = 12 x−1/2 = 1 √ 2 x d [x3/2 ] dx d [x1/2 ] dx d = dx [x−1 ] = −x−2 = − x12 1 d d 7. dx = dx [x−2 ] = −2x−3 = −2 x2 x3 1 d d = dx [x−3 ] = −3x−4 = −3 8. dx x3 x4 6. d dx 1 x Section 3.3: Differentiation Rules We now introduce a number of theorems which allow us to compute derivatives of more complicated functions without having to use limits. Theorem (Constant multiple rule). If f (x) = cg(x), where c is a real contstant, then f 0 (x) = cg 0 (x). In operator notation, the equivalent statement is written d dg d [cg(x)] = c [g(x)] = c . dx dx dx Example (Constant multiple rule). The following illustrate use of the contstant multiple rule. 1. d [3x2 ] dx 2. d [−3 sin(x)] dx = −3 cos(x) 3. d [−3 cos(x)] dx = 3 sin(x) = 3 · 2x = 6x 4. d dx −4 5. d dx [πex ] = πex . x3 = −12 . x4 Theorem (Derivatives of sums/differences). The derivative of a sum (or difference) is the sum (or difference) of derivatives. That is, if f and g are differentiable functions on a set A, and if h = f + g, then h is differentiable on A as well, and h0 (x) = f 0 (x) + g 0 (x). In operator notation, we write d d d df dg [f (x) + g(x)] = [f (x)] + [g(x)] = + . dx dx dx dx dx 11 Example (Derivatives of sums/differences). The following are derivatives of sums/differences of functions 1. d [x3 dx 2. d [sin(x) dx 3. d [ex dx + 3x2 − 6x + 6] = + 2 cos(x)] = − |x|] = ex − d [x3 ] dx d d + 3 dx [x2 ] − 6 dx [x] + d [sin(x)] dx d [6] dx = 3x2 + 6x − 6. d + 2 dx [cos(x)] = cos(x) − 2 sin(x) x |x| Theorem (Product Rule). If f and g are differentiable functions on a set A ⊂ R, and if h = f g is their product (i.e. h(x) = f (x)g(x)), then h is differentiable on A, and h0 (x) = f (x)g 0 (x) + f 0 (x)g(x). In operator notation, this is written d d d [f (x)g(x)] = f (x) [g(x)] + [f (x)]g(x). dx dx dx Example (Product Rule). The following derivatives can be found using the product rule. d = x dx [ex ] + 1. d [xex ] dx 2. d [x2 dx 3. d [sin(x) cos(x)] dx 4. d dx 5. d dx h d [x]ex dx = xex + ex . d sin(x)] = x2 dx [sin(x)] + log(x) x i = d dx = d [x2 ] sin(x) dx d [sin(x)] cos(x) dx log(x) cot x1 = 1 x · = x2 cos(x) + 2x sin(x). d + sin(x) dx [cos(x)] = cos2 (x) − sin2 (x) 1 x − log(x) x12 = 1−log(x) x2 [(x4 + 4x2 − 3x + 2)(4x3 − 3x2 + 2x − 15)] = (x4 + 4x2 − 3x + 2)(12x2 − 6x + 2) + (4x3 + 3x − 3)(4x3 − 3x2 + 2x − 15) (it is okay if we do not expand this) Theorem (Quotient Rule). Let f and g be differentiable functions on A ⊂ R, with g(x) 6= 0 for all x in A. Then their quotient h = fg is differentiable on A as well, and h0 (x) = g(x)f 0 (x) − f (x)g 0 (x) . g(x)2 In operator notation, we write this as d f (x) d 1 d g(x) [f (x)] − f (x) [g(x)] . = dx g(x) g(x)2 dx dx Example (Quotient Rule). The following derivatives may be computed with the quotient rule. x dxd [ex ]−ex dxd [x] x x d ex 1. dx = = xe x−e . 2 x x2 h 3 i 2 2 3 −3x+2)(2x) x −3x+2 d 2. dx = (x +1)(3x −3)−(x . (No further simplification required) x2 +1 (x2 +1)2 12 3. d [tan(x)] dx = d dx h sin(x) cos(x) i = cos2 (x)+sin2 (x) cos2 (x) 4. d [cot(x)] dx = d dx h 1 tan(x) i = − sec2 (x) tan2 (x) 5. d [sec(x)] dx = d dx h 1 cos(x) i = sin(x) cos2 (x) 6. d [csc(x)] dx = d dx h 1 sin(x) i = − cos(x) sin2 (x) = 1 cos2 (x) = sec2 (x). = − csc2 (x) = tan(x) sec(x) = − csc(x) cot(x). Higher Order Derivatives When we start taking derivatives of derivatives, we obtain what are called higher order derivatives. The second derivative of the function f is denoted as one of the following: 2 f 00 (x), f (2) (x), or ddxf2 . The notation for the third order derivative of f is either f (3) (x), or d3 f . dx3 Example (Higher Order Derivatives 1). Let f (x) = x6 . Then f (0) (x) = x6 f (1) (x) = 6x5 f (2) (x) = 30x4 f (3) (x) = 120x3 f (4) (x) = 360x2 f (5) (x) = 720x f (6) (x) = 720 f (7) (x) = 0, and f (n) (x) = 0 for all n ≥ 8. 13 Example (Higher Order Derivatives 2). Let g(x) = sin(x). Then g (0) (x) = sin(x) g (1) (x) = cos(x) g (2) (x) = − sin(x) g (3) (x) = − cos(x) g (4) (x) = sin(x) g (5) (x) = cos(x) g (6) (x) = − sin(x) g (7) (x) = − cos(x) . . . Notice that there is a pattern above: the derivatives repeat every fourth term. Using this observation, it makes it easy to compute things such as g (1001) (x), once we figure out what the remainder of 1001 is when divided by 4. Since 1001 = 4 · 250 + 1, we have g (1001) (x) = g (1) (x) = cos(x). Example (Higher Order Derivatives 3). Let F (x) = xex . Then F (0) (x) = xex F (1) (x) = ex + xex = (1 + x)ex F (2) (x) = ex + (1 + x)ex = (2 + x)ex F (3) (x) = ex + (2 + x)ex = (3 + x)ex F (4) (x) = ex + (3 + x)ex = (4 + x)ex F (5) (x) = ex + (4 + x)ex = (5 + x)ex . . . Based on the pattern we see, we can figure out that F (n) (x) = (n + x)ex . For example, F (1001) (x) = (1001 + x)ex , and F (1001) (10) = 1011e10 . 14 Example (Higher Order Derivatives 4). Let G(x) = x2 ex . Then G(0) (x) = x2 ex G(1) (x) = (x2 + 2x)ex G(2) (x) = (x2 + 4x + 2)ex G(3) (x) = (x2 + 6x + 6)ex G(4) (x) = (x2 + 8x + 12)ex G(5) (x) = (x2 + 10x + 20)ex G(6) (x) = (x2 + 12x + 30)ex . . . The pattern above is G(n) (x) = (x2 + 2n · x + (n − 1)n)ex , so that, for instance, G(100) (x) = (x2 + 200 + 9900)ex , and G(100) (10) = 10200. Section 3.4: Derivative as a rate of change and applications (a.k.a. Where you might see this stuff in real life) Example Area of a circle. A function which describes the area of a circle is A : [0, ∞) → R, A(x) = πr2 , with units in m2 . The rate of change of the area with the radius is given 2 by A0 (r) = 2πr, which takes on the units mm = m. Interestingly, the derivative of the area of a circle is the circumference of a circle. Suppose we want a function which describes the area of a circle in terms of the diameter d. Call this function A. Then A : [0, ∞) is given by 0 A(d) = A(d/2) = π4 d2 . Then A (d) = π2 d, which is still the circumference of a circle. Example Volume of a sphere. A function which describes the volume of a sphere in terms of the radius is V : [0, ∞) → R, V (r) = 43 πr3 . The derivative is V 0 (r) = 4πr2 , which is the surface area of the sphere. Example Volume of a cube. A function which describes the volume of a cube in terms of the length of one of its sides is V : [0, ∞) → R, V (x) = x3 . The derivative of V is V 0 (x) = 3x2 , which is one half of the surface area of the cube. Example Designing Soda Cans. The volume of a cylindrical soda can is given by V = πr2 h. Note that this is not a function of a single variable. We can make it into a function of one variable if we have an extra piece of information relating r and h. One such piece of information is the surface area of the can, which is given by S = 2πrh + 2πr2 . 15 Suppose are told that the surface area of the can is 100 cm2 . We then know that 100 = 2πrh + 2πr2 . If we want V as a function of r only, then we solve for h in terms of r: 100 − 2πr2 h= , 2πr and then substitute this for h in our volume equation to obtain 100 − 2πr2 2 V (r) = πr . 2πr Example Motion of a particle. A number of functions describe the motion of a particle. If x(t) describes the position of a particle as a function of time, then x0 (t) is the velocity of the particle and x00 is the acceleration of the particle. We sometimes us v(t) and a(t) to denote the velocity and the acceleration respectively. If x(t) is given in units of meters, and t is in seconds, then the units of v are ms , and the units of a are xm2 . There is an important distinction to be made between the velocity and the speed of the particle. While the velocity is given by x0 (t), and describes both how fast the particle is moving and in which direction it is moving, the speed is given by |x0 (t)|, and only describes how fast the particle is moving at a given instant. For example, if the position function is given by x(t) = t3 − 6t2 + 9t + 2, then v(t) = x0 (t) = 3t2 − 12t + 9 whereas the speed of the particle is given by s(t) = |x0 (t) = |3t2 − 12t + 9| Difference between these two functions is readily seen upon viewing graphs of each one. The primary difference is that the speed s(t) is non-negative, whereas the velocity v(t) can assume positive or negative values. With the above functions, v(3) = −3, which indicates that the particle is moving backwards at a rate of 3 ms at t = 3 seconds. However, the speed at t = 3 is s(3) = 3, which only indicates the particle is moving at a rate of 3 ms at t = 3 seconds. Example Economics. Derivatives arise in economics as marginals. Let c(x) be a function describing the weekly cost of producing x units of a good. The units of c(x) are dollars per week. Let r(x) be the function describing weekly revenue, or total amount of money that is made before costs of production are taken into account. Let P (x) be the total weekly profit. This is given by P (x) = r(x) − c(x). The derivative of each of these quantities represents a marginal quantity, which describes how much the original quantity would change if one more unit were produced per week, i.e. if x were increased by one unit. 16 For instance, suppose we are producing and selling washing machines, and are currently producing 100 machines per week. We want to know if it is worth increasing our production to 101 washing machines per week. The local economist tells us that the cost and revenue of producing x washing machines per week are given by c(x) = 2000 + 100x + 0.1x2 and 1 , r(x) = 20000 1 − x so that our weekly profit is 1 P (x) = 20000 1 − x − 0.1x2 − 100x − 2000. The marginal profit when we are producing x washing machines per week is P 0 (x) = 20, 000 − 0.2x − 100, x2 and the marginal profit at x = 100 machines per week is P 0 (100) = −118. This tells us that our profit will decrease by 118 dollars per week if we increase weekly production by one, and it is thus a wise business decision to not increase production. Example More economics. We are producing radiators. It costs c(x) = x3 − 5x2 + 15x dollars to produce x radiators per day when 8 ≤ x ≤ 30, and our daily revenue is r(x) = x3 −3x2 +12x. Would you recommend increasing or decreasing production when we currently produce 15 radiators per week? How about if we currently produce 20 radiators per week? Example Inventories. We are managing a shoe inventory. Our favorite local economist hands us a function A(q) which describes the average weekly cost of holding our inventory when we order q shoes per week. Let’s say this function is given by A(q) = 40000 + 60000 + 10q. q The derivative of this function is A0 (q) = −40000 + 10, q2 and the second derivative is A00 (q) = 17 80000 . q3 What useful information do the derivatives give us? Suppose we want to find the value of q which minimizes the average weekly cost of managing our inventory. To do so, we first look for critical points of the function A(q), that is, points where A0 (q) = 0. The reason for this is that the condition A0 (q) = 0 gives us a chance that the function A has a local minimum at q. Solving A0 (q) = 0, we should find that q ≈ 63.25. We then note that A00 (63.25) > 0, which tells us that the function A is concave up at q = 63.25, and thus has a local minimum at this point. This tells us that q = 63.25 is a sort of “sweet spot” for shoe order quantities. If we order less than this number of shoes per week, we aren’t ordering enough to keep up with shoe consumption, and are losing potential profits. If instead we order too much more than 63.25 shoes per week, then we are ordering too many, and are losing money because we are holding too many shoes in our inventory. Example Stability of Discrete time dynamical systems and genetics. A discrete time dynamical system consists of an initial condition x0 and a rule which takes the form of a function f : R → R, and tells us how to move to update to the next time step. For example, we compute the point x1 by x1 = f (x0 ). We then compute the next point x2 by x2 = f (x1 ). In general, we compute the nth point in the system by xn = f (xn−1 ). The sequence of point (x0 , x1 , x2 , . . . ) is called the orbit of the dynamical system, and we are interested in the behavior of this sequence as n goes to infinity. We turn to genetics to motivate the study of dynamical systems. In 1856 Gregor Mendel began his study of pea plants. One of the traits that he examined was pea plant color. The peas he studied were either yellow or green. He found that the proportion of yellow pea plants in a generation is a function of the proportion of yellow pea plants in the previous generation. In particular, he found that if the proportion of pea plants in generation n − 1 is p, then the proportion of yellow pea plants in generation n is f (p) = 2p − p2 . Let’s call the proportion of pea plants in generation 0 p0 . Suppose p0 = 0.1. We can compute number of pea plants in the next generations as follows: p1 p2 p3 p4 p5 p6 = f (p0 ) = f (0.1) = 0.19 = f (p1 ) = f (0.19) = 0.3439 = f (p2 ) = f (0.3439) = 0.56953 = f (p3 ) = f (0.56953) = 0.8147 = f (p4 ) = f (0.8147) = 0.96566 = f (p5 ) = f (0.96566) = 0.99882 It appears that the yellow pea plants are taking over. By the sixth generation they accounted for more than 99 percent of the population. The point p = 1 is said to be a stable equilibrium point for the dynamical system. Now the point p = 1 is special in another way. We see that f (1) = 2(1) − (1)2 = 1, so p = 1 is a fixed point of the function f . It turns out that fixed points are equilibrium points of dynamical systems. Now, p = 1 is not the only equilibrium point of the above dynamical system. If we solve the equation f (p) = p, we find solutions p = 1 and p = 0, so that these are the equilibrium points of the system. But why does the dynamical system tend towards the equilibrium at p = 1 and not the one at p = 0? As we have already mentioned, p = 1 is a stable equilibrium 18 point for this dynamical system, and it turns out that p = 0 is an unstable equilibrium point. How can we tell if a fixed point of f is a stable or unstable equilibrium point? The derivative of f is useful in answering this question. Observe that |f 0 (1)| = 0 < 1 and |f 0 (0)| = 2 > 1. We have the following general theorem: Theorem Stability of equilibria. Let p be a fixed point of the dynamical system with rule f . If |f 0 (p)| < 1, then p is a stable equilibrium point, and if |f 0 (p)| > 1, then p is an unstable equilibrium point. Example More dynamical systems. We are tracking an ant colony. These ants either have long antennae or short antennae. We find that if the proportion of ants with long antennae in a given generation is p, then the proportion of ants with long antennae in the next generation is given by 5 3 f (p) = p3 − p2 + 2p. 2 2 If proportion of ants with long antennae is initially p0 = 0.4, what will happen to the proportion of ants with long antennae over many generations? What about if p0 = 0.8? We examine a neighboring ant colony. These ants have double jointed legs or triple jointed legs. We find that if the proportion of ants with triple jointed legs in the current generation is α, then the proportion of ants with triple jointed legs in the next generation is g(α) = 5 −10 + . 9α2 + 6 3 What happens to the proportion of ants with triple jointed legs over many generations if the initial proportion is α0 = 0.4? What about if α0 = 0.8? Example Cylinder pressure. A combustible gas is being held in an engine cylinder by a piston. The pressure that the gas exerts on the walls of the cylinder in pascals 1P a = 1 mN2 = 1 kg·m is given by s2 P = nRT an2 − 2, V − nb V where T is temperature, V is volume of the gas in m3 , n is the number of molecules of gas in J moles, R = 8.314 mol·K is the universal gas constant, and a and b are constants determined by the gas. The change in pressure with temperature is given by dP nR = , dT V − nb and the change in pressure with volume is given by dP −nRT 2an2 = + . dV (V − nb)2 V3 19 Section 3.6 Chain Rule Theorem (Chain Rule). Let f and g be functions, and let h = g ◦ f . If f is differentiable at x and g is differentiable at f (x), then h is differentiable at x, and h0 (x) = g 0 (f (x))f 0 (x). This may also be written with alternate notation as d dg df [g ◦ f ] = . dx df dx indicates that we are treating f (x) as a variable, and we are integrating Here the “fraction” dg df g with respect to this variable. Example (Chain Rule Computations). d [cos(4x)] = − sin(4x) · 4 dx 4 d [(x3 + 2x2 − x − 7)5 ] = 5 x3 + 2x2 − x − 7 3x2 + 4x − 1 dx d √ 2 1 [ x + 1] = (x2 + 1)−1/2 (2x) dx 2 d [sin2 (x)] = 2 sin(x) cos(x) dx d −8x [e ] = −8e−8x dx d ex + e−x ex − e−x = dx 2 2 d ex − e−x ex + e−x = dx 2 2 d [cos3 (x)] = −3 cos2 sin(x) dx d 2 [tan2 (x/5)] = tan(x/5) sec2 (x/5) dx 5 √ √ √ cot( 3 x) d 1 1 −2/3 3 3 √ cos x [log(sin( x))] = x = √ 3 dx 3 sin 3 x 3 x2 d [sin(cos(tan(x)))] = cos(cos(tan(x)))(− sin(tan(x))) sec2 (x) dx d h −e−x2 i −x2 2 2 −x2 e = e−e −e−x (−2x) = 2xe−x −e dx 20 Section 3.7: Implicit Differentiation Implicit differentiation is used to find instantaneous rates of change of curves, which don’t necessarily have to be functions. Example (Implicit Differentiation). Consider the curve C : y 2 = x. This curve is not the graph of a function, for it violates the vertical line test (the points (1, 1) and (1, −1) both satisfy this equation. However, it is still possible to find the derivative of this curve dy at the point (4, −2). We have to treat y as a function at a point. We do this by finding dx of x, and then we differentiate everything in the equation with respect to x, treating y as a function of x and using the chain rule when necessary: 2y dy = 1. dx Thus, we have dy 1 = , dx 2y and dy dx (4,−2) 1 =− . 4 We can find the tangent and normal lines to a curve in the same exact way that we find these lines for a fucntion. Here the tangent line to the curve C is the line with slope m = − 14 which goes through the point (4, −2), and is thus given by the equation 1 ` : y + 2 = − (x − 4). 4 The normal line to C at (4, −2) is then given by N : y + 2 = 4(x − 4). Suppose instead that we want the normal and tangent lines to C at the point ( 81 , 2√1 2 . The slope of the tangent line is given by m= dy dx √ (1/8,1/2 2) 1 = 2 1 √ 2 2 = so the equation of the tangent line is given by √ 1 1 y− √ = 2 x− , 8 2 2 while the equation of the normal line is given by 1 1 y − √ = −√ 2 2 2 21 1 x− , 8 √ 2, Example (Implicit Differentiation 1). Let C : 6x2 + 3xy + 2y 2 + 17y − 6 = 0. Find points (x, y) on C whose tangent line has slope 0. Find all vertical tangent lines to C. Solution: First, find the derivative to the curve. 12x + 3y + 3x dy dy dy + 4y + 17 =0 dx dx dx dy (3x + 4y + 17) = 0 dx 12x + 3y + 12x + 3y dy =− . dx 3x + 4y + 12 The tangent line to C has slope zero at points (x, y) where the derivative is zero. To find such points, we solve the equation dy =0 dx 0 = −12x − 3y y = −4x thus any point of the form (x, −4x) on C has a horizontal tangent line. To find points (x, y) where C has a vertical tangent line, we find points where the denominator in the expression dy is zero: for dx 0 = 3x + 4y + 12 4y = −3x − 12 −3x − 12 . 4 has a vertical tangent line. Thus any point on C of the form x, −3x−12 4 y= Example (Implicit Differentiation Let C : y 4 = y 2 − x2 be a curve. Find the q √2). 5−1 √ tangent line to C at the point √13 , := (a, b). Taking the derivative of everything 2 5 with respect to x, we find 4y 3 and solving for dy dx dy dy = 2y − x2 , dx dx yields dy −x2 = 3 . dx 4y − 2y The slope of the tangent line at the point (a, b) is given by dy m := dx − 31 = (a,b) 4 √ 5−1 √ 2 5 22 3/2 −2 √ 5−1 √ 2 5 1/2 , so that the tangent line is given by s√ 1 5−1 √ =m x− √ L:y− 2 5 3 Example (Implicit Differentiation 3). Let C : y 2 = x3 − 2x2 + 3. The graph of C is shown below √ √ Find the equation of the tangent and normal line to C at the following points: (−1, 0), (0, − 3), (1, 2). Example (Implicit Differentiation 4). Let C : y 2 = x3 + 4x2 − x. The graph of C is shown below 23 1. Find the equation of the tangent and normal line to C at the following points: (1, −2), (−1, 2), (−4, 2). 2. At which points does C have a horizontal tangent line? 3. At which points does C have a vertical tangent line? Example (Implicit Differentiation 5). Let C : y 2 = x3 + 4x2 . The graph of C is shown below 24 1. Find√the equation of the tangent and normal line to C at the following points: √ 5 6 5 1 3 2 ( 2 , 4 ), (−3, −3), (− 2 , − 4 ). 2. At which points does C have a horizontal tangent line? 3. At which points does C have a vertical tangent line? 4. At which point(s) does C not have a well defined tangent line? Example (Implicit Differentiation 6). Let C : x2 + y 2 = (2 ∗ x2 + 2 ∗ y 2 − x)2 . The graph of C is shown below Some Points: (0, 12 ), (0, − 12 ), Example (Implicit Differentiation 7). Let C : x2/3 + y 2/3 = 4. The graph of C is shown below 25 √ √ √ Some Points: (−3 3, 1), (±2 2, ±2 2). Question: Find points on the curve which have tangent lines of slope ±1. Example (Implicit Differentiation 8). Let C : 2(x2 + y 2 )2 = 25(x2 − y 2 ). The graph of C is shown below Question: Find the tangent and normal lines to C at the point (−3, 1). Solution: First 26 we find the derivative of the curve at the point (−3, 1). 2(x2 + y 2 )2 = 25(x2 − y 2 ) 2x4 + 4x2 y 2 + 2y 4 = 25x2 − 25y 2 8x3 + 8xy 2 + 8x2 y dy dy dy + 8y 3 = 50x − 50y dx dx dx (8x2 y + 8y 3 + 50y) dy = 50x − 50y − 8x3 − 8xy 2 dx dy 50x − 50y − 8x3 − 8xy 2 = dx 8x2 y + 8y 3 + 50y dy dx = (−3,1) 4 . 13 The tangent line at (−3, 1) is given by 4 (x + 3), 13 and the normal line at the same point is given by y−1= y−1=− 13 (x + 3). 4 Example (Implicit Differentiation 9). Let C : x3 = 8 cos(y)2 . The graph of C is shown below 27 √ √ Some Points: ( 3 4, π4 ), ( 3 2, π3 ) . Question: Find the tangent lines to the curve C at the above points. 28 Example (Implicit Differentiation 10). Let C : (2x2 + y 2 )2 + 4x(2x2 − 3y 2 ) + 4(y 2 − x2 ) = 0. The graph of C is shown below Some Points: . Question: Using calculus, find the points on the curve which have vertical tangent lines. 29