Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using python without using any powerful functions other than math module and copy function Write a function defined as:def Simpson(fcn, a, b, npoints = 21):

using python without using any powerful functions other than math module and copy function

Write a function defined as:def Simpson(fcn, a, b, npoints = 21):

Purpose: use Simpsons 1/3 rule to estimate the integral of fcn(x), between the limits of a and b.

fcn: the function we want to integrate

a and b : the lower and upper limits of integration

npoints : The number of integration points used in the range a to b (inclusive). npoints must be an ODD number.

If npoints is not ODD, then add 1 to make it odd!

return value: the estimate of the integral

Write and call a main() function that uses your Simpson function to estimate and print the integral of:

image text in transcribed: with a=1, b=3, npoints=10

image text in transcribed with a=2, b=3, npoints= 23

2 3cos(1) cos(2.c) *23

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

Step: 3

blur-text-image

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions