Lab 2: Derivatives
📚 This lab will be published here at the end of week 2.
Key Ideas
The slope of a line is rise over run: how far the line moves up or down for each one unit step to the right. A slope of −1, as in \(f(x) = -x + 4\), means the line falls one unit every time \(x\) increases by one. A straight line has the same slope everywhere.
A curve is different, because its steepness changes as you move along it. The derivative \(f'(x)\) solves this by giving the slope at any one point: it is the slope of the tangent line, the straight line that just grazes the curve at that point. For \(f(x) = x^2\), the derivative is \(f'(x) = 2x\), so the slope is negative on the left, zero at the bottom, and positive on the right.
Four rules cover every function in this lab:
- Constant rule. A flat line never rises or falls: if \(f(x) = b\), then \(f'(x) = 0\).
- Power rule. Bring the exponent down front and subtract one from it: if \(f(x) = x^b\), then \(f'(x) = bx^{b-1}\).
- Coefficient rule. A coefficient carries through: if \(f(x) = 5x^2\), then \(f'(x) = 10x\).
- Sum rule. Differentiate term by term: if \(f(x) = x^2 + x\), then \(f'(x) = 2x + 1\).
Problem of the Day
Q10: Line Tangent to a Parabola
Take \(f(x) = ax^2 + bx + c\) and \(g(x) = dx + e\). Choose values for \(a\) through \(e\) from the digits 1 to 9, using each digit at most once, so that the graphs of \(f\) and \(g\) are tangent: they touch at exactly one point.
How many solutions can you find?
Source: “Line Tangent to a Parabola” by Erin Stenger at Open Middle.
Extension
Find the exact number of solutions.
Solutions
Setting \(f(x) = g(x)\) gives \(ax^2 + (b - d)x + (c - e) = 0\), and tangency requires the discriminant to vanish: \((b - d)^2 = 4a(c - e)\). The slope road gives \(2ax + b = d\) together with \(f(x) = g(x)\); substituting \(x = \frac{d - b}{2a}\) into the height equation reproduces the same condition. The touching point is \(x = \frac{d - b}{2a}\).
Since the left side is a perfect square, \(b - d\) must be even, and writing \(b - d = 2t\) reduces the condition to \(t^2 = a(c - e)\) with \(t \in \{\pm 1, \pm 2, \pm 3, \pm 4\}\). So \(a(c - e)\) must be 1, 4, 9, or 16, which rules out \(a = 5, 6, 7\) (no multiple of 5, 6, or 7 is one of those squares). The possible values of \(a\) are 1, 2, 3, 4, 8, and 9. A complete enumeration gives 154 solutions in total, distributed by leading coefficient as \(a = 1\): 64, \(a = 2\): 24, \(a = 3\): 12, \(a = 4\): 30, \(a = 8\): 8, \(a = 9\): 16.
Check Your Understanding
Derivatives
Differentiation Rules
Twenty more questions, five on each rule, so you can check each one on its own.
Partial Derivatives
So far every function has had one input. But most quantities in economics depend on several things at once: how much you enjoy a bundle depends on both goods in it, and a firm’s output depends on both labor and machines. A partial derivative handles this. For a function of two inputs like \(f(x, y)\), the partial derivative \(f_x\) measures how fast \(f\) changes when you nudge \(x\) alone, holding \(y\) perfectly still, and \(f_y\) does the reverse. That “one at a time” question is exactly what economists usually ask: what happens if just the price of coffee rises, or just one more worker is hired, with everything else unchanged?
Computing one requires nothing new. To find \(f_x\), treat \(y\) as if it were a constant number and use the ordinary rules from this lab. For example, take \(f(x, y) = x^2 + y^2\) and picture it as a landscape: \(x\) is steps east, \(y\) is steps north, and \(f\) is your elevation, so the function traces out a bowl. Treating \(y\) as a constant gives \(f_x = 2x\), and treating \(x\) as a constant gives \(f_y = 2y\). Standing at the point \((1, 0)\), we get \(f_x = 2\) and \(f_y = 0\): a small step east climbs the bowl at a rate of 2, while a small step north leaves your elevation unchanged, tracing a ring of constant height called a level curve.