Write a c algorithm that calculates the area under the


Write a C algorithm that calculates the area under the curve y = f (x) for c ≤ x ≤ d:

  • f is a 4th order polynomial function f (x) = a0 + a1x + a2x2 + a3x3 + a4x4
  • With x ∈ R and ak ∈ R

The algorithm must use the trapezoidal integration method describes by the following curves: Area = cdf(x)dx

941_Figure.png

  • We divide the integration range [d - c] into N trapezes and we calculate the area of each trapeze alone then we add all the areas calculated to obtain the total area under the curve. The more trapezes considered in the range [d - c] the more accurate the result of area calculation is
  • The user will enter the polynomial coefficients a0, a1, a2, a3, a4 as well as the integration limits c and d
  • Your algorithm will start with N = 1, calculate the area then increase by 1 the number of trapezes used until the difference between two calculations is less than 1%.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Write a c algorithm that calculates the area under the
Reference No:- TGS01594406

Expected delivery within 24 Hours