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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!