This document contains a program to calculate the integral of a function f(x) from a to b using Simpson's 1/3 Rule. The program takes user input for the lower and upper bounds, a and b, and number of intervals n. It then calculates the step size h, initializes the sum, and loops through the intervals, adding the function values with the Simpson's 1/3 Rule weights to the running sum. The final sum is multiplied by h/3 and output as the result.
This document contains a program to calculate the integral of a function f(x) from a to b using Simpson's 1/3 Rule. The program takes user input for the lower and upper bounds, a and b, and number of intervals n. It then calculates the step size h, initializes the sum, and loops through the intervals, adding the function values with the Simpson's 1/3 Rule weights to the running sum. The final sum is multiplied by h/3 and output as the result.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online from Scribd
This document contains a program to calculate the integral of a function f(x) from a to b using Simpson's 1/3 Rule. The program takes user input for the lower and upper bounds, a and b, and number of intervals n. It then calculates the step size h, initializes the sum, and loops through the intervals, adding the function values with the Simpson's 1/3 Rule weights to the running sum. The final sum is multiplied by h/3 and output as the result.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online from Scribd