Unit 7 Calculus Course notes Outcome aim (A1, A2, A3, A4 B1, B2, B3 C1, C2, C3, C4) A4 Second derivatives and turning points Substitution of numerical values into the expression for the second derivative to find the turning points for a function Page 1 of 19 Now that we can find the first derivative (first differential coefficient) of a given function, we need to find the second derivative. Finding the second derivative of a polynomial function: y=axn If y=axn then dy/dx = naxn-1 and d2y/dx2 = (n-1)naxn-2 Example 1 y = 3x4 – 2x2 + 5x - 2 The first derivative is, dy/dx = (4)3x4-1 – (2)2x2-1 + (1)5x1-1 – 0 (since there is no gradient for constant) dy/dx = 12x3 – 4x1 + 5x0 dy/dx = 12x3 – 4x1 + 5 (since x0 = 1) So, dy/dx = 12x3 – 4x + 5 d2y/dx2 = (3)12x3-1 – (1)4x1-1 + 0 d2y/dx2 = 36x2 – 4x0 d2y/dx2 = 36x2 – 4 This is the second derivative Page 2 of 19 Finding the second derivative of a trigonometric function: y = a.Sin(bx) Example 2 Find the second derivative of y = 3.Sin(4x) dy/dx = (4)3Cos(4x) dy/dx = 12 Cos(4x) And then, d2y/dx2 = (4)12 [-Sin(4x)] d2y/dx2 = 48 [-Sin(4x)] d2y/dx2 = -48.Sin(4x) Page 3 of 19 Maxima and Minima When a function is plotted on a graph there are some important points to note, Positive gradient Negative gradient Maximum turning point Minimum turning point, Point of inflexion (see graph below), Worked example 3 Given the cubic function: y = f(x) = x3 - 3x + 5 we can find, The gradient at any point along the curve The x-position for a maximum point The x-position for a minimum point The y-value at a maximum point The y-value at a minimum point Page 4 of 19 Calculating the gradient of the curve – worked example, We will take the cubic curve y = x3 - 3x + 5 and find the two turning points near to the origin. y = x3 - 3x + 5 To find the rate of change for y = x3 - 3x + 5 we need to differentiate it. So, differentiating gives, We see from the graph above that at maximum point (maxima) and minimum point (minima), the gradient (dy/dx) is zero (ie the curve is flat and horizontal). So, we equate dy/dx to 0 and solve the resulting quadratic equation, When x=1, y = x3 - 3x + 5 When x=-1, y = x3 - 3x + 5 = = (1)3 – 3(1) + 5 = 1 - 3 + 5 = 3 (-1)3 – 3(-1) + 5 = -1 + 3 + 5 = 7 So, the turning points are at coordinates (1,3) and (-1,7) We now need to decide whether (1,3) is a maxima or a minima and whether (-1,7) is a maxima or a minima We can find which is which by taking x values either-side of 1 and -1, and determine if the curve is going positive-to-negative or from negative-to-positive. Taking the point (1,3) and calculating the gradient either-side of 1 gives, Page 5 of 19 Slightly less positive than 1, say (0.9) we get, ie negative value, Slightly more positive than 1, say (1.1) we get, ie positive value Using these two gradient values we see that as x goes from 0.9 to 1.1 the gradient goes from negative to positive, hence the point is a minimum. So, (1,3) is a minimum turning point. Now, taking the other coordinate (-1,7) we proceed in a similar way, Calculating the gradient either-side of -1 gives, Slightly more negative than -1, say (-1.1) we get, ie positive Page 6 of 19 Slightly less negative than -1, say (-0.9) we get, ie negative Using these two gradient values we see that as x goes from -1.1 to -0.9 the gradient goes from positive to negative, hence the point is a maximum. So, (-1,7) is a maximum turning point. Maxima (-1,7) Minima (1,3) Cubic function y = f(x) = x3 – 3x + 5 Using the second derivative to find maxima and minima We can determine the positions of maxima and minima using a quicker method. If we calculate the second derivative using our first coordinates and see whether the result is positive (which means the turning point is a minimum) or whether the result is negative (which means the turning point is a maximum). A simple mnemonic for future use, Positive minimum Negative maximum (see appendix for proof) Page 7 of 19 So, y= x3 - 3x + 5 When x=1, ie positive, hence a minima So, the y value for this minima is, y = x3 - 3x + 5 y = (1)3 – 3(1) + 5 y=1-3+5 y = -2 + 5 y=3 When x=-1 ie negative, hence a maxima Page 8 of 19 So, the y value for this maxima is, y = x3 - 3x + 5 y = (-1)3 – 3(-1) + 5 y = -1 + 3 + 5 y = -1 + 8 y=7 More examples of graphical representations of algebraic functions with two turning points f(x) = -x3 + 3x + 2 25 20 15 10 5 f(x) = -x3 + 3x + 2 0 -3 -2,5 -2 -1,5 -1 -0,5 0 0,5 1 1,5 2 2,5 3 -5 -10 -15 -20 Graph of f(x) = -x3 + 3x + 2 Page 9 of 19 f(x) = -x3 + 3x2 + 2x + 4 60 50 40 30 f(x) = -x3 + 3x2 + 2x + 4 20 10 -3 -2,5 -2 -1,5 -1 -0,5 0 0,5 1 1,5 2 2,5 3 3,5 4 0 -10 Graph of f(x) = -x3 + 3x2 + 2x + 4 f(x) = x3 - 5x2 + 2x + 6 40 20 0 -6 -5 -4 -3 -2 -1 0 1 2 3 4 -20 -40 -60 f(x) = x^3 - 5x^2 + 2x + 6 -80 -100 -120 -140 Graph of f(x) = x3 - 5x2 + 2x + 6 http://www.analyzemath.com/Graphing/graphing_cubic_function.html Page 10 of 19 Practical application You have 100m of fencing to erect against an existing straight-sided building to create a rectangular enclose and to cover the maximum ground area. Length equation, 100 = x + 2y Area equation, A = xy Now the extremes are, A long x dimension and a very short y dimension, such as, Or, A long y dimension and a very short x dimension, such as, Page 11 of 19 Somewhere between these limits will be the x and y dimensions to give the maximum area. What about this design? Length of fence = 39m + 22m + 39m = 100m, So the area enclosed is, A = xy A = (22)(39) A = 858m2 Is there a different combination of x and y that gives a larger area? We can use a graph or Calculus to help us here… We firstly convert the area equation to a function of one variable (say y), Transposing the length equation (100 = x + 2y) to make x the subject gives, x = 100 – 2y Substituting this into the area equation (A=xy) gives, A = (100 – 2y)y Page 12 of 19 Multiplying the y through the bracket gives, A = 100y – 2y2 If we assume the fence panels come in 0.5m and 1m lengths then the limits are, y can be as small as 0.5m then, x = 99m (giving 0.5+99+0.5 = 100) Or, y can be as large as 49.5m then, x = 1 (giving 49.5 + 1 + 49.5 = 100) So plotting the area up to a y-value of 50m gives:Graphical method, The graph shows that the area is a maximum when y = 25m So the side length (x) is, x = 100 – 2(25) x= 100 – 50 x = 50m And the enclosed area is, A = xy A = (50)(25) A = 1250m2 (as shown on the graph) Page 13 of 19 Calculus method Using A = 100y – 2y2 again, We need to find the rate of change of ‘Area to side length y’ So, we need to find, Now, from the graph, we see that the maximum area is at the top of the curve (a maxima turning point). Here, the rate of change of ‘A with respect to y’ is zero and solve for y. Now we can find the side length (x) So the side length (x) is, x = 100 – 2y x = 100 – 2(25) x= 100 – 50 x = 50m And the enclosed area is, A = xy A = (50)(25) A = 1250m2 Page 14 of 19 The daily profit, P, of a milk-bottle delivery service is given by P = 12x − 0.04x2, Where: x is the number of milk-bottles delivered How many milk-bottles will give maximum profit and what is the maximum profit? The profit is a maximum (or a minimum) when dP/dx = 0 So, dP/dx = (1)12x1-1 – (2)0.04x2-1 dP/dx = 12x0 – 0.08x1 dP/dx = 12 – 0.08x Now equate to zero, 0 = 12 – 0.08x 0.08x = 12 x = 12/0.08 x = 150 Is this value a maxima or a minima? We use the second derivative to help us, d2P = -0.08 which is negative, dx2 Hence, the gradient equation dP/dx = 12 – 0.08x will give the maximum value when it is equated to zero So we know that x=150 gives a maxima Using x=150 gives the maximum profit (P) The value of the profit can be found by putting x=150 in the profit equation. P = 12x − 0.04x2 P = 12(150) − 0.04(150)2 Page 15 of 19 P = 1800 − 0.04(22500) P = 1800 − 900 P = 900 So, delivering 150 milk-bottles a day gives the maximum profit of £900 Milk bottles (x) vs Profit(y£) 1000 900 800 700 600 500 400 300 200 100 0 Milk bottles (x) vs Profit(y£) 0 50 100 150 200 250 300 Graph of number of milk-bottles delivered (x) vs Daily profit (£) Using the second derivative to find a point of inflection Inflection points are where the function changes concavity. Since concave up corresponds to a positive second derivative and concave down corresponds to a negative second derivative, then when the function changes from concave up to concave down (or vise versa) the second derivative must equal zero at that point. So the second derivative must equal zero to be an inflection point. Page 16 of 19 f’’(x) = 0 at an inflection point Using the cubic function y = f(x) = x3 – 3x + 5 again gives, f’(x) = 3x2 – 3 And f’’(x) = 6x So, we set 6x = 0 to find the point of inflection, 6x = 0 x = 0/6 x=0 Point of inflection is at x=0 Reference: http://clas.sa.ucsb.edu/staff/lee/Max%20and%20Min's.htm http://clas.sa.ucsb.edu/staff/lee/Inflection%20Points.htm Page 17 of 19 Appendix Graphs of f(x) and f’(x) and f’’(x) 1. y = x3 - 3x + 2 f(x) = x3-3x+2 5 4 3 f(x) = x^3-3x+2 2 1 2 1,8 1,6 1,4 1,2 1 0,8 0,6 0,4 0,2 0 -0,2 -0,4 -0,6 -0,8 -1 -1,2 -1,4 -1,6 -1,8 -2 0 f'(x) = 3x2-3 10 8 6 4 f'(x) = 3x^2-3 2 2 1,8 1,6 1,4 1,2 1 0,8 0,6 0,4 0,2 0 -0,2 -0,4 -0,6 -0,8 -1 -1,2 -1,4 -1,6 -1,8 -2 -2 0 -4 f''(x) = 6x 15 10 5 2 1,8 1,6 1,4 1,2 1 0,8 0,6 0,4 0,2 0 -0,2 -0,4 -0,6 -0,8 -1 -1,2 -1,4 -1,6 -5 -1,8 f''(x) = 6x -2 0 -10 -15 Note: When f(x) is maximum, f’(x) = 0 and f’’(x) is negative When f(x) is minimum, f’(x) = 0 and f’’(x) is positive Page 18 of 19 2. f(x) = x4 – 8x2 f(x) = x4 - 8x2 15,0 10,0 5,0 0,0 -5,0 -3,0 -2,5 -2,0 -1,5 -1,0 -0,5 0,0 0,5 1,0 1,5 2,0 2,5 3,0 x^4 - 8x^2 -10,0 -15,0 -20,0 f'(x) = 4x3-16x 80,0 60,0 40,0 20,0 0,0 4x^3-16x -20,0 -3,0 -2,5 -2,0 -1,5 -1,0 -0,5 0,0 0,5 1,0 1,5 2,0 2,5 3,0 -40,0 -60,0 -80,0 f''(x) = 12x2-16 100,0 80,0 60,0 40,0 12x^2-16 20,0 0,0 -20,0 -3,0 -2,5 -2,0 -1,5 -1,0 -0,5 0,0 0,5 1,0 1,5 2,0 2,5 3,0 -40,0 Note: When f(x) is maximum, f’(x) = 0 and f’’(x) is negative When f(x) is minimum, f’(x) = 0 and f’’(x) is positive Reference: https://www.cliffsnotes.com/study-guides/calculus/calculus/applications-of-the-derivative/secondderivative-test-for-local-extrema ------- End ------Page 19 of 19