Lecture 6: Calculus In Song Kim September 7, 20 Introuction to Differential Calculus In our previous lecture we came up with several ways to analyze functions. We saw previously that the slope of a linear function, y = a + b at a point is: m = y = y 2 y 2 = f( 2) f( ) 2 Note that the slope how the function changes as we move across values of oes not change. For a general curve, the slope varies from point to point. Definition A secant line of a curve is a line that intersects two or more points on the curve. Eample f() = 2. The slope of the secant between (0, 0) an (, ) is f( 2) f( ) 2 = =. The slope of the secant between (, ) an (2, 4) is f( 2) f( ) 2 = 3 = 3. How to calculate the slope of a curve at a certain point when this curve is not a straight line? Notice that we can raw many secants...ones that are closer to our point of interest give us a better approimation. Wouln t it be a reasonable iea to take a secant line an evaluate it at two points very close to the point we want to obtain the slope at?. Limit Review We have previously talke a little bit about limits. But lets o a little review an be a bit more technical as they will be important for us in talking about erivatives. Does a function f approach some number L as its input variable goes to some number c (often 0 or ± )? If so f() approaches L as approaches c. Formally we say lim f() = L. Eamples:. lim k = k Please o not istribute without permission. Ph.D. caniate, Department of Politics, Princeton University, Princeton NJ 08544.Email: insong@princeton.eu
2. lim = c 3. lim = 0 2 4. lim 2 = 6 3 Uniqueness: lim f() = L an lim f() = M L = M.. Properties of Limits Let f an g be functions with lim f() = A an lim g() = B. lim [f() + g()] = lim f() + lim g() = A + B What property oes this look like that we saw before? lim αf() = α lim f() = αa lim f()g() = [lim f()][lim g()] = AB lim f() Eample 2 g() = lim f() lim g() = A B, provie B 0 lim(2 3) = 2 lim 3 lim = 2 2 3 = 2 2 2 lim n = [lim ] [lim ] = c c = c n Eample 3 Limit eamples. Calculate the following limits at your esk. lim 2 ( 3 5 + 7) = 5 5 lim 2 ( 4 3 +7 ) = 5 39 lim 2 25 5 2 + 30 ( 3)( +3) lim 9 ( 9)(( +3)) ( lim + (factor an reuce, 0 ) 6 ) 3 + ln( + ) (get 0* at first...what to o? We ll have to use something calle L Hopital s Rule that we ll learn in a bit).2 Sequence Review Another helpful concept that we have seen a little of previously is the sequence. A sequence {y n } = {y, y 2, y 3,..., y n } is an orere set of real numbers, where y is the first term in the sequence an y n is the nth term. Generally, a sequence etens to n =. We can also write the sequence as {y n } n=. Sequences are similar to functions. Before, we ha y = f() with specifie over some omain. Now we have {y n } = {f()} with each value of having its own ine, n =, 2, 3,.... Thus the first number we put into our function gives us y. Three kins of sequences: 2
. Sequences that converge to a limit. 2. Sequences that increase or ecrease without boun. 3. Sequences like that neither converge nor increase without boun alternating over the number line. *Boar eamples of all 3*.2. The Limit of a Sequence We re often intereste in whether a sequence converges to a limit. Limits of sequences are conceptually similar to the limits of functions aresse in the previous lecture. Definition 2 (Limit of a sequence). The sequence {y n } has the limit L, that is lim n y n = L, if for any ɛ > 0 there is an integer N (which epens on ɛ) with the property that y n L < ɛ for each n > N. {y n } is sai to converge to L. If the above oes not hol, then {y n } iverges. Eample 4 { }. lim 2 n n = 2 2 Uniqueness: If {y n } converges, then the limit L is unique. Properties: Let lim n y n = A an lim n z n = B. Then. lim [αy n + βz n ] = αa + βb n 2. lim y nz n = AB n y 3. lim n n zn = A B, provie B 0 Fining the limit of a sequence in R n is similar to that in R. 2 The Derivative Definition 3 The erivative of a function f() is simply the slope of the secant of f() at a pair of points very close to (, f()): f f() f(a) f(a + h) f(a) (a) = lim = lim a a h 0 h This looks very similar to how we calculate the slope of a linear function. The erivative is evaluate at a point which converges to (i.e., h 0). Definition 4 A straight line is tangent to a curve, at some point, if both line an curve pass through the point with the same irection; such a line is the best straight-line approimation to the curve at that point. Eample 5 Graphical boar eamples Notation The slope of the tangent line of f() at any point is calle the erivative an we enote it f f() (), or in Leibniz notation :. Think of this as saying how is f() changing f() with an infinitesimally small change in. 3
3 Calculating Derivatives 3. Calculating Derivatives Lets start with the simple case where we have a function f() = k. Then the erivative is f () = k k. For eample, f() = 2, f () = 2. You ll use this over an over, but lets prove that this is actually the case. Before proving this, though, we nee a lemma. A lemma is an aitional statement (often proven elsewhere) that we nee in orer to prove the thing we are intereste in. Lemma 3. (Binomial epansion): For any positive integer k, ( + h) k = k + a k h +...a k h k + a k h k, where a j = k! j!(k j)!, for j =,...k Note a = k, a 2 = k(k ) 2, a k = For eample, ( + 3) 2 = 2 2 + 6 + 9 With this in min lets simply apply this lemma to our epression of the erivative. Instea of using the notation f(), lets just use the k part: Proposition 3.2 f() = k f () = k k 3.2 Rules for calculating erivatives Theorem 3.3 (Algebraic Operations of Derivatives) Let f, g : X R be ifferentiable at c X an X R. Then,. (kf) (c) = kf (c) for all k R, 2. (f + g) (c) = f (c) + g (c), 3. (fg) (c) = f (c)g(c) + f(c)g (c) (Prouct Rule), ( ) 4. f g (c) = f (c)g(c) f(c)g (c) for g(c) 0 (Quotient Rule). g(c) 2 Eercise Prove (fg) (c) = f (c)g(c) + f(c)g (c) (Prouct Rule) ( ) Eercise 2 Prove f g (c) = f (c)g(c) f(c)g (c) for g(c) 0 (Quotient Rule). g(c) 2 Eample 6 4 Calculate the erivative of the following functions. 3 6 2 + (6 2 + 2 + )2 (3 + 2)( 2 + ) 4
3.3 Chain Rule Reminer: A composite function is a function whose value epens on the output of another function. f() = 2, g() = (2 + ), hence f(g()) = (2 + ) 2 Definition 5 The Chain Rule is a formula for the erivative of the composite of two functions. In intuitive terms, if a variable, y, epens on a secon variable, u, which in turn epens on a thir variable,, then the rate of change of y with respect to can be compute as the prouct of the rate of change of y with respect to u multiplie by the rate of change of u with respect to. The chain rule may be state in any of several equivalent forms: Theorem 3.4 Suppose h() = f g. Then h () = (f(g())) = f (g())g (). or in the Leibniz notation: f = f u u. (Note: There shoul be some conitions for this theorem to work such as continuity of f an the eistence of f. For now, let s assume all the necessary conitions are met.) 4 Using Derivatives to Analyze Functions Lemma 4. A function is strictly increasing at if f is ifferentiable an its erivative is positive at. That is if f () > 0 Lemma 4.2 A function is strictly ecreasing at if f is ifferentiable an its erivative is negative at. That is if f () < 0 4. Steps for characterizing whether function is increasing or ecreasing. Calculate erivative 2. Fin where erivative is equal to 0 by solving f () = 0. 3. Sub in values of to the left an right of these points (or point) into the erivative f () an check sign 4. If positive then increasing in that region, if negative then ecreasing in that region Eample 7 f() = 2 2 + f () = 2 2, since 2 2 > 0 whenever >, f is increasing if >, an ecreasing if. f() = 2 + 2 f() = f() = 2 2+ 3 3 + 5
5 The Secon Derivative In several of the eamples we i, we saw that the value of the erivative epene on the value of. Hence we also want to ask questions about how the erivative itself changes as a function of. I.e., we want to take the erivative of the erivative. Definition 6 The erivative of the first erivative is the secon erivative. We often use the notation f () or 2 y. The secon erivative is the slope of the line tangent to the first erivative 2 at the point. We can think of this as the change in change of the function. In physics, the first erivative is the spee of an object while the secon erivative is the acceleration of an object. 5. Calculating the 2n Derivative Simply take the erivative of the first erivative. All rule for ifferentiation continue to apply. Write neatly, things can get messy an complicate. 5.2 Using the 2n Derivative The secon erivative allows us to more completely characterize the behavior of a function. While the first erivative tells us whether a function is increasing or ecreasing at some point, it oesn t tell us whether the pace of increase/ecrease is changing. Two important properties of a function can be checke with the secon erivative. Definition 7 A function is conve (or concave up) in a region if a secant line in any two points of the region is above f. Formally, the function f : A R, efine on the conve set A R n is conve if f(α + ( α)) αf( ) + ( α)f() an A an all α [0, ]. Definition 8 A function is concave in a region if a secant line in any two points of the region is below f. Formally, the function f : A R, efine on the conve set A R n is concave if f(α + ( α)) αf( ) + ( α)f() an A an all αin[0, ]. Eample 8 boar eample To know if a function is conve, we o not nee to graph it or figure out the slope of all secant lines through any two of its points. We just check if the secon erivative is positive. Definition 9 A function is conve in a region if f () > 0 in that region. Definition 0 A function is concave in a region if f () < 0 in that region. Eample 9 f() = 2 f () = 2 f () = 2 > 0. So this function is conve everywhere. f() = 2 f () = 2 f () = 2 < 0. So this function is concave everywhere. 6
6 Graphing Using the first an secon erivatives we can sketch the graph of a function an ientify several important properties of the function. Steps to graph a function:. First fin the points at which f () = 0 or f is not efine. Such points are calle critical points of f. 2. Evaluate the function at each of these critical points an plot them in the graph. 3. Then, check the sign of f for each of the intervals efine by these critical points. 4. If f > 0 then raw the graph increasing over I, if f < 0 then raw the graph ecreasing over I. 5. Fin the points at which f () = 0 or f is not efine. Such points are calle secon orer critical points of f, or if the secon erivative actually changes sign there, inflection points of f. 6. Then, check the sign of f for each of the intervals efine by these critical points. 7. If f > 0 then raw the graph concave up (or conve) over I, if f < 0 then raw the graph concave own (or concave) over I. Eample 0 f() = 3 + 3 f 2 + 3 > 0 So the function is always increasing. f () = 6 So the function in concave for < 0 an conve for > 0. f(0) = 0, f (0) = 3 so slope 3 at the origin. Note: Draw in class. f() = (/3) 3 9 + 3 f () 9 = ( + 3)( 3) So increasing on (, 3) an (3, ) an ecreasing on ( 3, 3). Note: Draw in class. Many times we will be intereste in fining the first an secon orer critical points in orer to fin maima an minima of a function. However, before we move on to this we will now iscuss several aitional rule of ifferentiation that will frequently arise. 6. Asymptotes Vertical asymptotes occur at points where the function is not efine. For eample f() = is not efine at = 0. 7
7 Optimization We can use calculus to easily fin the minimums an maimums of a function. Definition Looking at the graph, we note that the maimum an minimums occur where the function changes from being increasing to being ecreasing an vice versa. Since the erivative is positive when f is increasing, an negative when f is ecreasing, these points of minimums or maimums occur when the erivative is equal to 0. The points where f = 0 are calle Critical Points. Eample Fin the critical points of f() = 2 6 3 4 + 2. f 5 2 3 = 2 3 ( 2 ) = 2 3 ( )(+). So the critical points are at = 0, =, =. All the (interior) maimums an minimums are foun at critical points. The secon erivative helps etermine if a critical point is a maimum, a minimum, or neither. If f ( 0 ) = 0 an f ( 0 ) < 0 then 0 is a maimum of f. If f ( 0 ) = 0 an f ( 0 ) > 0 then 0 is a minimum of f. If f ( 0 ) = 0 an f ( 0 ) = 0 then we o not know, it might be a ma, a min or neither (These are calle sale points). See eamples. Eample 2 f() = 2 6 3 4 + 2 f 5 2 3 critical points at = 0, =, =. f 4 36 2 f (0) = 0 f () = 24 f ( ) = 24 So local mins at = an =. Note: Make a table an to stuy the sign of f to make the graph of this function. Eample 3 f() = 3 f 2 Critical point at = 0 everywhere else positive so f increasing f () = 6 so f (0) = 0. Note: Draw graph. 7. Looking for Minimums an Maimums Steps:. Take erivative 2. Fin the such that the erivative function= 0 8
3. Evaluate the secon erivative at those critical points to etermine if at that there is a minimum or a maimum. Eample 4 ma 3 3 f 2 3 f () = 0 when = ± f () = 6, so f () = 6 > 0 an f ( ) = 6 < 0 So there is a local ma at = an a local min at =. Eample 5 f () = 2(+) 2 (+) 2 f () = 0 when = 0 an = 2 f () = (2+2)(+)2 2( 2 +2)(+) (+) 4 f (0) = 2 > 0 So there is a local min at = 0 f ( 2) = 2 < 0 So there is a local ma at = 2. ma 2 + Eample 6 Eample from Economics: Profit Maimizing [skippe] Let p enote the price the firm obtains for each of the units it prouces. Let c(q) enote the cost function of the firm. The cost function refers to the total cost of proucing q units. The erivative of the cost function is calle the Marginal Cost, it refers to the cost of proucing aitional unit when q nunits have been prouce. Let q enote the quantity prouce. This is the ecision variable of the firm. The problem of the firm can be enote as: ma pq c(q) q We solve it using calculus.we calculate the First Orer Conition for optimization, namely the q such that the first erivative equals 0. Then we obtain the secon erivative, evaluate it at q an check that it is negative, that way we know we are at a maimum. FOC: p = c (q) This is interprete as Marginal revenue (p) equals Marginal Cost. SOC: c (q) > 0 This is saying that we nee to have increasing marginal costs at q for this to be a maimum. This is the typical assumption of the perfect competition moel you will see in the fall. Note: Do the following numerical eample: Obtain the profit maimizing prouction when c(q) = q 2 + 5 an p=5. 9
8 Aitional Differentiation Rules: Chain Rule an Eponential 8. Eamples f() = 2 2 + f () = 2 2 f() = 6 5 3 3 4 2 + 7 f() = 2 2 ln() f() = (2 +8) f() = (e +) 3 2 f() = ( 2 + 8) 3 f() = 3ln(6 3 7) f() = g(3 2 7) f() = g()h() g(6) 8.2 Eponential an Log Derivatives We will frequently encounter logs (ln ) an eponentials (e ) in our stuies. Derivatives of these functions have special properties. 8.2. Derivatives of the natural log ln. ln = 2. ln k = k ln = k 3. ln u() = u () u() (by the chain rule) Lets prove property, as it is very important (S/B 94). Start with the stanar efinition, ln( + h) ln() h = h ln( + h ) = ln( + h ) h = ln( + Now we will use a common tactic to help simplify things, which is to efine a new variable as a more complicate function of something we alreay have. Let m = h. As h 0, m. Hence we have lim (ln( + m m )m ) = ln( lim ( + m m )m ) h ) h 0
We can interchange the limit an ln only because ln is a continuous function. I.e., if m o then ln m ln o. Furthermore, the efinition of e was e = lim m ( + m )m. Further, we ha the ientity e r = lim m ( + r m )m. Thus we let r =. We have Proposition 8. ln( lim ( + m m )m ) = ln e = f() = ln f () = Eample 7 ln( + ) Show lim = 0 8.2.2 Derivatives of the eponential function: e. αe = αe 2. eu() = e u() u () *graph eamples on the boar* *how coul we prove?* Eercise 3 Suppose f() = log a. Show f () = lna Eamples: Fin y/ for. y = ln(4) 2. y = ln(e 2 ) 3. y = ln(ln ) 4. y = ln 2 ln 4 e Proposition 8.2 For any positive base b, a = (ln a) (a ). Eample 8 f() = 0 Take natural log on both sie. ln(f()) = ln 0 Taking the erivative of both sies we have f () f() = ln 0 f () = f() ln 0 Proposition 8.3 f() = e f () = e
8.3 L Hospital s Rule ( ) In stuying limits, we saw that lim f()/g() = lim f() g() 0, which will cause the limit to be unboune. lim ( ) / lim g(), provie that If both lim f() = 0 an lim g() = 0, then we get an ineterminate form of the type 0/0 as c. However, we can still analyze such limits using L Hospital s rule. Theorem 8.4 L Hospital s Rule: Suppose f an g are ifferentiable on a < < b an that either. lim f() = 0 an lim g() = 0, or a + a + 2. lim f() = ± an lim g() = ± a + a + Suppose further that g () is never zero on a < < b an that f () lim a + g () = L then f() lim a + g() = L Eample 9 Use L Hospital s rule to fin the following limits: Suppose > 0. lim 0 r take erivative of top an bottom wrt to : We have from the power rule above that lim 0 r r = lim 0 r ln r = ln r lim 0 r = ln r 9 Derivatives of Trigonometric Functions (sin) = cos (cos) = sin (tan) = sec2 (csc) = csc cot (sec) = sec tan (cot) = csc2 2