Question: Represent a polynomial ()= 0 + 1 ++ d d as a list of numbers [a0,a1,...,ad]. Write a function called poly_integral which takes a list
Represent a polynomial ()=0+1++dd as a list of numbers [a0,a1,...,ad]. Write a function called poly_integral which takes a list p representing a polynomial ()=0+1++dd, and numbers a and b, and returns the value of definite integral
![Represent a polynomial ()=0+1++dd as a list of numbers [a0,a1,...,ad]. Write a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2f37b51d5b_07566f2f37b092ca.jpg)
Hi this is a question using Python code, and I'm not sure how to relate the b and a with the rest of the variable. This is my current code:
def poly_integrate(p,a,b): for p in range(a, b): result = sum(p[n]*a**n for n in range(0, len(p))) return result
but I'm getting the error
TypeError: poly_integral() takes 1 positional argument but 3 were given
Any help would be appreciated :)
p(x)dx
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
