All problems
Leibniz Rule Moving Limits
Problem
When both integration limits depend on x, d/dx of the integral from a(x) to b(x) of f(t) dt = f(b(x)) * b'(x) - f(a(x)) * a'(x).
Given coefficients of the polynomial integrand f, coefficients of the linear limits a and b, and x, return the derivative value. Coeffs lists are in ascending order.
Hint
Evaluate the integrand at each moving endpoint, then multiply by that endpoint's derivative.
Test cases
case 1
in: [[1],[0,2],[1,1],3]
expected: -1
case 2
in: [[0,1],[1],[0,1],2]
expected: 2
case 3
in: [[2,0,1],[0,0,1],[1],1]
expected: -6
Starter codePython
def leibniz_rule_value(f_coeffs, a_coeffs, b_coeffs, x):
# Your code here
pass3 test cases · run your code against them in the editor