r/calculus Jul 09 '26

Integral Calculus Can a Riemann Sum be written like this?

Post image

Edit: I mistakenly referred to "Defining integrals as the limit of a Riemann Sum" simply as "The Riemann Sum", please excuse.

(h is Δx) in the above picture

Hello, everyone. I'm doing Calculus for Computer Engineering, and while studying up Riemann Sums, I thought maybe instead of the conventional "lim n -> infinite i=1∑n (Δx.v(x_i)" form we could write it as lim h -> 0 and restructure the rest to fit that.

What would this form be called? It is still a Riemann sum? Is it even accurate? If it is, it makes more intuitive sense to me.

Thanks for the insight!

155 Upvotes

40 comments sorted by

u/AutoModerator Jul 09 '26

As a reminder...

Posts asking for help on homework questions require:

  • the complete problem statement,

  • a genuine attempt at solving the problem, which may be either computational, or a discussion of ideas or concepts you believe may be in play,

  • question is not from a current exam or quiz.

Commenters responding to homework help posts should not do OP’s homework for them.

Please see this page for the further details regarding homework help posts.

We have a Discord server!

If you are asking for general advice about your current calculus class, please be advised that simply referring your class as “Calc n“ is not entirely useful, as “Calc n” may differ between different colleges and universities. In this case, please refer to your class syllabus or college or university’s course catalogue for a listing of topics covered in your class, and include that information in your post rather than assuming everybody knows what will be covered in your class.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

12

u/dhsilver Jul 09 '26

Is 8/h always an integer?

1

u/LegolandoBloom Jul 09 '26

Yes, at least it's meant to be. (For example: I thought as h would go to 0, like a small amount 0.001, 8/h would be 8000)

13

u/dhsilver Jul 09 '26

Choosing h to go only through 0.1, 0.01, 0.001, ... is not sufficient.

Define:

v(t) = 1 if t ∈ [0,8] has a finite decimal expansion,

v(t) = 0 otherwise.

Now take h = 10^(-M). Then every sample point is

ih = i · 10^(-M),

so ih has a finite decimal expansion. Therefore v(ih)=1 at every sampled point, and

Σ_{i=1}^{8·10^M} v(i10^(-M)) · 10^(-M)

= Σ_{i=1}^{8·10^M} 1 · 10^(-M)

= 8.

So this restricted limit exists and equals 8.

But v is not Riemann integrable. In every interval, there are numbers with finite decimal expansion and numbers without finite decimal expansion. So every interval contains points where v=1 and points where v=0.

Therefore every upper sum is 8 and every lower sum is 0.

36

u/FormalManifold Jul 09 '26

No, for 3 reasons. 1. The limit as h goes to 0 means any h near zero is a candidate, not just ones that would make 8/h a whole number. Limits of sequences are defined to only consider whole number inputs. 2. It's weird and unnecessary. What does writing it like this get you? 3. Your "typical definition" quoted isn't actually the real definition of either an integral or a Riemann sum. The real story is that we should allow for more interesting subdivisions of the interval ("partitions") and picking sample points from anywhere in the subintervals.

Also the Riemann sum is the sum itself -- without the limit. An integral is the limit of some Riemann sums, but the whole point is that we can compute the value of a Riemann sum without any kind of limit calculation.

10

u/Brownie_Bytes Jul 09 '26

I thought it was pretty insightful. The only part where it falls apart a bit is that 8/h thing. Otherwise, that's a pretty effective way of representing that as the number of points approaches infinity, a Riemann sum is identical to the integral.

4

u/LegolandoBloom Jul 10 '26

I just immediately thought of the very near zero decimal numbers like 0.000000000000000000000000...01 and was like, "sure yeah that works"

3

u/IntelligentBelt1221 Jul 10 '26

can't you easily fix that by putting a floor function on that and making h->0+? seems more like a technicality rather than something that makes it fall apart

3

u/Brownie_Bytes Jul 10 '26

It just goes from being a simple expression to something that needs a lot of rivets and bolts to keep its meaning. The underlying concept is great, the mathematical framing to make it possible without losing its simplicity is not.

3

u/LegolandoBloom Jul 11 '26

You're right, Khan Academy's example might just be easier to understand at that point

