σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Calculus skill›Module 1 · Limits and derivatives›Topic 1.3·~40 minBeginner

Chain rule and product rule

Skill positionModule 1 of 4 · Topic 3 of 3
1.3 Chain rule and product rule
—Lab score— / 100Total XP—Streak—

Rules that build derivatives

The derivative measures how fast a function changes: f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}f′(x)=limh→0​hf(x+h)−f(x)​. You rarely compute that limit by hand. Instead you combine a few known derivatives ((xn)′=nxn−1(x^n)'=nx^{n-1}(xn)′=nxn−1, (ex)′=ex(e^x)'=e^x(ex)′=ex, (ln⁡x)′=1x(\ln x)'=\frac{1}{x}(lnx)′=x1​, (sin⁡x)′=cos⁡x(\sin x)'=\cos x(sinx)′=cosx) with rules for sums, products, quotients and compositions.

(uv)′=u′v+uv′(uv)' = u'v + uv'(uv)′=u′v+uv′(1)
ddxf(g(x))=f′(g(x)) g′(x)\frac{d}{dx}f(g(x)) = f'(g(x))\,g'(x)dxd​f(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⋅NV=P\cdot NV=P⋅N; if both move, dVdt=P′N+PN′\frac{dV}{dt}=P'N+PN'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−rTD(r)=e^{-rT}D(r)=e−rT depends on the rate rrr through the exponent, so dDdr=e−rT⋅(−T)=−T e−rT\frac{dD}{dr}=e^{-rT}\cdot(-T)=-T\,e^{-rT}drdD​=e−rT⋅(−T)=−Te−rT: each unit increase in the rate cuts the factor by TTT times its value.

  • Sum rule: (u+v)′=u′+v′(u+v)'=u'+v'(u+v)′=u′+v′.
  • Product rule: (uv)′=u′v+uv′(uv)'=u'v+uv'(uv)′=u′v+uv′.
  • Quotient rule: (uv)′=u′v−uv′v2\left(\frac{u}{v}\right)'=\frac{u'v-uv'}{v^2}(vu​)′=v2u′v−uv′​.
  • Chain rule: differentiate the outside, then multiply by the derivative of the inside.
Two derivatives by the rulesFor f(x)=x2exf(x)=x^2e^xf(x)=x2ex take u=x2u=x^2u=x2 and v=exv=e^xv=ex: f′(x)=2x ex+x2exf'(x)=2x\,e^x+x^2e^xf′(x)=2xex+x2ex. For g(x)=ln⁡(x2+1)g(x)=\ln(x^2+1)g(x)=ln(x2+1) the outside is ln⁡\lnln and the inside is x2+1x^2+1x2+1: g′(x)=1x2+1⋅2x=2xx2+1g'(x)=\frac{1}{x^2+1}\cdot 2x=\frac{2x}{x^2+1}g′(x)=x2+11​⋅2x=x2+12x​.
Check a derivative numericallyCompare your formula with the central difference f(x+h)−f(x−h)2h\frac{f(x+h)-f(x-h)}{2h}2hf(x+h)−f(x−h)​ at a few points, with hhh about 10−510^{-5}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
0/ 6 answered
Tasks
1Expression20 ptsNot answered

Type the derivative of f(x)=x2exf(x)=x^2e^xf(x)=x2ex.

f′(x)=f'(x) =f′(x)=
Your formula appears here
2Expression20 ptsNot answered

Type the derivative of g(x)=ln⁡(x2+1)g(x)=\ln(x^2+1)g(x)=ln(x2+1).

g′(x)=g'(x) =g′(x)=
Your formula appears here
3Expression15 ptsNot answered

Type the derivative of h(x)=sin⁡(3x2)h(x)=\sin(3x^2)h(x)=sin(3x2).

h′(x)=h'(x) =h′(x)=
Your formula appears here
4Match15 ptsNot answered

Match each rule to its formula.

Pick the partner of each item on the left.

Sum rule
Product rule
Quotient rule
Chain rule
5Numeric answer15 ptsNot answered

For f(x)=x3e−xf(x)=x^3e^{-x}f(x)=x3e−x, compute f′(2)f'(2)f′(2) and round to 4 decimals.

f′(2)=f'(2) =f′(2)=accepted: ± 0.001
6Step-by-step derivation15 ptsNot answered

Differentiate (3x+1)5(3x+1)^5(3x+1)5 in two lines. For each line, pick the rule that justifies it.

1
Math modeKeyboard or LaTeX inputTask 1 of 6 · Ctrl ⏎ to check

Log in to run your code.

Every lecture is free to read. Create an account or log in to run code, run tests and submit this lab.

  • In-browser IDE with a bash terminal — nothing to install
  • Instant grading, XP and your place on the skill
Create an accountLog in
OR
Continue with GitHub