Magnetar 0 Posted May 29 Share Posted May 29 I have attached a picture below, and the thought of this idea is confusing me too much. -> In the first graph, I have taken the area of a single rectangle (say, first rectangle) as M * Δx , where M represents the arithmetic mean of f(x) and f(x) + Δy ( Δy is f(x+Δx) - f(x) ) which i thought would givea better approximation of the area as opposed to directly taking area as f(x)Δx So the question,(please see the pic first) why dont we take the area under a curve as ∫ (f(x) + dy/2)dx? because when Δx is big, the expression of area under a curve as ∫ (f(x) + Δy/2)Δx would give a more precise result. will it give the same as Δx approaches 0? Please tell where am i going wrong. p.s. - I am a newbie at calculus, so bear with me if my question is stupid Link to post Share on other sites

joigus 461 Posted May 29 Share Posted May 29 (edited) The result of the integral doesn't depend on which approximation you use. The second one is called the lower Riemann sum. There is another one with starts with what you would call \(f\left(x_{0}+\triangle x\right)\) instead of \(f\left(x_{0}\right)\), and ends with \(f\left(x_{1}\right)\) instead of \(f\left(x_{1}-\triangle x\right)\) It's called the upper Riemann sum. Your expression differs only in a second-order term in \(\triangle x\). You only see a big difference because your \(\triangle x\) is enormous in the image. You can actually do an even better fit by taking a polygonal approach to the curve (for the same step \(\triangle x\).) https://www.geogebra.org/t/upper-and-lower-sum?lang=en Sorry. This is the applet that I meant to show you. You must play with the n=10. Take it up to n=24, for example, and you'll see what I mean. https://www.geogebra.org/m/SNS8SYSg Edited May 29 by joigus 2 Link to post Share on other sites

Magnetar 0 Posted May 30 Author Share Posted May 30 10 hours ago, Magnetar said: -> In the first graph, I have taken the area of a single rectangle (say, first rectangle) as M * Δx , where M represents the arithmetic mean of f(x) and f(x) + Δy ( Δy is f(x+Δx) - f(x) ) which i thought would give a better approximation of the area as opposed to directly taking area as f(x)Δx I would like to rephrase. By saying that i took the area of the rectangle as (f(x)+Δy/2)Δx in the first graph , i meant to say that i took the height of an individual rectangle as [f(x)+f(x+Δx)]/2 ( not as f(x), neither as f(x+Δx) )to get the mean height, or when Δx is big, a better approximation of the area as Σ [{f(x)+f(x+Δx)}/2]*Δx 10 hours ago, Magnetar said: So the question,(please see the pic first) why dont we take the area under a curve as ∫ (f(x) + dy/2)dx? because when Δx is big, the expression of area under a curve as ∫ (f(x) + Δy/2)Δx would give a more precise result. will it give the same as Δx approaches 0? Again rephrasing, why dont we take the area under a curve as ∫ {f(x)+f(x+dx)}/2*dx? because when Δx is big, the expression for area under a curve as Σ [{f(x)+f(x+Δx)}/2]*Δx would give a more precise result. Will it give the same as Δx approaches zero? Link to post Share on other sites

timo 583 Posted May 30 Share Posted May 30 (edited) Yes, both methods approach the same limit. In this case, you can explicitly write that down: Assume you integrate from 0 to 1, and you split the range into N intervals of equal length. In the first case, your integral approximates as [math]I_{1, N} = \frac 1N \sum_{i=0}^{N-1} f(i/N) = \frac 1N \left( f(0) + f(1/N) + f(2/N) + \dots + f((N-1)/N) \right)[/math]. In the second case, your integral approximates as [math]I_{2, N} = \frac 1N \sum_{i=0}^{N-1} \frac 12 \left( f(i/N) + f((i+1)/N) \right) = \frac 1N \left( \frac 12 f(0) + f(1/N) + f(2/N) + \dots + f((N-1)/N) + \frac 12 f(1) \right) [/math]. If you compare the terms, you notice that [math]I_{1, N} - I_{2, N} = \frac 1N \frac 12 (f(0) - f(1) ) = \frac{f(0) - f(1)}{2N}.[/math] So whatever finite numbers f(0) and f(1) are, the difference between the two ways to approximate the integral becomes tiny when N becomes large enough. Btw: This editor is horrible: Preview should preview the rendered tex, not show me the raw tex I typed for different screen sizes. I want my editor from ten years ago back. Edited May 30 by timo 2 Link to post Share on other sites

Magnetar 0 Posted May 31 Author Share Posted May 31 ok thanks i understood ! I always thought why isnt the integral calculated in the first way, but now I understood Link to post Share on other sites

timo 583 Posted June 3 Share Posted June 3 (edited) Joigus already mentioned is implicitly, but I think it's worth pointing it out explicitly: When it comes to the exact integral, the different methods with equal-width rectangles that approach dx->0 do approach the same limit (with some exceptions that are not relevant here). And this common limit is called "the integral". For many important functions, e.g. polynomials, we know how to compute the limit exactly. And we don't even care about the rectangle construction in these cases, and just jump to the known solution - which does not depend on the exact rectangle-method that has been used. Now: When it comes to functions for which we do not have a known solution, we often have to fall back to what is called "numerical integration". In this case, we use a single, small dx, but we do not take the limit dx->0. Then, we brute-force the approximation by summing up all the individual rectangle results (computers are very good at doing stupid, repetitive tasks very quickly). In this case, the method you propose (f(x0)/2 + f(x1)/2) is indeed considered superior over the simplest approximation (f(x0)). The calculation I showed in my previous post still holds, but N now is a fixed number that does not become arbitrarily large. In practice, the method you proposed is usually the simplest choice for numerical integration that someone with a bit of knowledge about numerical integration will use. Numerical integration routines integrated in programming languages or software libraries will often use even more complicated rules to calculate each rectangle (arguably not even a rectangle, but still dx-sized segments and a representative mean function value for each segment). Bottom line: Don't worry if you don't understand everything in this post. My point is: Your idea about improving the rule to calculate the integral is actually very good. It does not matter much for the definition of the integral (well .. it does in the sense that the definition of the integral would be broken if it gave a different result). But for numerical integration on a computer, your idea is actually very relevant. Edited June 3 by timo 1 Link to post Share on other sites

## Recommended Posts

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account## Sign in

Already have an account? Sign in here.

Sign In Now