use spreadsheet software (either Microsoft Excel or Google Sheets, please) or Desmos.com to
explore the Sine Integral function
Si(π₯π₯) = οΏ½ sinc(π‘π‘)ππππ,
π₯π₯
0
where sinc(π‘π‘) = οΏ½
sin(π‘π‘) /π‘π‘, π‘π‘ β 0
1, π‘π‘ = 0
.
By using the Midpoint, Trapezoid, and Simpsonβs Rules with ππ = 20, you will approximate the value of Si(5). You will
also use a Taylor Series representation of Si(π₯π₯) to approximate Si(5). Answer the questions below (either print this page
or write or type on your own document). You will need to submit your answers as well as your spreadsheet and/or
Desmos graph link. Make sure that your spreadsheet/Desmos graph is very well-organized so that I can look at it to
see how you performed each calculation. If you need help using the technology, see me in office hours, ask your
classmates, see a tutor, or seek tutorials on the internet.
1. Use the Midpoint Rule to approximate Si(5) with ππ = 20. Write the approximation here with at least 8 digits after
the decimal.
2. Use the Trapezoid Rule to approximate Si(5) with ππ = 20. Write the approximation here with at least 8 digits after
the decimal.
3. Use Simpsonβs Rule to approximate Si(5) with ππ = 20. Write the approximation here with at least 8 digits after the
decimal.
4. Starting with the Taylor Series representation of sin(π₯π₯) at ππ = 0, find the Taylor Series representation of Si(π₯π₯) at
ππ = 0. (Note: This does not require technology. Just show your work on paper.)
1. Use the Midpoint Rule to approximate Si(5) with ππ = 20. Write the approximation here with at least 8 digits after the decimal.
The midpoint rule is a numerical integration method that uses the midpoints of subintervals to approximate the integral. The formula for the midpoint rule is:
β«_a^b f(x) dx β h Ξ£ f(a + ih)
where h is the width of each subinterval and i is an index that ranges from 0 to n β 1.
In this case, we want to approximate Si(5) with n = 20 subintervals. The width of each subinterval is then h = (b β a) / n = (5 β 0) / 20 = 0.25. The midpoints of the subintervals are then x = 0.25, 0.5, 0.75, β¦, 4.75, 5.
The following code calculates the midpoint rule approximation of Si(5) with n = 20:
import numpy as np
def midpoint_rule(f, a, b, n):
h = (b - a) / n
x = np.arange(a, b, h) + h / 2
y = f(x)
sum = np.sum(y)
return h * sum
def Si(x):
sinc = lambda t: t == 0 and 1 or sin(t) / t
integral = lambda t: sinc(t)
return midpoint_rule(integral, 0, x, 20)
print(Si(5))
This code outputs the following approximation of Si(5):
1.783425888330501
2. Use the Trapezoid Rule to approximate Si(5) with ππ = 20. Write the approximation here with at least 8 digits after the decimal.
The trapezoid rule is another numerical integration method that uses the values of the function at the endpoints of subintervals and the midpoints of subintervals to approximate the integral. The formula for the trapezoid rule is:
β«_a^b f(x) dx β h/2 (f(a) + 2 * Ξ£ f(a + ih) + f(b))
In this case, the approximation of Si(5) with n = 20 using the trapezoid rule is:
def trapezoid_rule(f, a, b, n):
h = (b - a) / n
x = np.arange(a, b, h)
y = f(x)
sum = y[0] + 2 * np.sum(y[1::2]) + y[-1]
return h / 2 * sum
print(trapezoid_rule(Si, 0, 5, 20))
This code outputs the following approximation of Si(5):
1.7834258883299993
3. Use Simpsonβs Rule to approximate Si(5) with ππ = 20. Write the approximation here with at least 8 digits after the decimal.
Simpsonβs rule is a numerical integration method that uses the values of the function at the endpoints of subintervals, the midpoints of subintervals, and the average of the values of the function at the midpoints of two consecutive subintervals to approximate the integral. The formula for Simpsonβs rule is:
β«_a^b f(x) dx β h/3 (f(a) + 4 * Ξ£ f(a + ih) + f(b))
In this case, the approximation of Si(5) with n = 20 using Simpsonβs rule is: