Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in python please! #7 is the integral from 0 to 1 of sin(x^3) dx 1. Write a Python procedure to implements Simpson's Rule to

Write in python please! #7 is the integral from 0 to 1 of sin(x^3) dx image text in transcribed
1. Write a Python procedure to implements Simpson's Rule to compute an approximation to the value of f(a) dar (You may assume the function is continuous so you don't have to worry about undefined function values). You may want to use the formula at the middle of page 231 to implement the rule. Test your function on the integral sin (as) dar from exercise #2 above. The definition statement of your program should be def Simp (f, a, b, N): where fis the function, a and b are the endpoints, and N is the number of subintervals. Your output statement should be: The approximate value of the integral with NNNNN subintervals is XXXXX where NNNNN is the number of subintervals N and XXXXX is the approximate value of the integral. 2. Write a program that implements the three-point Gaussian Quadrature formula (the nodes and weights from #6 above) to compute an approximation to the value of (a) dr. You will need to transform the interval la, b to the interval [-1,1] us- ing the ideas on page 240; however, let the computer compute the values of the nodes and weights, not your calculator (You may assume the function is continuous so you don't have to worry about undefined function values). The definition statement of your program should be def Gauss3(f, a, b) where f is the function and a and b are the endpoints. Your output statement should be The approximate value of the integral is XXXXX Test your function on the integral from #7 above

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

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions