I’m doing something that I should have done a long time ago: collecting a series of posts into one single post. The links below show my series on numerical integration.

I am pleased to announce that my latest paper, “Parabolic Properties from Pieces of String,” has now been published in Math Horizons. This was a really fun project for me. As I describe in the paper, I started wondering if it was possible to convince a student who hadn’t learned calculus yet that string art from two line segments traces a parabola. Not only was I able to come up with a way of demonstrating this without calculus, but I was also able to (1) prove that a quadratic polynomial satisfies the focus-directrix property of a parabola, which is the reverse of the usual logic when students learn conic sections, and (2) prove the reflective property of parabolas. I was really pleased with the final result, and am very happy that this was accepted for publication.

Due to copyright restrictions, I’m not permitted to freely distribute the final, published version of my article. However, I am able to share the following version of the article.

I recently came across the following computational trick: to estimate , use

,

where is the closest perfect square to . For example,

.

I had not seen this trick before — at least stated in these terms — and I’m definitely not a fan of computational tricks without an explanation. In this case, the approximation is a straightforward consequence of a technique we teach in calculus. If , then , so that . Since , the equation of the tangent line to at is

.

The key observation is that, for , the graph of will be very close indeed to the graph of . In Calculus I, this is sometimes called the linearization of at . In Calculus II, we observe that these are the first two terms in the Taylor series expansion of about .

For the problem at hand, if , then

if is close to zero. Therefore, if is a perfect square close to so that the relative difference is small, then

.

One more thought: All of the above might be a bit much to swallow for a talented but young student who has not yet learned calculus. So here’s another heuristic explanation that does not require calculus: if , then the geometric mean will be approximately equal to the arithmetic mean . That is,

Last week, I posted that my latest paper, “A New Derivation of Snell’s Law without Calculus,” has now been published in College Mathematics Journal. In that previous post, I didn’t provide the complete exposition because of my understanding of copyright restrictions at that time.

I’ve since received requests for copies of my paper, which prompted me to carefully read the publisher’s copyright restrictions. In a nutshell, I was wrong: I am allowed to widely distribute preprints that did not go through peer review and, with extra restrictions, the accepted manuscript after peer review.

I’m pleased to say that my latest paper, “A New Derivation of Snell’s Law without Calculus,” has now been published in College Mathematics Journal. The article is now available for online access to anyone who has access to the journal — usually, that means members of the Mathematical Association of America or anyone whose employer (say, a university) has institutional access. I expect that it will be in the printed edition of the journal later this year; however, I’ve not been told yet the issue in which it will appear.

Because of copyright issues, I can’t reproduce my new derivation of Snell’s Law here on the blog, so let me instead summarize the main idea. Snell’s Law (see Wikipedia) dictates the angle at which light is refracted when it passes from one medium (say, air) into another (say, water). If the velocity of light through air is while its velocity in water is , then Snell’s Law says that

I was asked by a bright student who was learning physics if there was a way to prove Snell’s Law without using calculus. At the time, I was blissfully unaware of Huygens’s Principle (see OpenStax) and I didn’t have a good answer. I had only seen derivations of Snell’s Law using the first-derivative test, which is a standard optimization problem found in most calculus books (again, see Wikipedia) based on Fermat’s Principle that light travels along a path that minimizes time.

Anyway, after a couple of days, I found an elementary proof that does not require proof. I should warn that the word “elementary” can be a loaded word when used by mathematicians. The proof uses only concepts found in Precalculus, especially rotating a certain hyperbola and careful examining the domain of two functions. So while the proof does not use calculus, I can’t say that the proof is particularly easy — especially compared to the classical proof using Huygens’s Principle.

That said, I’m pretty sure that my proof is original, and I’m pretty proud of it.

I end this series about numerical integration by returning to the most common (if hidden) application of numerical integration in the secondary mathematics curriculum: finding the area under the normal curve. This is a critically important tool for problems in both probability and statistics; however, the antiderivative of cannot be expressed using finitely many elementary functions. Therefore, we must resort to numerical methods instead.

In days of old, of course, students relied on tables in the back of the textbook to find areas under the bell curve, and I suppose that such tables are still being printed. For students with access to modern scientific calculators, of course, there’s no need for tables because this is a built-in function on many calculators. For the line of TI calculators, the command is normalcdf.

Unfortunately, it’s a sad (but not well-known) fact of life that the TI-83 and TI-84 calculators are not terribly accurate at computing these areas. For example:

TI-84:

Correct answer, with Mathematica:

TI-84:

Correct answer, with Mathematica:

TI-84:

Correct answer, with Mathematica:

TI-84:

Correct answer, with Mathematica:

TI-84:

Correct answer, with Mathematica:

TI-84:

Correct answer, with Mathematica:

I don’t presume to know the proprietary algorithm used to implement normalcdf on TI-83 and TI-84 calculators. My honest if brutal assessment is that it’s probably not worth knowing: in the best case (when the endpoints are close to 0), the calculator provides an answer that is accurate to only 7 significant digits while presenting the illusion of a higher degree of accuracy. I can say that Simpson’s Rule with only subintervals provides a better approximation to than the normalcdf function.

For what it’s worth, I also looked at the accuracy of the NORMSDIST function in Microsoft Excel. This is much better, almost always producing answers that are accurate to 11 or 12 significant digits, which is all that can be realistically expected in floating-point double-precision arithmetic (in which numbers are usually stored accurate to 13 significant digits prior to any computations).

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:

Why is numerical integration necessary in the first place?

