How to Add 1 through 100 using Calculus

Earlier we saw a few ways toadd a set of numbers (1 to 10).

增加1到100个策略

And the formula we found was:

\displaystyle{\text{Sum from 1 to n} = \frac{n(n+1)}{2}}

\displaystyle{\text{Sum from 1 to 100} = \frac{100(100+1)}{2} = (50)(101) = 5050}

It seems that regular arithmetic, algebra, geometry, or even statistics could help work out the equation.

But how about Calculus? Is this bringing a nuclear missile to a gun fight?

Let's find out.

The sequence to add (1 2 3 4 5 6 7 8 9 10...) looks a lot like $f(x) = x$. At every position on the x-axis, we put in a number and get the same one out.

Intuitively, the integral is "repeatedly adding a bunch of stuff" -- it seems like we could put it to work. From the rules of Calculus (orusing Wolfram Alpha) we get this:

\displaystyle{ \int x = \frac{1}{2} x^2 }

Intuitively: Add up things following the $f(x) = x$ pattern and you end up with $\frac{1}{2} x^2$.

我们来看一下,1到100的和是5050。But using the Calculus equation we get:

\displaystyle{ \frac{1}{2} x^2 = \frac{1}{2}100^2 = \frac{10,000}{2} = 5000 }

Uh oh: there's a difference. What's going on?

Calculus works with continuous patterns, and we used a discrete one.

Here's what's happening:

calculus add area under x

Calculus was built to measuresmoothly changing functions,如直线、抛物线、圆等。我们看到的模式是一个跳跃的楼梯(从1到2,从来没有经过1.5,或1.1,或1.0001)。在数学课上,书籍总是在分析一个函数是否“连续”,也就是变化是否足够平滑,以使微积分发挥作用。

So when a pattern changes smoothly, Calculus works great. If a pattern changes suddenly, Calculus can only give an approximate answer. So what's the plan?

在平滑部分尽可能使用微积分,在跳跃部分调整误差。

calculus integral of x discrete

The area under the line is the integral. We a bunch of triangles above the line we need to include.

  • How many of them? 1 for each item (x)
  • How big are they? They're half a of a 1x1 square, so they have area 1/2.
  • What's the total area to add back in? $x \frac{1}{2} = \frac{x}{2}$

So our final formula should be

\displaystyle{\text{Integral} + \text{Adjustment} = \frac{1}{2} x^2 + \frac{x}{2}}

Aha! Learning Calculus doesn't mean we hunt around for Official Calculus Problems.

Nope. Take your scenario (adding 1 to 100) and realize what Calculus brings to the table: finding patterns in smoothly changing functions. Use Calculus on the smooth parts and adjust (or ignore) the other parts.

(Ironically, Calculus works by making jumpy approximations for smooth functions, and is in fact "jumpy" under the hood. If you are planning on working with jumpy patterns, useDiscrete Calculus.)

Example: Adding the first n squares

Let's take this further: what's your guess for the sum of the first 100 square numbers?

\displaystyle{1^2 + 2^2 + 3^2 + 4^2 +…+ 100^2}

Hrm. Getting the exact formula is tricky. But maybe we don't need the exact count, just an estimate.

在微积分中,我们会说:模式不是连续的,但它看起来像$f(x) = x^2$。对x^2从0到100积分。

\displaystyle{ \int x^2 = \frac{1}{3} x^3 }

不定积分是$\frac{1}{3} x^3 $,我们总共有多少。From 0 to 100 it would be

\displaystyle{ \frac{1}{3}100^3 = \frac{1,000,000}{3} \sim 333,333 }

That's our guess, without a calculator. And the actual answer? 338350.

calculus area under x squared

How close were we? 99.9%. Not bad for something we worked out by hand in a minute!

Truly internalizing Calculus means it helps other elements of your math understanding, even regular addition problems.

Happy math.

PS. To keep building your intuition, check out theCalculus Guide.

Other Posts In This Series

  1. A Gentle Introduction To Learning Calculus
  2. Understanding Calculus With A Bank Account Metaphor
  3. Prehistoric Calculus: Discovering Pi
  4. A Calculus Analogy: Integrals as Multiplication
  5. Calculus: Building Intuition for the Derivative
  6. How To Understand Derivatives: The Product, Power & Chain Rules
  7. How To Understand Derivatives: The Quotient Rule, Exponents, and Logarithms
  8. An Intuitive Introduction To Limits
  9. Intuition for Taylor Series (DNA Analogy)
  10. Why Do We Need Limits and Infinitesimals?
  11. Learning Calculus: Overcoming Our Artificial Need for Precision
  12. A Friendly Chat About Whether 0.999... = 1
  13. Analogy: The Calculus Camera
  14. Abstraction Practice: Calculus Graphs
  15. Quick Insight: Easier Arithmetic With Calculus
  16. How to Add 1 through 100 using Calculus
  17. Integral of Sin(x): Geometric Intuition

Join 450k Monthly Readers

Enjoy the article? There's plenty more to help you build a lasting, intuitive understanding of math. Join the newsletter for bonus content and the latest updates.