Skip to content
DeepForgeby svx
All problems
EasyCalculusca-369

Average Rate of Change Polynomial

Problem

The average rate of change of a function on [a, b] is (f(b) - f(a)) / (b - a).

Given polynomial coefficients, a, and b, return the average rate of change. Assume a != b.

Hint

This is the slope of the secant line.

Test cases

case 1
in: [[1,2,3],0,2]
expected: 8
case 2
in: [[0,0,1],1,3]
expected: 4
case 3
in: [[4],1,5]
expected: 0
Starter codePython
def average_rate_of_change_polynomial(coeffs, a, b):
    # Your code here
    pass

3 test cases · run your code against them in the editor