`Hey,
Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.
#include <stdio.h>
#include<math.h>
float func(float x)
{
return x*x*cos(x)+x*x*x*sin(x);
}
// Function for approximate integral
float simpsons_(float ll, float ul, int n)
{
// Calculating the value of h
float h = (ul - ll) / n;
// Array for storing value of x and f(x)
float x[1000], fx[1000];
int i;
// Calculating values of x and f(x)
for (i = 0; i <= n; i++) {
x[i] = ll + i * h;
fx[i] = func(x[i]);
}
// Calculating result
float res = 0;
for (i = 0; i <= n; i++) {
if (i == 0 || i == n)
res += fx[i];
else if (i % 2 != 0)
res += 4 * fx[i];
else
res += 2 * fx[i];
}
res = res * (h / 3);
return res;
}
// Driver program
int main()
{
float lower_limit = 0; // Lower limit
float upper_limit = 7.5; // Upper limit
int n = 100; // Number of interval
printf("Integration is
%f\n",simpsons_(lower_limit,upper_limit,n));
return 0;
}

Kindly revert for any queries
Thanks.
Paragraph Styles Voce Sraut Simpson's 1/3rd rule is an extension of Trapezoidal rule where the integrand...
Use the Trapezoidal Rule, the Midpoint Rule, and Simpson's Rule to approximate the given integral with the specified value of n. (Round your answers to six decimal places.) 5 3 cos(6x) n = 8 dx, X 1 (a) the Trapezoidal Rule (b) the Midpoint Rule (c) Simpson's Rule
Use the Trapezoidal Rule, the Midpoint Rule, and Simpson's Rule to approximate the given integral with the specified value of n. (Round your answers to six decimal places.) 4 In(1 + ex) dx, n = 8 Jo (a) the Trapezoidal Rule X (b) the Midpoint Rule (c) Simpson's Rule 8.804229
Use the Trapezoidal Rule, the Midpoint Rule, and Simpson's Rule to approximate the given integral with the specified value of n. (Round your answers to six decimal places.) S 2 + cos(x) dx, n=4 (a) the Trapezoidal Rule (b) the Midpoint Rule (c) Simpson's Rule Need Help? Read Talk to Tutor
4. -1 POINIS Use the Trapezoidal Rule and Simpson's Rule to approximate the value of the definite integral for the given value of n Round your answer to four decimal places and compare the results with the exact value of the definite integral dx, 4 Trapezoidal Simpson's exact Need Help? Read Talkie Tur
Help
Use the Trapezoidal Rule, the Midpoint Rule, and Simpson's Rule to approximate the given integral with the specified value of n. (Round your answers to six decimal places.) V 1 + x2 dx, n = 8 Jo (a) the Trapezoidal Rule 2.41379 (b) the Midpoint Rule 1.164063 (c) Simpson's Rule 1.17
Use the Trapezoidal Rule, the Midpoint Rule, and Simpson's Rule
to approximate the given integral with the specified value of
n. (Round your answers to six decimal places.
pi/2 3sqrt(1 + cos(x))dr, n = 4 0
Use the Trapezoidal Rule and Simpson's Rule to approximate the value of the definite integral for the given value of n. Round your answer to four decimal places and compare the results with the exact value of the definite integral. foxt dx, n = 4 (x + 2)2 Trapezoidal Simpson's exact The velocity function, in feet per second, is given for a particle moving along a straight line. v(t) = 2 - t - 132, 1sts 13 (a) Find the...
Can you solve all the parts please?
Use the Trapezoidal Rule, the Midpoint Rule, and Simpson's Rule to approximate the given integral with the specified value of n. (Round your answers to six decimal places.) 1/2 dt, n = 10 (a) the Trapezoidal Rule (b) the Midpoint Rule (c) Simpson's Rule
Use the Trapezoidal Rule, the Midpoint Rule, and Simpson's Rule to approximate the given integral with the specified value of n. (Round your answers to six decimal places.) 1/2 0 10 sin(x2) dx, n = 4
(a) Estimate So sin(x + 1) dx by using either Simpson's Rule or Trapezoidal Rule with n= 6 (Round the answer to 6 decimal places). (b) Estimate the minimum number of subintervals needed to approximate the integrals with an error of magnitude less than 10-4 by the rule you used in part (a).