The derivative as a function¶
Change and motion · level 7, lesson 5 of 6
A question to start¶
Here are three graphs, drawn on the same scale. One of them is a function \(f\). Another is its derivative \(f'\). The third is the derivative of the derivative. There are no formulas, only pictures.
Which is which? You do not need any algebra; you need to read slopes off a picture. By the end of the lesson it will take you about ten seconds. (The answer is worked example 4.)
The idea¶
A new function made from the old one¶
So far we have mostly found the derivative at one point, a single number \(f'(a)\). But for \(x^2\) we found \(2x\), which gives the slope at every point at once. That is a function in its own right:
- input: a number \(x\);
- output: the slope of the graph of \(f\) at \(x\).
This function is called the derivative of \(f\), written \(f'\), or \(\frac{dy}{dx}\) if \(y = f(x)\). It is defined at every \(x\) where \(f\) is differentiable, and nowhere else. For \(f(x) = |x|\), for instance, \(f'\) is not defined at 0 (the corner).
The derivative is a new graph, and the main skill of this lesson is to draw the graph of \(f'\) by looking at the graph of \(f\), without any formula.
Three things a graph tells you about its slope¶
- The sign. Where \(f\) is going up (left to right), its slope is positive, so \(f'\) is above the \(x\)-axis. Where \(f\) is going down, \(f'\) is below the axis.
- The zeros. Where the tangent to \(f\) is flat (at the top of a hill, the bottom of a valley, or a level shelf), \(f'\) is zero: \(f'\) crosses or touches the \(x\)-axis there.
- The size. Where \(f\) is steep, \(f'\) is far from the axis. Where \(f\) is nearly flat, \(f'\) is near 0.
Sketching \(f'\) from \(f\), step by step¶
Take the graph of \(f(x) = x^3 - 3x\) (top panel). Line the \(f'\) panel up underneath it, with the same \(x\)-scale.
- Flat points. \(f\) has a hilltop at \(x = -1\) and a valley at \(x = 1\). Mark \(f' = 0\) at both (the dashed lines carry them down).
- Signs. Left of \(-1\), \(f\) climbs, so \(f' > 0\). Between \(-1\) and \(1\), \(f\) falls, so \(f' < 0\). Right of 1, \(f\) climbs again, so \(f' > 0\).
- Steepness. Between the hill and the valley, \(f\) is steepest going down at \(x = 0\): so \(f'\) is most negative at
- Far out to the left and right, \(f\) gets steeper and steeper: so \(f'\) gets bigger and bigger.
- Join smoothly. Positive and large, down through 0 at \(-1\), lowest at 0, back up through 0 at 1, then large again: a U-shape. That is the bottom panel.
Check with the power rule: \(f'(x) = 3x^2 - 3\). That is a U-shaped parabola, 0 at \(x = \pm 1\) and lowest at \(x = 0\), where \(f'(0) = -3\). And indeed \(f(x) = x^3 - 3x\) falls with slope \(-3\) as it passes through the origin.
Patterns worth knowing¶
- A straight line has a constant slope, so its derivative is a horizontal line.
- A parabola has a derivative that is a straight line (\(x^2 \to 2x\)). A cubic has a parabola as its derivative. Differentiating a polynomial lowers its degree by one.
- A graph made of straight pieces has a derivative made of flat steps, with gaps at the corners.
- A corner in \(f\) makes a jump in \(f'\).
- Adding a constant to \(f\) (sliding the graph up or down) does not change any slope. So \(x^2\), \(x^2 + 5\) and \(x^2 - 7\) all have derivative \(2x\).
That last point has a big consequence. If you know \(f'\), you know \(f\) only up to a vertical slide. To pin \(f\) down you need one extra fact, such as its value at one point. This "going backwards" is the start of integration (level 8).
Going backwards: from \(f'\) to \(f\)¶
Reading the other way works too. If you are given the graph of \(f'\):
- where \(f'\) is above the axis, \(f\) is going up;
- where \(f'\) crosses from + to −, \(f\) goes from up to down: a hilltop (a local maximum);
- where \(f'\) crosses from − to +, \(f\) has a valley (a local minimum);
- where \(f'\) touches 0 without changing sign, \(f\) flattens for a moment but keeps going the same way, like \(x^3\) at 0.
This is the first derivative test. You will use it for real in level 8.
The derivative of the derivative¶
Since \(f'\) is a function, it has its own derivative, the second derivative, written \(f''\) or \(\frac{d^2y}{dx^2}\). It is the rate of change of the slope. For \(f(x) = x^3 - 3x\): \(f'(x) = 3x^2 - 3\) and \(f''(x) = 6x\). Where \(f'' > 0\) the slope is increasing and the graph bends upwards like a cup; where \(f'' < 0\) it bends down like a cap. In motion, if \(f\) is position, then \(f'\) is velocity and \(f''\) is acceleration: the subject of the next lesson.
Worked examples¶
1. A formula check. For \(f(x) = x^2 - 4x + 3\), describe \(f'\) from the graph, then check with the rule.
- \(f\) is a U-shaped parabola. Its lowest point is halfway between its roots 1 and 3, at \(x = 2\).
- So \(f' < 0\) for \(x < 2\), \(f'(2) = 0\), and \(f' > 0\) for \(x > 2\). The steepness grows steadily as you move away from 2, so \(f'\) is a straight line through \((2, 0)\) going up.
- Check: \(f'(x) = 2x - 4\), a line of slope 2 through \((2, 0)\). ✓
2. A walk with straight pieces. Sam walks 800 m to a shop in 10 minutes at a steady pace, spends 5 minutes inside, then walks home in 10 minutes at the same pace. Sketch the graph of his distance from home, \(s(t)\), and its derivative.
- From 0 to 10 min, \(s\) rises in a straight line from 0 to 800: slope \(\frac{800}{10} = 80\) m/min.
- From 10 to 15 min, \(s\) is flat: slope 0.
- From 15 to 25 min, \(s\) falls from 800 to 0: slope \(-80\) m/min.
- So \(s'\) is a set of steps: 80, then 0, then \(-80\). The negative value means he is heading back towards home. At \(t = 10\) and \(t = 15\) the graph of \(s\) has corners, so \(s'\) has no value there. (A real person does not stop instantly; the corners are where our simple model is rough.)
3. From \(f'\) to \(f\). The derivative of some function is \(f'(x) = (x + 1)(x - 2)\). Describe the graph of \(f\).
- \(f' = 0\) at \(x = -1\) and \(x = 2\).
- Signs: for \(x < -1\) both brackets are negative, so \(f' > 0\). For \(-1 < x < 2\), one bracket is positive and one negative, so \(f' < 0\). For \(x > 2\), \(f' > 0\).
- So \(f\) rises, has a hilltop at \(x = -1\) (+ to −), falls, has a valley at \(x = 2\) (− to +), then rises. A cubic shape, like the top panel above. We cannot say how high it sits without more information.
4. The opening puzzle. Look for flat points and match them with zeros.
- Graph B is a straight line, crossing 0 at \(x = 0\). Graph A is a hill shape whose top, its only flat point, is at \(x = 0\). A is going up for \(x < 0\) (where B is positive) and down for \(x > 0\) (where B is negative). So B is the derivative of A.
- Graph A crosses 0 at \(x = -2\) and \(x = 2\). Graph C has a valley at \(x = -2\) and a hilltop at \(x = 2\). C goes down where A is negative and up where A is positive. So A is the derivative of C.
- So C is \(f\), A is \(f'\) and B is \(f''\). (They were \(f(x) = 4x - \frac{x^3}{3}\), \(f'(x) = 4 - x^2\) and \(f''(x) = -2x\).)
Try it¶
- For \(f(x) = x^2 - 4x\), find \(f'(x)\). For which \(x\) is \(f\) increasing?
- The graph of \(f\) is a straight line with slope \(-3\). Describe the graph of \(f'\).
- A function \(f\) rises until \(x = 1\), falls until \(x = 4\), then rises again, with flat tangents at 1 and 4. Sketch a possible graph of \(f'\).
- The derivative of \(f\) is \(f'(x) = (x - 1)(x - 3)\). Where is \(f\) increasing, where decreasing, and where are its hilltop and valley?
- Sketch \(f(x) = |x|\) and its derivative. Where is \(f'\) undefined?
- True or false: if \(f'(x) > 0\) for every \(x\), then \(f(x) > 0\) for every \(x\).
- Give two different functions whose derivative is \(2x\). How are their graphs related?
- A toy car's position on a track is \(s(t) = t^3 - 6t^2 + 9t\) metres at time \(t\) seconds. Find \(s'(t)\), and say when the car moves forwards and when it moves backwards.
Answers
- \(f'(x) = 2x - 4\). \(f\) is increasing where \(f' > 0\), that is for \(x > 2\).
- A horizontal line at height \(-3\): the slope is \(-3\) everywhere.
- \(f'\) is positive for \(x < 1\), crosses 0 at \(x = 1\), is negative between 1 and 4 (dipping lowest somewhere in between, where \(f\) is steepest going down), crosses 0 at 4, and is positive after. A U-shape that dips below the axis between 1 and 4 will do, like the parabola \((x - 1)(x - 4)\).
- \(f' > 0\) when both brackets have the same sign: \(x < 1\) or \(x > 3\). There \(f\) is increasing. \(f' < 0\) for \(1 < x < 3\): decreasing. Hilltop (+ to −) at \(x = 1\); valley (− to +) at \(x = 3\).
- A V-shape. \(f'(x) = -1\) for \(x < 0\) and \(f'(x) = 1\) for \(x > 0\): two flat steps. \(f'\) is undefined at 0, the corner.
- False. \(f(x) = x\) has \(f'(x) = 1 > 0\) everywhere, but \(f(-5) = -5 < 0\). A positive derivative says the function is going up, not that it is above the axis.
- For example \(x^2\) and \(x^2 + 5\) (any \(x^2 + C\) works). Their graphs are the same parabola, one slid 5 units above the other; at every \(x\) they have the same slope.
- \(s'(t) = 3t^2 - 12t + 9 = 3(t^2 - 4t + 3) = 3(t - 1)(t - 3)\). Forwards (\(s' > 0\)) for \(0 \le t < 1\) and \(t > 3\); backwards (\(s' < 0\)) for \(1 < t < 3\). It stops for an instant at \(t = 1\) and \(t = 3\) to turn round.
Common mistake¶
Copying the shape of \(f\) instead of its slope. Where \(f\) is high, \(f'\) is not necessarily high. At the top of a hill, \(f\) is at its highest but \(f'\) is zero. Always ask "is it going up or down here, and how steeply?", never "is it high or low?".
Thinking \(f' = 0\) always means a hilltop or valley. \(x^3\) has \(f'(0) = 0\), but it carries on upwards: a flat moment, not a turning point. Check whether \(f'\) changes sign.
Where it leads¶
- Back: The power rule · Next: Velocity and acceleration
- Level 7 page · Change and motion topic page
- The first derivative test and full curve sketching: level 8, curve sketching.
- Functions as input-output machines: Algebra: functions.
- Distance-time and speed-time graphs, the first version of this idea: level 4 and level 5.
- On the U of T shelf: MAT137 Unit 3: derivatives.