Topic 6: Differentiation Jacques Text Book (edition 4 ): Chapter 4 1.Rules of Differentiation 2.Applications 1 Differentiation is all about measuring change! Measuring change in a linear function: y = a + bx a = intercept b = constant slope i.e. the impact of a unit change in x on the level of y b = y x = y2 y1 x2 x1 2 40 If the function is non-linear: e.g. if y = x2 y=x2 30 20 10 0 0 y x 1 = 2 y 2 y1 x2 x1 3 X 4 5 gives slope of the 6 line connecting 2 points (x1, y1) and (x2,y2) on a curve (2,4) to (4,16): slope = (16-4) /(4-2) = 6 (2,4) to (6,36): slope = (36-4)/(6-2) = 8 3 The slope of a curve is equal to the slope of the line (or tangent) that touches the curve at that point Total Cost Curve 40 35 30 y=x2 25 20 15 10 5 0 1 2 3 4 5 6 7 X 4 Example:A firms cost function is Y = X2 X 0 1 2 3 4 2 X Y Y +1 +1 +1 +1 0 1 4 9 16 +1 +3 +5 +7 Y=X Y+Y = (X+X) 2 Y+Y =X2+2X.X+X2 Y = X2+2X.X+X2 – Y since Y = X2 Y = 2X.X+X2 Y X = 2X+X The slope depends on X and X 5 The slope of the graph of a function is called the derivative of the function dy y f ' ( x) lim dx x0 x • The process of differentiation involves letting the change in x become arbitrarily small, i.e. letting x 0 • e.g if = 2X+X and X 0 • = 2X in the limit as X 0 6 the slope of the non-linear function Y = X2 is 2X • the slope tells us the change in y that results from a very small change in X • We see the slope varies with X e.g. the curve at X = 2 has a slope = 4 and the curve at X = 4 has a slope = 8 • In this example, the slope is steeper at higher values of X 7 Rules for Differentiation (section 4.3) 1. The Constant Rule If y = c where c is a constant, dy 0 dx e.g. y = 10 dy then dx 0 8 2. The Linear Function Rule If y = a + bx dy b dx dy 6 e.g. y = 10 + 6x then dx 9 3. The Power Function Rule If y = axn, where a and n are constants dy n.a.x n1 dx dy 0 4 x 4 i) y = 4x => dx ii) y = 4x 2 dy => dx 8 x dy 3 8 x iii) y = 4x => dx -2 10 4. The Sum-Difference Rule If y = f(x) g(x) dy d [ f ( x )] d [ g( x )] dx dx dx If y is the sum/difference of two or more functions of x: differentiate the 2 (or more) separately, then add/subtract (i) y = 2x2 + 3x then terms dy 4x 3 dx dy (ii) y = 5x + 4 then dx 5 11 5. The Product Rule If y = u.v where u and v are functions of x, (u = f(x) and v = g(x) ) Then dy dv du u v dx dx dx 12 Examples dy dv du u v dx dx dx If y = u.v 2 i) y = (x+2)(ax +bx) dy x 2 2 ax b ax 2 bx dx ii) y = (4x3-3x+2)(2x2+4x) dy 4x3 3x 2 4x 4 2x2 4x 12x2 3 dx 13 6. The Quotient Rule • If y = u/v where u and v are functions of x (u = f(x) and v = g(x) ) Then du dv v u dy dx dx 2 dx v 14 u If y v then dy dx v du dv u dx dx v2 Example 1 x 2 y x 4 dy x 4 1 x 2 1 2 2 2 dx x 4 x 4 15 7. The Chain Rule (Implicit Function Rule) • If y is a function of v, and v is a function of x, then y is a function of x and dy dy dv . dx dv dx 16 Examples i) 2 y = (ax + bx) dy dy dv . dx dv dx ½ let v = (ax2 + bx) , so y = v½ 1 dy 1 2 ax bx 2 .2ax b dx 2 ii) y = (4x + 3x – 7 ) 3 4 let v = (4x + 3x – 7 ), so y = v 3 4 3 dy 3 2 4 4 x 3x 7 . 12 x 3 dx 17 8. The Inverse Function Rule dy 1 If x = f(y) then dx dx dy • Examples i) x = 3y2 then dx 6y dy ii) dy 1 so dx 6 y y = 4x3 then dy 12x 2 dx dx 1 so dy 12 x 2 18 Differentiation in Economics Application I • • • • • Total Costs = TC = FC + VC Total Revenue = TR = P * Q = Profit = TR – TC Break even: = 0, or TR = TC Profit Maximisation: MR = MC 19 Application I: Marginal Functions (Revenue, Costs and Profit) • Calculating Marginal Functions d TR MR dQ d TC MC dQ 20 Example 1 • A firm faces the demand curve P=173Q • (i) Find an expression for TR in terms of Q • (ii) Find an expression for MR in terms of Q Solution: TR = P.Q = 17Q – 3Q2 d TR MR 17 6Q dQ 21 Example 2 A firms total cost curve is given by TC=Q3- 4Q2+12Q (i) Find an expression for AC in terms of Q (ii) Find an expression for MC in terms of Q (iii) When does AC=MC? (iv) When does the slope of AC=0? (v) Plot MC and AC curves and comment on the economic significance of their relationship 22 Solution (i) TC = Q3 – 4Q2 + 12Q TC 2 Then, AC = / Q = Q – 4Q + 12 d TC 2 (ii) MC = dQ 3Q 8Q 12 (iii) When does AC = MC? Q2 – 4Q + 12 = 3Q2 – 8Q + 12 Q =2 Thus, AC = MC when Q = 2 23 Solution continued…. (iv) When does the slope of AC = 0? d AC 2Q 4 = 0 dQ Q = 2 when slope AC = 0 (v) Economic Significance? MC cuts AC curve at minimum point… 24 9. Differentiating Exponential Functions If y = exp(x) = e x where e = 2.71828…. dy x then dx e More generally, rx If y = Ae dy rx then dx rAe ry 25 Examples 1) y = e 2x -7x 2) y = e dy 2x then dx = 2e dy -7x then dx = -7e 26 10. Differentiating Natural Logs Recall if y = ex then x = loge y = ln y If y = e x then dy ex dx = y From The Inverse Function Rule dx 1 y = e dy y x Now, if y = ex this is equivalent to writing x = ln y Thus, x = ln y dx 1 dy y 27 More generally, dy 1 if y = ln x dx x NOTE: the derivative of a natural log function does not depend on the co-efficient of x Thus, if y = ln mx dy 1 dx x 28 Proof if y = ln mx m>0 Rules of Logs y = ln m+ ln x Differentiating (Sum-Difference rule) dy 1 1 0 dx x x 29 Examples 1) y = ln 5x (x>0) dy 1 dx x 2 2) y = ln(x +2x+1) 2 let v = (x +2x+1) so y = ln v dy dy dv Chain Rule: dx dv . dx dy 1 2 .2 x 2 dx x 2 x 1 dy 2 x 2 2 dx x 2x 1 30 3) y = x4lnx Product Rule: dy 4 1 x ln x.4 x3 dx x 3 3 3 1 4 ln x x x 4 x ln x = = 4) y = ln(x3(x+2)4) Simplify first using rules of logs y = lnx3 + ln(x+2)4 y = 3lnx + 4ln(x+2) dy 3 4 dx x x 2 31 Applications II • how does demand change with a change in price…… proportional change in demand proportional change in price • e d= = Q Q P P Q P = P . Q 32 Point elasticity of demand dQ P . ed = dP Q ed is negative for a downward sloping demand curve –Inelastic demand if | ed |<1 –Unit elastic demand if | ed |=1 –Elastic demand if | ed |>1 33 Example 1 Find ed of the function Q= aP ed = ed = -b dQ P . dP Q baP b 1 P . b aP baP b P = P . aP b b ed at all price levels is –b 34 Example 2 If the (inverse) Demand equation is P = 200 – 40ln(Q+1) Calculate the price elasticity of demand when Q = 20 Price elasticity of demand: ed = dQ P . dP Q <0 P is expressed in terms of Q, dP 40 dQ Q 1 Inverse rule Hence, ed = Q is 20 ed dQ Q 1 dP 40 Q 1 P . 40 Q <0 21 78.22 = 40 . 20 = -2.05 (where P = 200 – 40ln(20+1) = 78.22) 35 Application III: Differentiation of Natural Logs to find Proportional Changes f’(x) The derivative of log(f(x)) /f(x), or the proportional change in the variable x i.e. y = f(x), then the proportional x dy 1 = dx . y d (ln y ) = dx Take logs and differentiate to proportional changes in variables find 36 dy 1 1) Show that if y = x , then dx . y x and this derivative of ln(y) with respect to x. Solution: dy 1 1 . .x 1 dx y y 1 x = y . x 1 y = y . . x = x 37 Solution Continued… Now ln y = ln x Re-writing ln y = lnx d (ln y ) 1 . dx x x Differentiating the ln y with respect to x gives the proportional change in x. 38 Example 2: If Price level at time t is P(t) = a+bt+ct2 Calculate the rate of inflation. Solution: Alternatively, The inflation rate at t is the proportional differentiating the log of P(t) wrt t directly change in p 2 1 dP( t ) b 2ct . P( t ) dt a bt ct 2 lnP(t) = ln(a+bt+ct ) where v = (a+bt+ct2) so lnP = ln v Using chain rule, d ln P( t ) b 2ct dt a bt ct 2 39