SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 2.3.1 Power, constant and sum rulesConcept · 25 min
      2. 2.3.2 Product and quotient rulesConcept · 25 min
      3. 2.3.3 The chain ruleConcept · 30 min
      4. 2.3.4 Derivatives of exponentials and logarithmsConcept · 30 min
      5. 2.3.5 Derivatives of sine and cosineConcept · 35 min
      6. 2.3.6 Practice set: differentiationPractice set · 25 min
      7. 2.3.7 Case study: modified duration and elasticityCase study · 30 min

Level 2, Single-variable calculus 2.3 Differentiation rules Lesson 6 of 7

Practice setLesson 2.3.6 in Level 2, Single-variable calculus. About 25 minutes.

Practice set: differentiation

Power, constant and sum rules

Power, constant and sum rules (lesson 2.3.1)

0 of 6 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Product and quotient rules

Product and quotient rules (lesson 2.3.2)

0 of 6 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

The chain rule

The chain rule (lesson 2.3.3)

0 of 6 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Exponentials and logarithms

Exponentials and logarithms (lesson 2.3.4)

0 of 6 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Sine and cosine

Sine and cosine (lesson 2.3.5)

0 of 6 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Coding exercise

Exercise

A derivative checker

Write is_derivative(f, claimed). Both arguments are strings in Python syntax, such as "x**3" and "3*x**2". Return True if claimed is the derivative of f with respect to x, and False otherwise.

  • sp.sympify(text) turns a string into a SymPy expression; sp.symbols("x") gives the letter xx.
  • Two expressions are equal when sp.simplify(a - b) == 0.

The tests include right answers written in unusual forms. They also include the mistakes from these lessons: a missing chain factor, f′gf'g for a product, a quotient rule with its top swapped, and the wrong sign for the slope of cos⁡x\cos x.

See the tests
def test_power_rule():
    """3x² is the derivative of x³"""
    assert is_derivative("x**3", "3*x**2") is True, 'expected True for ("x**3", "3*x**2")'


def test_unusual_form():
    """A right answer in another form still counts: (3x + 1)⁵ → 15(3x + 1)⁴ written expanded"""
    expanded = "1215*x**4 + 1620*x**3 + 810*x**2 + 180*x + 15"
    assert is_derivative("(3*x + 1)**5", expanded) is True, "expected True for the expanded form"


def test_forgot_chain_factor():
    """Forgetting the chain rule's inner factor is wrong: (3x + 1)⁵ → 5(3x + 1)⁴"""
    assert is_derivative("(3*x + 1)**5", "5*(3*x + 1)**4") is False, "expected False: the factor 3 is missing"


def test_product_mistake():
    """(fg)' is not f'g: x²·eˣ → 2x·eˣ is wrong"""
    assert is_derivative("x**2*exp(x)", "2*x*exp(x)") is False, "expected False for f'g alone"


def test_quotient_order():
    """Swapping the top of the quotient rule is wrong: x/(x + 1) → -1/(x + 1)²"""
    assert is_derivative("x/(x + 1)", "-1/(x + 1)**2") is False, "expected False: the right answer is 1/(x + 1)²"


def test_chain_with_exp():
    """A chain rule answer with an exponential: e^(-x²/2) → -x·e^(-x²/2)"""
    assert is_derivative("exp(-x**2/2)", "-x*exp(-x**2/2)") is True, 'expected True for ("exp(-x**2/2)", "-x*exp(-x**2/2)")'


def test_logs():
    """ln(5x) has derivative 1/x"""
    assert is_derivative("log(5*x)", "1/x") is True, 'expected True for ("log(5*x)", "1/x")'


def test_cosine_sign():
    """The slope of cos x is −sin x, so sin x is wrong"""
    assert is_derivative("cos(x)", "sin(x)") is False, 'expected False for ("cos(x)", "sin(x)"): the slope of cos x is -sin x'

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.

  • Derivatives

    Paul's Online Notes. Notes.

    The definition of the derivative and every differentiation rule, one page per rule.