All problems
Surface Area of Revolution Numeric
Problem
The surface area of the solid formed by rotating y = f(x) about the x-axis is the integral of 2 * pi * f(x) * sqrt(1 + f'(x)^2) dx.
Approximate it with the midpoint rule over n equal subintervals. Given polynomial coefficients, a, b, and n, return the estimate.
Hint
The integrand is circumference 2*pi*f(x) times the arc-length factor.
Test cases
case 1
in: [[0,1],0,2,50]
expected: 17.771531752633464
case 2
in: [[1],0,3,6]
expected: 18.84955592153876
case 3
in: [[0,0,0],0,1,5]
expected: 0
Starter codePython
def surface_area_revolution(coeffs, a, b, n):
# Your code here
pass3 test cases · run your code against them in the editor