Numerical Approximation
Numerical approximation is the trial procedure of integral approximation that is used in case of complex integrals and provides approximate solutions as a result of definite integrals.
Numerical solutions to integration starting with the riemann sum.
Riemann Sum
Riemann sum is the technique or method to estimate the values of complex definite integrals which cannot be solved in a formal way. The main application of Riemann sum is integral approximation of the area of lines, curves by using a graphical numerical approximation.
In Riemann Sum we will divide the area under the curve into many small portions and then try to estimate the area of each portion, then the sum of all these areas is called Riemann Sum.
These small portions may be a rectangle, trapezoid, parabola or some cubic form. In this way, Riemann sum uses different approaches for estimating different types of problems.
So Let’s study the first approach of Riemann sum i.e Rectangular integration.
Rectangle Rule Integration:
So the rectangular integration is an option if you can't integrate the function that you've been given and obviously you should always try to integrate with algebra and get an exact solution.
Numerical solutions are only an estimate but if you have a function that's not possible to integrate we can use numerical approximation.
For now we will try an example in which we may use a function which we can solve algebraically, so that we can compare the method that we used here.
But normally the rectangle rule integration will apply on a function that you can't integrate.
So Let’s try an example for understanding what the rectangular integration is ?
Example:
Consider we have a function.
$$ y= e^x $$
Now if our function is equal to Y then we get a picture like this
So we've got the graph of our function y = ex and say we want integral approximation of the the graph of that function between 0 and 3. So we want to estimate the area here under the curve between point 0 and 3.
Now if we didn't know our rules of integration for ex.
$$ \int_0^3 e^x dx $$
We wouldn't be able to work that out, but what we could do instead is instead of working out that area we could split it up into rectangles.
So let's say split it into three rectangles that cover these gaps naught as shown in below figure:
Now how could we use rectangles to estimate the area under that curve.
So we will go up to the curve and we'll make that rectangle our estimate.
But you can see on each of them we would be overestimating the curve fairly significantly. So a better way to do this is actually to go half way.
So if we go half way between zero and one we'll get more of an average so we'll get a rich angle like this.
So we've got some that's over the curve and some that's under the curve. So that a little bit of it cancels out and we get a better estimate of rectangular integration.
Then the same with the next rectangle from 1 to 2 we go halfway between and we make that the top of our rectangle and we find that area underneath.
And Similarly between 2 & 3, we go half way to make that the top of our rectangle and we find that area.
Now if we find all of the areas of those rectangles we can add them up to get an estimate for the area under the curves.
Now it's a good idea to keep your working out orderly with these to keep track of what you're doing. So Let's set up table to keep track of it.
In rectangle no. 1, the width of that is 1, the midpoint is 0.5, the height of our rectangle here is the y-value at 0.5.
So it's whatever the curve would be when X=0.5, So if we do e0.5, we will get that height, that's 1.649.
Now for the area of the rectangle, we will multiply length into height, that is 1.649.
Rectangle | Width | Midpoint | Height | Area |
---|---|---|---|---|
1 | 1 | 0.5 | 1.649 | 1.649 |
Now in rectangle no 2, the widths of all of these are actually just going to be 1. The midpoint for our second rectangle here is 1.5, making the height e0.5, and height will be 4.482.
Then we do the base times the height. So we've got an area of 4.482.
Rectangle | Width | Midpoint | Height | Area |
---|---|---|---|---|
1 | 1 | 0.5 | 1.649 | 1.649 |
2 | 1 | 1.5 | 4.482 | 4.482 |
Now rectangle no 3 also has a width of 1, the midpoint here is 2.5 and e2.5 makes the height 12.182.
So our area of the 3rd rectangle is height multiplied by the width is still 12.182.
Rectangle | Width | Midpoint | Height | Area |
---|---|---|---|---|
1 | 1 | 0.5 | 1.649 | 1.649 |
2 | 1 | 1.5 | 4.482 | 4.482 |
3 | 1 | 2.5 | 12.182 | 12.182 |
So we've got our three different rectangles.Now we total them up and we get the numerical approximation of the area of our function.
$$ \int_0^3 e^x \;dx \;=\; 18.313 $$
So our area under that curve by using rectangle rule integration is approximately 18.313.
You can split this up into smaller rectangles to get a closer integral approximation. Obviously the more rectangles you do the closer your estimate would be because you're getting those narrower intervals that are getting closer and closer to being exactly on the curve.