You will write three functions that test the product rule and the quotient rule by computer. A function and its derivative are passed in as Python functions. The checker uses with , and with .
The idea. The product rule gives and the quotient rule gives . A rule is right if its value agrees with the central difference quotient for a small .
Your tasks.
product_rule(u, du, v, dv, x). Return the value of at x.quotient_rule(u, du, v, dv, x). Return the value of at x.agrees(f, rule_value, x). Return True when rule_value is within 0.0001 of the central difference quotient of f at x, with h = 0.00001.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…