Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the programs in Python! Incorrect answers will be reported! We want to eva

ID: 3801886 • Letter: W

Question

Write the programs in Python! Incorrect answers will be reported!

We want to evaluate the integral integral^1_0 e^-t^2 dt. Write a Python (or C, etc.) function that computes this integral using the composite trapezoidal method with N subintervals of [0.1]: here N is the input parameter of this function. We assume N lessthanorequalto 200. Hand in your program. Run this program and print the output when N has the values 10, 50, 100. Use the error formula of the composite trapezoidal method to find an upper bound on the error of this method for the above integral with N = 100.

Explanation / Answer

The above python program refers the Trapezoidal rule of subintervals b/w a and b and n is no of sub intervals.

To find Upper Bound of Error using Trapezoidal Rule

No. of sub intervals = nn

Given integral is

0sin(2x)dx0sin(2x)dxf(x)=sin(2x),a=0,b=f(x)=sin(2x),a=0,b=f(x)=2cos(2x)f(x)=2cos(2x)f(x)=4sin(2x)f(x)=4sin(2x)

The maximum value of |f(x)||f(x)| will be 4

M=4M=4

The upper bound of error,

|eT|M(ba)312n2|eT|M(ba)312n2|eT|33n2