 Good morning. In this lecture, we will study methods of numerical integration. So, first we start with Newton codes integration formulae. So, the problem here is to integrate a function of a single variable from A to B. Now, as you understand, if the function is like this, then the integral of f x from A to B is this area. So, we need to find out this area or find out the integral of function f x from A to B that is this. Now, we will start from the definition and the numerical integration procedure basically works directly on the definition. Now, if you divide this interval A to B into a number of subintervals say n subintervals of equal size and then you call this A as x 0 and B as x n and in between you have got n equal intervals of size h. Then that will mean that x n minus x 0 is n into h and that means this that is for every subinterval we have the size h which is B minus a by n. Now, an estimate of the integral you can find by taking one point from every interval and summing up the function values over all the intervals. There is one point from the first interval, one point from the second interval, one point from the third interval and so on. And if you sum up these and multiply with h then you get one estimate of the integral that is in the first subinterval you take one value and then suppose you take this value, this value of the function multiplied with h gives you this area, this rectangular area. Similarly, for this next interval if you take this value and then you get this area. Now, like that if you go on summing up the rectangular areas then you get one estimate of this entire area. Now, if you have the steps, if you have the number of subinterval large and each subinterval of very small size that is h is extremely small then you get a better and better estimate. Now, this is an estimate say j bar. Now, the question is what is our policy of taking this x i star whether we take it in the beginning of the interval, subinterval or at the end of the subinterval or somewhere in the middle. Now, depending upon which point of the subinterval we take say if we take the starting point of the subinterval then we get one such estimate say j 1 and if we take the end point of each subinterval then we get another estimate j 2. Now, these two estimates might slightly differ depending upon how the function changes. Now, as n tends to infinity that is as the number of subinterval become very large and that means and the size of the subinterval tends to 0. Then in such a situation if the two summations that is two estimates of the integral approach the same limit then by definition we call the function to be integrable over the interval a to b. That is the definition of integrability and the definition of integral that is if the two summations approach the same value same limit as n tends to infinity and h tends to 0 then we say that function is integrable integrable and the common limit to which these estimate approach that limit is the integral. So, this is how you define the integral as a limit of a sum apart from giving the definition this also gives us a rule for conducting numeric integration and that rule can be called a rectangular rule or a one point rule. Why rectangular? Because it is the sum of rectangular elements and why one point? Because in every subinterval we are considering a single point. Now so far as the question of selecting the point is concerned we may ask this question. Let us make one point clear that if the function is integrable by this definition then in the analytical way of integration we typically try to look for a suitable expression for this function. If there is such an expression and then if that expression can be organized in the form of a function which we know is the derivative of some known function then we typically conduct the integration in analytical form through analytical means as an anti differentiation formulation. Now it may happen that there is an expression for f x, but then we by the normal school calculus method we cannot frame it in the form in which it is recognized to be the derivative of some other known function. In that case the analytical methods of integration will not work apart from that there may be situations where you can evaluate the function at whatever point you want, but then you cannot frame an analytical expression that is analytical expression for the function is not available. For example the function that we are talking about may be the result of an experiment that is you provide x and as with the value of x taken as one of the parameters in the experiment the result of the experiment turns out to be the function value f x. So, that way you can evaluate the function at a value of x, but you cannot get an expression of it. So, that way if you can evaluate the function at several points through experimentation or through some complicated calculation in a computer program then we can say that f x you have, but you do not have an expression for the f x. So, in both of these cases one when you do not have an expression for f x and two when you have an expression, but tackling that by the integration methodologies of the school calculus is not enough not possible. So, in both of these cases you have to rely on numerical integration if you need the integral. Now we come back to this question that is if whichever point we take as the single point in every sub interval like this we find that the sum approaches the same limit if we take a large number of steps of extremely small size 8, but then in actual practice we would like to evaluate the integral without going into extremely large number of steps that is we would not like n to be extremely large. So, what will be efficient? Neither the starting point of each sub interval nor the end point of each sub interval. So, the best result you will find by taking the mid point of every interval if you want to take a single point in the every in every interval. And therefore, to answer this question which point to take as x i star a commonsense answer will be take the mid point as the best representative. And therefore, one special case of the rectangular rule which is most commonly used that is obtained which is the mid point rule. So, selecting x i star as the mid point of the sub interval you get over one such sub interval you get the integral as h into that value that is neither in the beginning nor in the end, but in the mid point. The understanding is that whatever is the trend of the function whatever is lost in this half is compensated in this half to a good extent. So, with that intention with that background we typically take the mid point for a single point rule. So, this is the estimate of this integral over a particular sub interval and over the entire domain from a to b. These things will be added from x 0 to x 1, x 1 to x 2, x 2 to x 3 and so on. So, that sum over the entire domain is given by the summation of this for i equal to 1 to n. Now, after we have found this mid point rule or single point formula for the numerical integration we need to figure out how good it is. Now, the way we conduct this error estimate is through the Taylor series. So, suppose we frame the Taylor series of f x about this point about this mid point then Taylor series of f x around this mid point is f at the mid point plus f prime at the mid point into x minus mid point plus second derivative into delta x square by 2 and so on. So, this is the Taylor series of f x around x i bar the mid point. Now, the correct integral of this Taylor series would be this is constant into h is x i minus x i minus 1 that is the size of the interval plus now note what will be the integral of this? The integral of this will be this is constant number and the integral of this will be x minus x i bar whole square by 2, but then that is whole square. Now, when we evaluate the square at this and this in both cases we will get the same value that means x minus x i bar whole square by 2. Now, this is x i and this is x i minus 1. So, when we put x i in this place then we find this is h by 2 because the size of the interval is h. So, mid point is h by 2 away from the end point. So, this is h by 2 h by 2 square by 2 and when we put this value we get this as minus h by 2, but it is square. So, it will be the same thing and so when you subtract we get that cancelled. So, that means h square by 2 h square term will be absent from the error because you can simply see that this is an odd function. So, its integral from minus h by 2 to h by 2 is 0. So, this part will go missing in the integral. The leading term in the integral after this will be this one and this one will be this is square. So, it will be cube by 3. So, the integral of this term we will get as cube by 3 and already there is a two sitting here. So, we will get it as 6 and outside we will have this f double prime. So, then when we evaluate this at x i we will find this is h by 2. When we evaluate it at i minus 1 we will find it minus h by 2. So, we will get h by 2 cube minus h by 2 cube which will give us. So, here the terms will survive. So, h cube by 8 plus h cube by 8 that is h cube by 4 divided by 6. That means h cube by 24 we will get. So, that shows us that the leading error term will be this and similarly we will find that the f triple prime term will get cancelled just like this part and the next term similarly if you can if you calculate then you will find that you will get this. Now note that this is the term which we will get in the actual midpoint rule integration formula. So, error will be the rest of it and in that series of the error it is this term which will dominate. So, the leading error will be of the third order and therefore, this is called third order accurate that is accuracy of the midpoint rule is of the third order which means that the error term will be error will be dependent upon the step size up to the cubic order. But then that is only for one sub interval as you try to sum up such components over all these sub intervals then the complete formula you get as from a to b. So, such terms added over all the sub intervals that is i equal to 1 to n n sub intervals. Now this same thing when we add up now in this addition this term has been thrown out this term has been neglected because the leading error term is this. So, when we add up this for i equal to 1 to n this is of course, this in which the this is the midpoint rule formula result and this will be the error. So, when we try to sum it up then we find that here the error will have this sum of the second derivative at this midpoint whatever is the second derivative. Now if the second derivative is varying then somewhere it is small somewhere it is large and so on. Then from the mean value theorem you will find that there will be some value of x between a and b where the second derivative value is the average over the complete interval if that value is this psi then you will you can say that the sum of the second derivatives over all the intervals is n times the second derivative value at that point whatever may be that point. So, n times this so take that n from here and combine it with 1 h. So, n h is the size of the interval n sub intervals of h size. So, n h is the size of the complete interval complete domain which is b minus a that is why you find that 1 power of h has got reduced here and then that means that the error in the integral over the entire domain is proportional to h square that is it is proportional to the square of the step size. So, that means that the third order accuracy over each sub interval will mean that over the entire domain it will be second order accurate this is midpoint rule. Now, this was the result of getting taking one function value in every sub interval if you decide to decide to use two sub intervals then that will mean that for every two points or every sub interval then that will mean that over every sub interval you will not approximate the function with a constant value, but you will approximate it with a say this is the interval shown exaggerated. So, whatever is the function like this so if this is one interval then the next rule is trapezoidal rule which makes a linear interpolation between these two. So, just over a constant value the next possible approximation next possible estimate is the linear interpolation between the two end points. In this case the linear interpolation between two end points will basically try to work out the integration of this function which will be this area of this trapezium and that is why the corresponding rule is called that trapezoidal rule. What is the area of this trapezium trapezium half into h into the sum of these two. So, that is as if you are taking this area so next step next higher rule will be by approximating the function with a linear interpolation then you will find half into h into the sum of the function values at the two point two end point. So, that is the next rule now here again if you sum up over all the sub intervals then you will sum this for i equal to 1 2 3 4 5 6 up to n as you do that you will find that the first sub interval gives you x 0 and x 1 second one will be giving x 1 and x 2 third one will be given x 2 and x 3 this is an advantage of trapezoidal rule that every internal point x 1 x 2 x 3 up to x n minus 1 is actually used up in two places that means the function evaluation at that those points are used very efficiently. So, then all the internal points turn out to appear twice and the initial point x 0 and the final point x n appear only once and therefore, this half function value at the initial point half function value at the final point and every interior point x 1 x 2 x 3 up to x n minus 1 they get used twice in the entire sum therefore, half plus half they get full contribution here 1 to n minus 1. So, this is the complete trapezoidal rule for the full domain now similarly, similar to the case of midpoint rule if we try to conduct an error analysis in this case then again we compare this result that we get this is compared over a single sub interval this result that we get if we try to compare that with the Taylor series we will find this Taylor series expansion about the midpoint that same expansion we use for f x i minus 1 which is there in the formula here and f x i is starting point of the sub interval end point of the sub interval and then we get this you note that x i minus 1 is midpoint minus h by 2. So, you get minus sign in the odd term and f and x i is midpoint plus h by 2. So, you get all signs plus now if we try to see what do we get in this from this formula then we will sum up these two and then multiply that with h by 2. So, as we sum up these two we find that this comes twice and then multiplication with h by 2 gives us twice this into h by 2 that means h into this what we got in midpoint rule and then this will cancel out these fellows these two added together will give us h square by 4 multiplied with h by 2 will get h cube by 8 and similarly these will cancel out these will give us 384 straight away and so on. Now, this turns out to be what we get from the trapezoidal rule and then we can recall this actual Taylor series of the integral of f x around the midpoint that was this. So, this same expression if we use here and then we find that this is what we got from the trapezoidal rule and this is what we get by the integration of Taylor series itself term by term. So, the difference of these two will give us the error estimate of the trapezoidal rule as we try to find out the error estimate this completely cancel out because this much is correct and the difference of these and difference of these will give you the third degree and fifth degree terms in the error estimate the leading term will be the third degree term. So, as we do that we find that this is the integral based on the Taylor series this is the integral which trapezoidal rule gives us and this is the these are the leading error terms cubic term, fifth degree term and so on that is obtained just by subtracting these two. So, you see 1 by 24 and 1 by 8 so which is 3 by 24 the difference will be 2 by 24 that is 1 by 12. So, that 1 by 12 is here in the cubic term and so on. Similarly, over an extended domain if we sum up these for i equal to 1, 2, 3, 4 up to n then that sum will give us this formula for this which we have already got half contribution from the first term and the last term and full contribution of interior terms this will be obtained from the trapezoidal rule formula and the leading error will come from here. So, the same evaluation again f double prime x i bar summed over all the intervals all the sub intervals will give us n times the average value and average value is this and n h is b minus a. So, again we find that the leading error term over the entire interval is this. Now interestingly we find that here also the error order is same as the midpoint rule over a sub interval it was cubic order over and then over the entire domain it was a quadratic order even though in the midpoint rule in every sub interval only one function value was used and in the trapezoidal rule over every sub interval two function values were used. Still there are the error order is the same the actual error magnitude may vary, but the order of the error is same. Now in this case midpoint rule has an advantage and trapezoidal rule has another advantage. What is the advantage that midpoint rule has? Midpoint rule has advantage that just by using one function value at the midpoint the leading error on this side and that side tend to cancel out. This is advantage of midpoint rule and the trapezoidal rule has advantage that the boundary is used and so every interior boundary is actually used in on both sides. So, that way over an extended interval the number of functions function evaluation function values that was used in this and this actually do not differ by much even though it sounds as if the number of function values here is almost double, but actually it is not double it is very marginally more than this. How? Here you find that in every sub interval one function value was used the midpoint, but that was used only in that sub interval because it was an internal point interior point midpoint. So, over n sub intervals n function values were used here. Here over n sub intervals how many functions values were used? n plus 1 not much. So, that way between n function values and n plus 1 function values if you get the same error order then it is not a very surprising situation and you do not you do not miss much that is the computational resource that you have spent here is actually comparable to the computational resource that you have spent here. Now, the question is considering this these two different sources of merit different sources of merit in midpoint rule and trapezoidal rule. In the midpoint rule use of midpoint lead to symmetric error cancellation which will be an advantage of all those methods all those rules which use symmetric positioning of points in a sub interval or sub interval over a panel of sub interval. On the other hand trapezoidal rule has a merit that is use of end point allows double utilization of boundary points in adjacent interval. Now, how to use both the merit? That is any method which uses symmetric positioning of sample points will have disadvantage. On the other hand any method that uses the boundary points of the sub interval will have disadvantage. So, you can think of using a method in which you use the boundary points as well as the midpoint say if this is a function and if you use the boundary point this is a sub interval this is a sub interval and if you use this function value this function value and this function value then you see that over this sub domain over this sub domain the three points are used symmetrically midpoint is there and two other points are there which are equally disposed compared to the midpoint. So, this is symmetric positioning of points including the midpoint and the other advantage is that the boundary points are used. So, that means in the next sub interval this boundary point will be used once more. So, if you use these kind of three points positioned then the rule that you get is Simpson's one third rule and that will have both of these advantages. So, Simpson's here what we do is that we divide the overall interval overall domain into an even number of interval why even because in every interval we will double the size of the interval that is if we have two m intervals then two interval here then two interval two sub intervals here two sub intervals next two sub intervals next and so on. So, if we divide the entire domain from A to B into an even number of sub intervals even number of intervals then over every such pair of sub intervals we evaluate the function at three points one at descent one at in the at the midpoint and one at descent and then we say that through these three function values we can fit a quadratic model in this local neighborhood and then consider the integration the exact integration of that quadratic model function note that in the single point formula we use the constant value. In the two point formula that is trapezoidal rule we use a linear approximation in the three point formula there in the same manner we will use a quadratic approximation. So, now this is one way to arrive at Simpson's one third rule that is fit a quadratic through these three point point through these three function values and consider the exact integration of that quadratic function this is one way. Another way to do the same thing is that suppose these are x 1 x 0 x 1 x 2 and the corresponding function values are say f 0 f 1 and f 2 you can also say that till now we have seen that the integral estimate that we get integral value that we get is a weighted sum over weighted sum of the function values in the trapezoidal rule we found that for every sub interval the weights were half half of the both the function values. Similarly here we can say that we will consider some weight value this and then try to determine w 0 w 1 w 2. So, there are several ways of arriving at Simpson's one third rule first is that through these three function values try to fit a quadratic and integrate that quadratic expression analytically you get Simpson's one third rule formula. The second possible way is to assume it in this manner and then claim that the result of this sum must be correct with respect to the Taylor series up to such and such order that is first order, second order, third order error should be 0. So, that means you conduct the Taylor series approximation and integrate that and with that the error of this you subtract that with that with that you consider the error of this that is from that you subtract this you get the error estimate in terms of h and from that say that the h term h square term and h cube term these three terms must be 0 and from that frame equations on w 0 w 1 w 2 and then get the correct values of w 0 w 1 and w 2 and you will get the correct values this will be 1 by 3 this will be 4 by 3 this will be 1 by 3. So, that will be another way to arrive at Simpson's one third rule these two independent ways of arriving at Simpson's one third rule you will find in the exercises in the text book and here we try to find a third way to arrive at the same formula and that is based on what we were discussing just now how to use both the merit. So, using this kind of a pair of sub intervals you say that over this double interval of size 2 h we can use midpoint rule to find out an integral estimate or we can use trapezoidal rule over two of these and try to evaluate the integral like that. So, over this entire interval 2 h of 2 h size if we use only trapezoidal rule over the entire interval together then we get this trapezoidal area and that is this. So, trapezoidal rule over this entire double interval will give us this that is half into 2 h into sum of f 0 and f 2 that is this. Similarly, if we use midpoint rule over this entire interval then we will find the value of this into 2 h that will be this. So, estimate based on the midpoint rule is this estimate based on the trapezoidal rule is this and error estimate we have found earlier already in that same error estimate formulas if we put 2 h in place of h because now the interval size is twice h then we will get this. Then we say can we find out a linear combination of these two so as to get a better estimate of j that means so as to eliminate the leading error from here. As you can see twice the first equation plus once the second expression if you add then you will get 2 h cube by 3 positive and 2 h cube by 3 negative and they will cancel out. So, twice this will be 2 j and once this will be 1 j sum of that will be 3 j. So, in that this will be missing and that expression then if you can divide by 3 you get another value of j which is a better value in a sense that the cubic error term will be missing. So, what we do we multiply this with 2 this with 1 add up and then divide by 3. So, thereby you will get divide by 3 so one third of twice this plus this if you do that then you will get this which is the sin sense one third rule. One third rule it is called because of this one third factor coming here and the leading the error term is fifth order. Now notice that we expected up to fourth order error, but because of the symmetry we suddenly find that we have got an advantage. So, this is a fifth order formula and over a complete domain you will find that the corresponding error will be only fourth order. Now, if we use 3 n number of intervals like this rather than 2 n and then we fit a cubic through 4 points x 0 x 1 x 2 x 3 over the 3 interval and then conduct the integral then similarly we get another rule which will be a 4 point rule and that is sin sense 3 8 rule. But beyond this and in the case of sin sense 3 8 rule also you will find that the error will be only fifth order, fifth order, fourth order only just like sin sense one third rule because does not have the use of midpoint that does not have the advantage of the midpoint. Still higher order rules are not very advisable because they tend to give higher oscillation polynomials which are not true representations of the function rather in such situations we tend to use the trapezoidal rule or sin sense rule themselves in two different strategies. So, as to improve the integral estimates rather than going for rules with more number of points one very good method for finding very accurate integral with very less computational cost is through Richardson extrapolation. Now, note that Richardson extrapolation is a methodology which is applicable not only for the numerical integration problem, but for any problem in which we try to determine a quantity f through computations over a step size h. Now, if using a step size h we make an estimate estimate of h f of h. So, depending upon the step size the estimate will depend now estimate will vary now finer and finer step size that we take better and better estimate that we will get and if the error terms are h to the power p h to the power q h to the power r etcetera with this argument and if p q r have significant gaps then if we have a way to improve the estimate by leaps and bounds through every next calculation. For example, f is a quantity which we are trying to estimate with the computation being carried out with a step size h. Now, with the step size h suppose this is the value of f h with a half size of the step size suppose this is the evaluation this is the estimate one fourth size this is the estimate one eight this is the estimate one sixteen this is the estimate. Then can we not say that with very small step size the result should be something like this that is the extrapolated result based on the estimate which have been made over various different step sizes. So, this is the idea of Richardson extrapolation. So, if the correct value of f is the limit of f of delta as delta tends to zero then plotting this with the plot extrapolating to h equal to zero will get the correct value or very very accurate estimate. Now, this will work when the leading errors have certain gaps. So, for example, suppose the in the evaluation of f of h through the numerical procedure the leading error term is h to the power p and next is h to the power q next is h to the power r and so on with gap. Then with alpha h alpha less than 1 in this example I have mention taken alpha equal to half which will be using in the case of numerical integration also. Now, with alpha h step size the estimate is this similarly for alpha square h estimate is this. Now, if you take the two higher equations from here and multiply the upper one with alpha to the power p and subtract then this c unknown c will get cancelled and you will get 1 minus alpha to the power p into f and from there in between these two we will get a better estimate that is between these two this minus alpha to the power p times this will be this minus alpha to the power p times this that is here. And this one gets cancelled and 1 minus alpha to the power p with that we divide and we get a better estimate of f that is f 1 in that the leading term of error h to the power p will be missing now the leading term will be h to the power q. Similarly, if we use these two then in a similar manner we will get this minus alpha to the power p into this this part will be cancelled and then 1 minus alpha to the power p with that we divide and get another better estimate that is even better than this between these two. Now, consider in these two the evaluation has been done at one more step further in which the leading error is now of q th order here again you can see that if we subtract alpha to the power q times this from the lower one then suddenly yet another better estimate we will get in which the q order error term also will get cancelled and that we get like this that is even better estimate. So, now between 1 and 2 we get this estimate between 2 and 4 we get this estimate and then between 3 and 5 we get yet another estimate which is even better this is one way of improving the estimate of f through very limited number of actual evaluations and when we apply this Richardson extrapolation to the numerical integration problem with trapezoidal rule itself we get what is called the Romburg integral that we take the trapezoidal rule which is like this over a finite interval from a to b and then here p q r r 2 4 6 all event terms which alpha equal to half we have the advantage that in the first round we evaluated at these two points. In the second round when we subdivided the interval by two subintervals then we need to evaluate here here here, but in these locations the function values are already there only here we have to evaluate fresh and then in the next round at these three points we already have the function value at these two points we have to evaluate and so on. So, if we use the same formula then trapezoidal rule will with h equal to capital H we find one estimate then with h equal to capital H by 2 we find another estimate between these two estimates we will get a much better estimate. Similarly, with h equal to capital H by 4 we will get another estimate 1 3 now between 1 2 and 1 3 we will get another much better estimate and between these two better estimates j 2 2 and j 2 3 we will get yet another estimate which will be extremely good. Now at every step we can check whether the difference between last two best estimates is extremely small if so then we can stop or we can continue. So, this process of integration is called Lomborg integration and this gives very accurate result in a very efficient manner. Another way of using efficient means is through adaptive step size now why that is important because it may happen that there is a function which over a complete interval changes like this. Now, you will find that in this part of the domain large step sizes will give quite accurate result on the other hand here or here you will need small step sizes. So, in that kind of a situation adaptive step size helps you to get a very accurate estimate of the integral with less number of function evaluations. So, what you can do is that in the beginning you have a tolerance value epsilon which is your statement about accuracy then you can say that for every sub interval of size x i minus x i minus 1 you can assign a quota of error epsilon divided by b minus a into this sub interval size. So, every sub interval will have this much quota for errors then what you do for each interval find two estimates of the integral one over the full and one over the half. Now, if the difference you find between the two estimates and from that you estimate the error now if this error estimate is within this quota then you accept it or you subdivide the interval further this is the process of adaptive quadrature or adaptive step size in numerical integration this is quite often found very effective. Another situation that arises is if you have the function as tabulated data and tabulated data is not necessarily over equal number of intervals. For example, for this function suppose you have got the tabulated data at these x values then all that you can do is use these function values only you cannot evaluate the function anywhere else suppose these are the function values and from that you have to integrate. Now, for this kind of a situation you can do two things one over every interval with unequal sizes now you use trapezoidal rule and sum up one two three four five six seven seven such integral you just take the sum this is one way to do it the other way to do it is through these function values through these data points you fit a spline the way we discussed in the previous lesson you fit a spline and then conduct the integral of that spline this is another way either spline or any such other continuous representation of the function. So, these are two different ways of handling the integral problem when all that you can use is function values given at certain data points and you cannot evaluate the function at any other point. So, there either you use trapezoidal rule over single sub intervals and add or you fit a continuous representation through function interpolation method and then use that composite function to evaluate the integral. Now, sometimes you find that the integral when you try to develop then the function value at the end of the interval is not appropriately defined such integrals are improper integral and in that case these rules trapezoidal rule or since one third rule etcetera you cannot use. And these formulas which are called Newton codes closed formulas they are not applicable in such situations where the end point of the interval is improper where then at the end point of the interval the function is not defined. For example, for this kind of a function where the end points of the interval have do not have the function defined at those points. So, in such situations these rules these rules formulae which will require you to provide the end point function values will fail. In such cases you can resort to similar open Newton codes formulas which do not need the end point value or you can use Gaussian quadrature. Now, in the next chapter of the book we discuss Gaussian quadrature, but for the purpose of the course we will omit that, but from the next lesson next chapter of the book will take one very simple, but very powerful formulation and that is in multiple integral. Now, just like ordinary single integral you have such Simpson's rules etcetera for multiple integrals also. And for example, over a rectangular domain square domain minus 1 to 1 minus 1 to 1 over x y you get this as the two dimensional version of Simpson's one third rule which will be accurate for a y cube up to a y cubic function. The way a single variable function f x for that the Simpson's one third rule is correct up to a cubic function. So, this will be exact for up to y cubic, but this is not what we want to discuss. I will discuss here quickly a very powerful integration method called Monte Carlo integration which is a stochastic method and it is very useful for evaluating multiple integrals over very complicated domains. For example, over this domain a function is defined and this is the domain of integration and you want to integrate function f x over this domain. Now, the description of the domain itself makes the thing quite complicated and over that the development of the integral is difficult. Now, in such situations Monte Carlo method of integration gives you a very quick and handy way to get the integral and for that requirements are very simple. You want a simple volume in the case of a two variable problem it is an area a simple volume enclosing the domain omega that is suppose this is the domain omega and what you need is a straight forward simple volume simple region geometrically simple region which encloses this completely. For such purposes this rectangle can be that domain this is easy. Now, suppose this is x i this is x f that is initial f final f. Similarly, this is y i and this is y f initial y final y. So, this is the selected domain. Now, it is very easy to find points which are in this rectangular domain it was extremely difficult to find points which are there in the domain omega because of the shape of the domain, but it is extremely easy to find points which are inside this. Now, this is one requirement you have to have a description of a straight forward geometrically simple region which completely encloses the domain and you must have a point classification scheme. That is after a point has been thrown inside this rectangular domain you should be able to tell whether that point is also inside the domain omega or not whether it is here or here. With these two things in hand we can generate random points in this big volume v in the domain v and then if the point is within omega also then we count f x and if it is not within omega then we count 0 and then we go on adding and as we add up all these capital effects values taking the actual function value if it falls within our domain 0 otherwise then the sum of all these function values divided by n into the volume of this gives us the Monte Carlo integration value. Now you know that larger capital N more accurate will be the result. Now the practical implementation practical use of this Monte Carlo method Monte Carlo integration will require you to first make an estimate based on some value of n say n equal to 100 make that estimate. Then in a fresh bid make the same estimate with n equal to 500 and then n equal to 1000 then n equal to 5000 and as you increase n after a point you will find that this estimate does not change much that means that number of points that number of random points is enough for this problem and this gives you a very good estimate of the integral. So other issues in the chapter are related to Gauss quadrature and that you can cover at your leisure for the purposes of our course we are omitting that and in the next lecture we will go into the very important topic of numerical solution of ordinary differential equations. Thank you.