Where do these formulas come from (especially Simpson’s Rule)?

How can I do all of these formulas quickly?

Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?

Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?

Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?

In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.

In this series, we have shown the following approximations of errors when using various numerical approximations for . We obtained these approximations using only techniques within the reach of a talented high school student who has mastered Precalculus — especially the Binomial Theorem — and elementary techniques of integration.

As we now present, the formulas that we derived are (of course) easily connected to known theorems for the convergence of these techniques. These proofs, however, require some fairly advanced techniques from calculus. So, while the formulas derived in this series of posts only apply to (and, by an easy extension, any polynomial), the formulas that we do obtain easily foreshadow the actual formulas found on Wikipedia or Mathworld or calculus textbooks, thus (hopefully) taking some of the mystery out of these formulas.

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:

Why is numerical integration necessary in the first place?

Where do these formulas come from (especially Simpson’s Rule)?

How can I do all of these formulas quickly?

Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?

Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?

Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?

In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.

In this previous post in this series, we showed that the Simpson’s Rule approximation of has an error of

.

In this post, we consider the global error when integrating on the interval instead of a subinterval .
The total error when approximating will be the sum of the errors for the integrals over , , through . Therefore, the total error will be

So that this formula doesn’t appear completely mystical, this actually matches the numerical observations that we made earlier. The figure below shows the left-endpoint approximations to for different numbers of subintervals. If we take and , then the error should be approximately equal to

,

which, as expected, is close to the observed error of .
Let , so that the error becomes

,

where is the average of the . (We notice that there are only terms in this sum since we’re adding only the even terms.) Clearly, this average is somewhere between the smallest and the largest of the . Since is a continuous function, that means that there must be some value of between and — and therefore between and — so that by the Intermediate Value Theorem. We conclude that the error can be written as

,

Finally, since is the length of one subinterval, we see that is the total length of the interval . Therefore,

,

where the constant is determined by , , and . In other words, for the special case , we have established that the error from Simpson’s Rule is approximately quartic in — without resorting to the generalized mean-value theorem and confirming the numerical observations we made earlier.

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:

Why is numerical integration necessary in the first place?

Where do these formulas come from (especially Simpson’s Rule)?

How can I do all of these formulas quickly?

Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?

Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?

Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?

In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.

In this post, we will perform an error analysis for Simpson’s Rule
where is the number of subintervals (which has to be even) and is the width of each subinterval, so that .

As noted above, a true exploration of error analysis requires the generalized mean-value theorem, which perhaps a bit much for a talented high school student learning about this technique for the first time. That said, the ideas behind the proof are accessible to high school students, using only ideas from the secondary curriculum (especially the Binomial Theorem), if we restrict our attention to the special case , where is a positive integer.

For this special case, the true area under the curve on the subinterval will be

In the above, the shorthand can be formally defined, but here we’ll just take it to mean “terms that have a factor of or higher that we’re too lazy to write out.” Since is supposed to be a small number, these terms will small in magnitude and thus can be safely ignored.

Earlier in this series, we derived the very convenient relationship relating the approximations from Simpson’s Rule, the Midpoint Rule, and the Trapezoid Rule. We now exploit this relationship to approximate . Earlier in this series, we found the Midpoint Rule approximation on this subinterval to be
while we found the Trapezoid Rule approximation to be

.

Therefore, if there are subintervals, the Simpson’s Rule approximation of — that is, the area under the parabola that passes through , , and — will be . Since

,

,

and

,

we see that

.

We notice that something wonderful just happened: the first four terms of perfectly match the first four terms of the exact value of the integral! Subtracting from the actual integral, the error in this approximation will be equal to
Before moving on, there’s one minor bookkeeping issue to deal with. We note that this is the error for , where subintervals are used. However, the value of in this equal arose from and , where only subintervals are used. So let’s write the error with subintervals as

,

where is the width of all of the subintervals. By analogy, we see that the error for subintervals will be

.

But even after adjusting for this constant, we see that this local error behaves like , a vast improvement over both the Midpoint Rule and the Trapezoid Rule. This illustrates a general principle of numerical analysis: given two algorithms that are , an improved algorithm can typically be made by taking some linear combination of the two algorithms. Usually, the improvement will be to ; however, in this example, we magically obtained an improvement to .

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:

Why is numerical integration necessary in the first place?

Where do these formulas come from (especially Simpson’s Rule)?

How can I do all of these formulas quickly?

Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?

Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?

Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?

In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.

In the previous post, we showed that the Trapezoid Rule approximation of has error
In this post, we consider the global error when integrating on the interval instead of a subinterval . The logic is almost a perfect copy-and-paste from the analysis used for the Midpoint Rule.
The total error when approximating will be the sum of the errors for the integrals over , , through . Therefore, the total error will be

.

So that this formula doesn’t appear completely mystical, this actually matches the numerical observations that we made earlier. The figure below shows the left-endpoint approximations to for different numbers of subintervals. If we take and , then the error should be approximately equal to

,

which, as expected, is close to the actual error of .
Let , so that the error becomes

,

where is the average of the . Clearly, this average is somewhere between the smallest and the largest of the . Since is a continuous function, that means that there must be some value of between and — and therefore between and — so that by the Intermediate Value Theorem. We conclude that the error can be written as

,

Finally, since is the length of one subinterval, we see that is the total length of the interval . Therefore,

,

where the constant is determined by , , and . In other words, for the special case , we have established that the error from the Trapezoid Rule is approximately quadratic in — without resorting to the generalized mean-value theorem and confirming the numerical observations we made earlier.