Power, constant and sum rules
Power, constant and sum rules (lesson 2.3.1)
0 of 6 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 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,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for 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.
- 2.
- 3.
- 4.
- 5.
- 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,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for 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.
- 2.
- 3.
- 4.
- 5.
- 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,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for 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.
- 2.
- 3.
- 4.
- 5.
- 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,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for 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.
- 2.
- 3.
- 4.
- 5.
- 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,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for 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
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 .- 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, for a product, a quotient rule with its top swapped, and the wrong sign for the slope of .
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'