← Back to list

SC20: Numerical Integration

Find the whole linear algebra series here

Infinity Slap · 2026-07-18 05:18 · 2 claps · 2.9 min read
#mathematics #calculus #numerical-integration #math #machine-learning
Open on Medium ↗
Wiki topics: ML · Machine Learning EDU · Education & Learning 📐 · Mathematics

SC20: Numerical Integration

Find the whole linear algebra series here

There are 3 types of Numerical integrations

  1. Reimann’s Sum: We have already seen how Reimann’s Sum works, This is where we split the graph into rectangles, and the area under the graph would be the sum of areas of all such rectangles. But this will cause overshoot or undershoot. That is if we consider all rectangles, then either we add a lot of area or leave a lot of area.

Pic credit: Geeks for geeks

Pic credit: Geeks for geeks

The Lower sum ignores some area, and the upper sum adds extra area. The final Reimann’s sum is given by the sum of areas of each rectangle. Area of each rectangle = base*height base of each rectangle will be same = ∆x height of each rectangle = yᵢ = ƒ(xᵢ)

The total area is given by

  1. Trapezoidal Sum: Trapezoidal sum is a little better than Reimann’s sum, Here instead of choosing each of the part as a rectangle, we consider them to be a trapezoid. This decreases the amount of overshoot and undershoot, but it is still lousy.

Pic Credit: allmath.com

Pic Credit: allmath.com

Here we try to split the curve into trapezoids. You might see, it is still lousy and there is still some undershoot or overshoot in some places.

To find the area using Trapezoidal Rule, we need to find the area of all the trapezoids. If the heights of the two vertical parallel sides of the trapezoids are y1 and y2, then The area of the trapezoids = (average of the two heights)base The area of the trapezoids = (y1+y2)/2 ∆x

The total area given by

  1. Simpson’s Rule: This is the best out of all through numerical integration methods. Here the curve is split into pieces, but the top part instead of being a straight line (rectangles) or slant lines (trapezoidal), In simpson’s rule the top part is considered to be a parabola.

Here each of the part has a parabolic cap, and the total area is the sum of all such pieces. The total area in simpson’s rule is given by

Example: Consider the curve y = 1/x, and the limits 1 to 2. You need to find the area under the curve using Trapezoidal rule and simpson’s rule.

Let’s first apply trapezoidal rule first

Now Let’s try using simpson’s rule

We can see that the simpson’s rule gives results very accurate to the result that we get using integration which would be 0.693147.

Now If you forget the formula for this rule, just try and apply for ƒ(x) = 1 between the results a and b, the final area should be b — a.


메타데이터
post_id
b0570f329854
slug
sc20-numerical-integration-b0570f329854
url
https://medium.com/@navaneeth.penumarthi/sc20-numerical-integration-b0570f329854
canonical_url
https://medium.com/@navaneeth.penumarthi/sc20-numerical-integration-b0570f329854
author_url
https://medium.com/@navaneeth.penumarthi
status
ok
fetched_at
2026-08-02 12:31:02