Rules that build derivatives
The derivative measures how fast a function changes: f′(x)=limh→0hf(x+h)−f(x). You rarely compute that limit by hand. Instead you combine a few known derivatives ((xn)′=nxn−1, (ex)′=ex, (lnx)′=x1, (sinx)′=cosx) with rules for sums, products, quotients and compositions.
(uv)′=u′v+uv′(1) dxdf(g(x))=f′(g(x))g′(x)(2) The product rule applies when two changing quantities multiply. The value of a position is price times quantity, V=P⋅N; if both move, dtdV=P′N+PN′: one part from the price changing, one from the quantity changing.
The chain rule applies when one function sits inside another: change flows from the inside out. A discount factor D(r)=e−rT depends on the rate r through the exponent, so drdD=e−rT⋅(−T)=−Te−rT: each unit increase in the rate cuts the factor by T times its value.
- Sum rule: (u+v)′=u′+v′.
- Product rule: (uv)′=u′v+uv′.
- Quotient rule: (vu)′=v2u′v−uv′.
- Chain rule: differentiate the outside, then multiply by the derivative of the inside.
Two derivatives by the rulesFor
f(x)=x2ex take
u=x2 and
v=ex:
f′(x)=2xex+x2ex. For
g(x)=ln(x2+1) the outside is
ln and the inside is
x2+1:
g′(x)=x2+11⋅2x=x2+12x.
Check a derivative numericallyCompare your formula with the central difference 2hf(x+h)−f(x−h) at a few points, with h about 10−5. If they disagree in the first digits, there is an algebra slip. You will code this check in the Python derivatives topic. Lab · what's graded
- Product rule20 pts
- Chain rule with a logarithm20 pts
- Chain rule with a sine15 pts
- Rules and formulas15 pts
- A derivative at a point15 pts
- A chain-rule derivation15 pts