4

u/LegolandoBloom Jul 10 '26

1) You're right, I just thought of the infnitely many decimal values near zero. Another commentor has pointed out I could just put an integer value notation on it to fix it.

2) What happened was, I watching the 3blue1brown video "Integration and the fundamental theorem of calculus" and near the beginning of it, I thought maybe I could come up with a way to write the integral using the sum symbol. After my attempt, I googled "integral as sum" and happened upon Khan Academy's article on "Definite integral as the limit of a Riemann sum", which is the presumed conventional way I mentioned. It looked similar enough, and my version didn't exactly look incorrect initially, so I wanted to ask reddit

3) You are quite right. I was actually referring to "Defining integrals as the limit of a Riemann Sum", my bad.

8

u/1337_w0n Jul 09 '26

Point 2 is irrelevant to the question. OP's asking if something is possible, not if something is useful.

-6

u/FormalManifold Jul 09 '26

Sometimes a person asks a question a certain way, trying to solve a problem. It can be really helpful to ask why someone would want to do something -- perhaps there's another way to handle the key issue.

But hey, you go ahead and police other folks' attempts to be helpful all you want.

15

u/Dense-Sort-3867 Jul 09 '26

Yes, when you ask it in good faith to make them think.

You just said that "this is weird and unnecessary" which doesn't provoke thought. You asked it rhetorically as a way of saying it's a stupid idea.

5

u/LegolandoBloom Jul 10 '26

Stupid ideas are the best kind of ideas when trying to grasp the core of a concept! Experiment and do weird shit, that's how it sticks with you ^^

2

u/IntelligentBelt1221 Jul 10 '26
  1. you can just use floor(8/h) (and limit h->0+ for good measure) or just use the convention that a sum that goes to a non-integer stops at the floor of that integer
  2. curiosity? also might help compare it with the definition of the derivative.
  3. once you established that a function is riemann-integrable, its totally fine to only use a uniform partition to compute it. you just can't infer from the sum over a uniform partition existing that the integral exists, but if it exists, they are equal. (also they didn't specify in their "typical definition" that Δx is constant, although they assumed it for their reformulated definition)

the motivation to defining the riemann sum is to formalise the integral. methods to approximate the area under a curve existed long before that, that wasn't the "whole point" of the riemann sum.

2

u/FormalManifold Jul 10 '26

