Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

What would you do?

Answered: 1 week ago