bisection-algo-img

Trapazoidal Algorithm

  • Take input function to be integrated
  • Choose a value in which the intervals will be divided, i.e., the value of n. So, for the given expression, first, we will divide the interval into six equal parts as the number of intervals should be even.
  • Calculate the value of h = (b - a)/2
  • Evaluate and calculate the values of x0 to xn. Consider y = f(x) and calculate the values of y0 to yn for x0 to xn. Here, we get the following data:
  • Put the values in the method and then we can calculate approximate value of integral using formula
  • Stop
    In numerical analysis, Simpson's 1/3 rule (method) is a technique for approximating definite integral. This method is based on Newton's Cote Quadrature Formula and Simpson 1/3 rule is obtained when we put value of n = 2 in this formula.

Calculate
nrm-algo-img

Simpson's 1/3rd Algorithm


  • Define function f(x)
  • Read lower limit of integration, upper limit of integration and number of sub interval
  • Calculate: step size = (upper limit - lower limit)/number of sub interval
  • Set: integration value = f(lower limit) + f(upper limit)
  • Set: i = 1
  • If i > number of sub interval then goto
  • Calculate: k = lower limit + i * h
  • If i mod 2 =0 then Integration value = Integration Value + 2* f(k) Otherwise Integration Value = Integration Value + 4 * f(k) End If
  • Increment i by 1 i.e. i = i+1 and go to step 7
  • Calculate: Integration value = Integration value * step size/3
  • Display Integration value as required answer
    In numerical analysis, Simpson's 1/3 rule (method) is a technique for approximating definite integral. This method is based on Newton's Cote Quadrature Formula and Simpson 1/3 rule is obtained when we put value of n = 2 in this formula.

Calculate
nrm-algo-img

Simpson's 3/8th Algorithm


  • Define function f(x)
  • Read lower limit of integration, upper limit of integration and number of sub interval
  • Calculate: step size = (upper limit - lower limit)/number of sub interval
  • Set: integration value = f(lower limit) + f(upper limit)
  • Set: i = 1
  • If i > number of sub interval then goto
  • Calculate: k = lower limit + i * h
  • If i mod 3 =0 then Integration value = Integration Value + 2* f(k) Otherwise Integration Value = Integration Value + 3 * f(k) End If
  • Increment i by 1 i.e. i = i+1 and go to step 7
  • Calculate: Integration value = Integration value * step size*3/8
  • Display Integration value as required answer
    In numerical analysis, Simpson's 3/8 rule (method) is a technique for approximating definite integral of a continuous function. This method is based on Newton's Cote Quadrature Formula and Simpson 3/8 rule is obtained when we put value of n = 3 in this formula.

Calculate