Skip to content
DeepForgeby svx
All problems
MediumCalculusca-304

Numerical Arc Length of a Polynomial

Problem

Approximate the arc length of y = f(x) on [a, b] with the midpoint sum of sqrt(1 + f'(x)^2) * dx over n equal subintervals.

Given polynomial coefficients, a, b, and n, return the estimate.

Hint

Integrate the speed sqrt(1 + (f')^2); a flat line gives the plain distance.

Test cases

case 1
in: [[0,0,1],0,1,100]
expected: 1.4789354039742377
case 2
in: [[1,1],0,2,4]
expected: 2.8284271247461903
case 3
in: [[0,0,0],0,1,10]
expected: 1
Starter codePython
def numerical_arc_length(coeffs, a, b, n):
    # Your code here
    pass

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