Loading [MathJax]/jax/output/HTML-CSS/jax.js

Thursday, May 03, 2018

Numerical Integration Basics

Consider the equation y=4. If we plot this on two axes, x and y, it has no slope; it's just a horizontal line. We could also write the equation as y=0x+4 because the value of y is unaffected by the value of x. We could also write it as y=f(x).

The integral of a function can be used to find the area between the function and the x-axis and is written I=baf(x)dx. It's essentially the sum of tiny changes in x (dx) multiplied by their corresponding y values (f(x)). The equation reminds us that we need to restrict ourselves to a lower and an upper value of x (otherwise the area would be infinite).

Let's choose a = x = 0 (the y-axis) and b = x = 3 as those two bounds.

I=304dx
I=[4x]30
I=(4×3)(4×0)
I=12

We're not restricted to 0 as the lower bound, but it exposes an interesting property: the area under a-to-b is equal to the area under 0-to-b less the area under 0-to-a. Let's try the same integral as above, but from 0-to-1.

I=104dx
I=[4x]10
I=(4×1)(4×0)
I=4

We might then subtract 4 from 12 to arrive at 8, but why not do this in one go?

I=314dx
I=[4x]31
I=(4×3)(4×1)
I=8