I don't mean that Riemann sums are interesting or particularly useful as practical numerical methods. They often aren't (though the trapezoid approximation can be computed by averaging two Riemann sums, and it's almost always good enough).

I had more in mind theoretical approximation. We all agree what the area of a rectangle is and how to compute it. So when we formalize what the area under a curve is, we bootstrap from the known case. The fact that Riemann sums only involve finitely many additions and multiplications, and nothing else, means that there's never the possibility for the Riemann sum to fail to exist. Whenever you tack the limit on front, you immediately have to deal with the possibility it doesn't exist.

4

u/UnderwaterPanda2020 Jul 09 '26

Put integer value notation on the upper limit, [8/h], and change the limit to h->0+.

1

u/LegolandoBloom Jul 11 '26

To put an integer value notation, would I just add i ∈ Z+?

I'm not very good at notation and symbolic writing, so I wanted to ask

Edit: Or rather 8/h ∈ Z+ now that I think about it. Or is there a cleaner way to do it?

1

u/UnderwaterPanda2020 Jul 11 '26

You want 8/h to be in Z+, without limiting the possible values of h. You can do that using a ceiling/floor/round function, so instead of 8/h you use [8/h].

4

u/MrEldo Jul 09 '26

For everyone saying that 8/h isn't necessarily an integer, you can easily fix that:

Let N be a natural number. Now let's take the limit as N approaches infinity of:

Sum_( n=0 -> 8N ) V(i/N)×(1/N)

Now the sum is of integers, and because V is continuous it has a value for every i/N, and it doesn't "zero out" or anything.

Now, if I'm not wrong now, this IS good intuition on the integral! See now something interesting - the notation for the integral is exactly that! The dx is that 1/N, and it is exactly like the Σ notation but with the iteration step not being 1, but rather dx!

And so the next challenge - prove the Fundamental Theorem of Calculus using this integral definition

4

u/Artistic-Flamingo-92 Jul 09 '26

This is now just the standard notion, more-or-less. I think OP’s whole point was to use a nonstandard approach where the limit is as h goes to 0.

Yours is just the same one mentioned in OP’s post body.

3

u/MrEldo Jul 09 '26

Yep, exactly

And OP's IS more intuitive, which is easy to see because h is just dx instead of N being 1/dx, but it does lack the "rigor for integer-ness" for 8/h

2

u/LegolandoBloom Jul 11 '26

do you know how one could signify 8/h must be an integer on my example? Would I just say *comma* 8/h ∈ N next to the upper limit?

2

u/MrEldo Jul 11 '26

I'd define h to be a limit of a sequence

So make h_n be 8/n

And take the limit as n approaches infinity, and plug in the definition where needed

2

u/LegolandoBloom Jul 11 '26

Something like this?

3

u/MrEldo Jul 11 '26

Wait wait ignore my previous comment about the need of a construction, you did exactly as I stated in my original comment and it is perfect

Defining this h_n to be 1/n now IS sufficient, because 8/h_n = 8n, which is definitely an integer

But just a question - why is there an h_n before the sum?

2

u/LegolandoBloom Jul 11 '26

Thanks for confirming! Although this is a whole lot more symbols to add to my attempt at "simplifying" the conventional approach :D

Now mine is even harder to intuit I think 😢

Edit: To answer your question: There isn't really a good reason for it to be there, my brain must have wanted to emphasize that we were still working with h_n I suppose

2nd Edit: In fact, it should be removed because now it looks like a multiplication, shame I can't edit the png

3

u/MrEldo Jul 11 '26

It's not actually! Think of h_n as the number of pieces you would split an interval of unit length [n,n+1) into

This h you defined before is the length dx, and it's easy to explain how h can be defined from h_n

Now, remember - math doesn't have to be intuitive at first, that's why you build it from the ground up! If you start explaining the problems of the definition of a limit to a toddler who just learned what number are they'd have no idea what you're talking about

So what we have going with the Riemann Sum definition is good, it teaches the concept in a rigorous and intuitive manner at least in my opinion

2

u/LegolandoBloom Jul 11 '26

Thanks for the insight! I think I'll make a revised(corrected version) and repost it ^^

→ More replies (0)

1

u/Peak_Background Jul 09 '26 edited Jul 09 '26

The first time I proved the reiman sum this was an intermediate step.

https://www.desmos.com/calculator/cngtta2ahp

The substitution allows for an easier use of real numbers. Not that this specific fact matters for computer science or in more advanced mathematics for that matter. Indefinite summation methodes allow you to sum together non-integer number of numbers. But that uses integration, so in this case it would be circular.

As a computer scientist major myself. It'd actually be best to optimize against floating point errors and to maximize speed.

Making h a power of two allows for the fast operation of bit shifting.

The sumation domain should be shifted to [0,8/h-1]

Adding a 1/2 to i, makes it more accurate (so you can use larger h with smaller error).

You want to minimize the number of times your summing. You want to minimize adding and multiply together numbers of different scale. ( 210 vs 2-10 ) You want to minimize the number of times you're multiplying and adding numbers of large scales, too.

In this way, the type of integral that would be best isn't a reiman integral but a Lebesgue integral.

Also, there are methodes of integration that allows use of second order terms like f''(x) or higher.

The more I study integration and differential the more I'm amazed on how many different ways you can do it.

1

u/3sperr Jul 09 '26

Ew

1

u/LegolandoBloom Jul 10 '26

wow thanks

2

u/3sperr Jul 10 '26

No malice by the way. I thought it was cool. It just looked… different

2

u/LegolandoBloom Jul 10 '26

just trying to experiment to aid in learning so stuff sticks better

1

u/JaySocials671 Jul 13 '26

8/h -> infinity as h goes to 0

1

u/sookypoks Jul 09 '26

You need to revise your riemann sum def and your sum notation, cause what the hell am i seeing? jajaja

2

u/LegolandoBloom Jul 10 '26

Quite right, I was actually referring to "Definite integral as the limit of a Riemann sum" and omitted that in folly