# Thoughts on Numerical Integration (Part 7): Implementation with Excel

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 in this series, I discussed three different ways of numerically approximating the definite integral $\displaystyle \int_a^b f(x) \, dx$, the area under a curve $f(x)$ between $x=a$ and $x=b$.

In this series, we’ll choose equal-sized subintervals of the interval $[a,b]$. If $h = (b-a)/n$ is the width of each subinterval so that $x_k = x_0 + kh$, then the integral may be approximated as

$\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n$

using left endpoints,

$\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n$

using right endpoints, and

$\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n$

using the midpoints of the subintervals. We have also derived the Trapezoid Rule

$\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n)] \equiv T_n$

and Simpson’s Rule (if $n$ is even)

$\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{3} \left[y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{n-2} + 4 y_{n-1} + y_{n} \right] \equiv S_n$.

Computing any of the above formulas on a hand-held calculator can tax the patience of even the most error-conscious student. Indeed, I prefer that my students, when first learning these concepts, use a spreadsheet instead of a calculator or even a computer program, as I think that the visual layout of the spreadsheet aids in understanding how the formula works. In what follows, I implement the above formulas for the integral $\displaystyle \int_1^2 x^9 \, dx$ using $n=10$ subintervals, so that $h = (2-1)/10 = 0.1$. To implement the left-endpoint rule, I enter the labels “x” and “x^9” in cells A1 and B1 of a spreadsheet. I then enter 1 (the left endpoint) in cell A2. In cell A3, I enter “=A2+0.1”, instructing the spreadsheet to add 0.1 to the value in cell A2. Then, instead of typing all of the other values of $x_k$, I use the fill-down feature to repeat this pattern for cells A3 through A11. In cell B2, I enter “=A1^9”, applying the function $f(x) = x^9$ to the $x-$coordinate in cell A2. Again, I use the fill-down feature to repeat this pattern for cells B3-B11. The fill-down feature saves a lot of time! Finally, in cell B13, I enter “=0.1*SUM(B2:B11)”, adding the values in cells B2 through B11 and multiplying the sum by $h$. The result, $78.6581$, is the approximation using the left-endpoint rule with 10 subintervals. Once this is done, the right-endpoint rule can be obtained almost for free. The only change is to change the value of cell A2 from 1 to 1.1. Everything else should automatically update. The midpoint rule is also obtained quickly by changing the value of cell A2 from 1 to 1.05, the midpoint of the first subinterval $[1,1.01]$. Implementing the Trapezoid Rule requires a little more work. We reset the value of A2 back to 1, the value of the left-endpoint. We also fill down the pattern one extra row (in this case, row 12). To implement the Trapezoid Rule, we have to multiply all function values (except for those at the endpoints) by 2. To implement this, I introduce column C. These weights can be typed by hand, but again the fill-down feature can speed things up. Then, in column D, I multiply the values in columns B and C. For example, the result in cell D2 is obtained by typing “=B2*C2”. Once again, the fill-down feature is used for all rows. Finally, the approximation itself is obtained by typing “=0.1/2*SUM(D2:D12)” in cell D13. After implementing the Trapezoid Rule, Simpson’s Rule is not much more effort. The biggest change is the alternating weights, so that the endpoints have weight 1 while the others oscillate between 4 and 2, ending on 4 on the second-to-last value of $x$. Again, these could be typed by hand, but it’s easiest to enter 4 in cell C3, 2 in cell C4, and then “=C3” in cell C5. The fill-down feature can take care of the rest of the weights. The Simpson’s Rule approximation is obtained by typing “=0.1/3*SUM(D2:D12)” in cell D13, with a new denominator of 3.

# Engaging students: Computing trigonometric functions using a unit circle

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Alizee Garcia. Her topic, from Precalculus: computing trigonometric functions using a unit circle.

How can this topic be used in your students’ future courses in mathematics or science?

Being able to compute trig functions using a unit circle will be the base of knowledge for all further calculus classes, as well as others. Being able to understand and use a unit circle will also allow students to start to memorize the trigonometric functions. One of the most important things from pre-calculus to all other calculus classes was being able to solve trig functions and having the unit circle memorized was very useful. Although there are trig functions and values outside of the unit circle, the unit circle almost is like the foundation for trigonometry. Most, if not all, calculus classes after pre-calculus will expect students to have the unit circle memorized. Although it can be solved using a calculator, this will allow equations and problems to be solves easier with less thought when a student knows the unit circle. Even outside of calculus classes, the unit circle is one of many important aspects in math classes.

How does this topic extend what your students should have learned in previous courses?

Before students learn how to compute trigonometric functions using a unit circle, they learn about the trig functions by themselves. This usually starts in high school geometry where students learn sine, cosine, and tangent, yet they do not use them in the way a unit circle does. Most schools only teach the students how to use the calculator to compute the functions to solve sides or angles for triangles. As students enter pre-calculus, they use what they have learned about the trig functions in order to apply them to the unit circle. This will allow students to see that using trig functions can still be used to solve triangles, but it can also be used to solve many other things. Once they learn the unit circle, they will see more examples in which they will apply the functions and make connections to real-world scenarios that they can also be applied to.

How can technology (YouTube, Khan Academy [khanacademy.org], Vi Hart, Geometers Sketchpad, graphing calculators, etc.) be used to effectively engage students with this topic?

There are probably many simulations and websites that can help students compute trig functions using the unit circle, but I think something that will engage the students is a Kahoot or Quizziz that will help the students memorize the unit circle. Giving students an opportunity to apply what they learned into a friendly competition not only gives them practice but will also let them be engaged. Other technology resources such as videos or a website that is teaching the lesson does not really allow the students to apply what they know rather than just being lectured. Although some websites and technology can be useful, I personally, enjoy giving students the opportunity to work out problems as well as being engaged. Also, using calculators could be helpful to check answers but if they have a unit circle it might not be necessary unless they do not have the unit circle in front of them.

# Thoughts on Numerical Integration (Part 6): Connection between Simpson’s Rule, Trapezoid Rule, and Midpoint Rule

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 in this series, I discussed three different ways of numerically approximating the definite integral $\displaystyle \int_a^b f(x) \, dx$, the area under a curve $f(x)$ between $x=a$ and $x=b$. In this series, we’ll choose equal-sized subintervals of the interval $[a,b]$. If $h = (b-a)/n$ is the width of each subinterval so that $x_k = x_0 + kh$, then the integral may be approximated as

$\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n$

using left endpoints,

$\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n$

using right endpoints, and

$\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n$

using the midpoints of the subintervals. We have also derived the Trapezoid Rule

$\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n)] \equiv T_n$

and Simpson’s Rule (if $n$ is even)

$\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{3} \left[y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{n-2} + 4 y_{n-1} + y_{n} \right] \equiv S_n$.

There is a somewhat surprising connection between the last three formulas. Let’s divide the interval $[a,b]$ into $2n$ subintervals with $h = (b-a)/(2n)$ and $x_0 = a$, $x_1 = x_0 + h$, $x_2 = x_0 + 2h$, and so on. Then Simpson’s Rule becomes

$S_{2n} = \displaystyle \frac{h}{3} \left[y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{2n-2} + 4 y_{2n-1} + y_{2n} \right]$.

Next, let’s divide the interval $[a,b]$ into $n$ subintervals, but let’s not redefine the values of $h$ and the $x_k$. Instead, the width of each subinterval will be $(b-a)/n$, which is equal to $2h$. (In other words, since there are half as many subintervals, each one is twice as long.) Also, the endpoints of these subintervals will be $x_0 = a$, $x_2 = x_0 + 2h$, $x_4 = x_0 + 4h$, and so on. So, keeping the same labeling convention as with Simpson’s Rule, the Trapezoid Rule becomes

$T_n = \displaystyle \frac{2h}{2} [f(x_0) + 2f(x_2) + 2f(x_4) + \dots + 2f(x_{2n-2}) + f(x_{2n})]$

$= h [f(x_0) + 2f(x_2) + 2f(x_4) + \dots + 2f(x_{2n-2}) + f(x_{2n})]$.

(Again, the width of the subintervals in this case is $2h$, where $h = (b-a)/2n$.) Furthermore, the midpoint of subinterval $[x_0, x_2]$ will be $x_1$, the midpoint of subinterval $[x_2,x_4]$ will be $x_3$, and so on. Therefore, keeping the same labeling convention, the Midpoint Rule becomes

$M_n = \displaystyle 2h [f(x_1) + f(x_3) + f(x_5) + \dots + f(x_{2n-1}) ]$.

It turns out that $\displaystyle \frac{2}{3} M_n + \frac{1}{3} T_n$, a certain weighted average of $T_n$ and $M_n$, is equal to

$\displaystyle \frac{4h}{3} [f(x_1) + f(x_3) + \dots + f(x_{2n-1}) ] + \frac{h}{3} [f(x_0) + 2f(x_2) + \dots + 2f(x_{2n-2}) + f(x_{2n})]$

$= \displaystyle \frac{h}{3} [f(x_0) + 4 f(x_1) + 2f(x_2) + \dots + 2f(x_{2n-2}) + 4 f(x_{2n-1} + f(x_{2n})]$

$= S_{2n}$.

So, if the Midpoint Rule and the Trapezoid Rule have already been computed for $n$ subintervals, then Simpson’s Rule for $2n$ subintervals can be computed at almost no additional effort.

# Engaging students: Using a recursively defined sequence

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Enrique Alegria. His topic, from Precalculus: using a recursively defined sequence.

How can this topic be used in your students’ future courses in mathematics or science?

Recursion is heavily emphasized within the branches of computer science. The technique can be used more than just in arithmetic and geometric sequences for finding the next term. Within computer science, recursion techniques can be utilized for sorting algorithms. The content will be able to transfer easily. Instead of finding the previous term to use to find the current term, within sorting algorithms, a set of numbers is chunked into smaller and smaller sets such that the original set of numbers becomes sorted.

We can take a deeper look at Merge Sort which is a recursive sorting algorithm. What occurs is the set of numbers repeatedly gets cut in half until there is only one element in the list. From there the elements are sorted in increasing order. Traversing back into the original size of the list with all of the elements contained except the final output is the list in increasing order.

Students can inspect the algorithm visually and need not to understand the implementation of code to comprehend the functionality of recursion. Guiding the students towards the smallest part of the process which is the single element and from there rearranging the elements of the list.

How has this topic appeared in high culture (art, classical music, theatre, etc.)?

Recursively defined sequences influenced a renowned artist who is M.C. Escher. The concept of a sequence beginning at one point and continuing infinitely is how Escher exhibits recursion. Escher challenges the viewer of his work to determine the patterns from the artistic series.

For example, when observing the piece Drawing Hands, a student can predict what the ‘base case’ of the artwork would be followed by the next steps of the drawing. The spectator of this piece can break it apart into smaller and smaller partitions of the whole. And once they reach a starting point, they can put together the whole picture once again.

Similarly, students can view this piece titled Two Birds to follow the patterns. Without saying the name of the piece students can again predict the base case and determine how recursion techniques would be used for this sequence. Students can begin to learn how to think of how recursively defined sequences are applied through visual representations of M.C. Escher’s artwork.

How can technology be used to effectively engage students with this topic?

Technology can be used to effectively engage students with recursion by showcasing the YouTube video “Recursion: The Music Videos of Michel Gondry” by Polyphonic. Through this video, students can compare recursively defined sequences to music they listen to. The video starts with singular notes and then repeating the notes to create a rhythm. Compiling the initial sounds into something familiar through loops of samples and sound bites. This video goes into the repetitive patterns of the small chunks of sound are shown through visual representations with the music videos by Michel Gondry. In the music video “Star Guitar” by The Chemical Brothers, the video starts off with the listener on a train ride going through a landscape. Slowly patterns emerge as buildings uniquely correspond to the notes and rhythms within the song. With this YouTube video students obtain a great introduction to recursion and hopefully continue to find patterns of recursion to music they listen to in the future.

References

Greenberg I., Xu D., Kumar D. (2013) Drawing with Recursion. In: Processing. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4465-3_8

Miller, B., & Ranum, D. (2020). 6.11. The Merge Sort — Problem Solving with Algorithms and Data Structures. Runestone.academy. https://runestone.academy/runestone/books/published/pythonds/SortSearch/TheMergeSort.html.

# Thoughts on Numerical Integration (Part 5): Derivation of Simpson’s Rule

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 in this series, I discussed three different ways of numerically approximating the definite integral $\displaystyle \int_a^b f(x) \, dx$, the area under a curve $f(x)$ between $x=a$ and $x=b$.

In this series, we’ll choose equal-sized subintervals of the interval $[a,b]$. If $h = (b-a)/n$ is the width of each subinterval so that $x_k = x_0 + kh$, then the integral may be approximated as

$\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n$

using left endpoints,

$\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n$

using right endpoints, and

$\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n$

using the midpoints of the subintervals. We have also derived the Trapezoid Rule:

$\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n)] \equiv T_n$

This last approximation was obtained by connecting adjacent points on the curve by line segments, creating trapezoids:

In this post, we will derive Simpson’s Rule. Instead of connecting two adjacent points with line segments, we will connect three adjacent points with a parabola. In the picture below, the points $(x_0, f(x_0))$, $(x_1, f(x_1))$ and $(x_2,f(x_2))$ are connected with one parabola, while the points $(x_2, f(x_2))$, $(x_3, f(x_3))$ and $(x_4,f(x_4))$ are connected with a different second parabola.

Clearly, for this to work, there has to be an even number of subintervals. (By contrast, for the Trapezoid Rule, the Midpoint Rule, or the endpoint rules, the number of subintervals could be even or odd.)

The derivation of Simpson’s Rule is more complicated than the derivation of the Trapezoid Rule because we need to use calculus to find the area under these parabolas. To begin, we make the simplifying assumption that $x_1 = 0$. Since each subinterval has width $h$, this means that $x_0 = -h$ and $x_2 = h$.

To find the area under this parabola, we first need to find the equation of the parabola $y = ax^2 + bx + c$ connecting the three points $(-h,y_0)$, $(0,y_1)$, and $(h,y_2)$. This entails solving a system of three equations in three unknowns:

$a(-h)^2 + b(-h) + c = y_0$

$a(0)^2+b(0) + c = y_1$

$ah^2 + bh + c = y_2$,

or

$ah^2 - bh + c = y_0$

$c = y_1$

$ah^2 + bh + c = y_2$.

While most 3×3 systems are cumbersome to solve, this system is straightforward. Clearly, $c = y_1$. Also, subtracting the first equation from the third equation yields

$2bh = y_2 - y_0$, or $b = \displaystyle \frac{y_2 - y_0}{2h}$

Finally, we solve for $a$ by substituting into the third equation:

$ah^2 + \displaystyle \frac{y_2 - y_0}{2h} h + y_1 = y_2$

$ah^2 + \displaystyle \frac{y_2 - y_0}{2} + y_1 = y_2$

$ah^2 = \displaystyle \frac{y_0 - y_2}{2} - \frac{2y_1}{2} + \frac{2y_2}{2}$

$ah^2 = \displaystyle \frac{y_0 - 2y_1 + y_2}{2}$

$a = \displaystyle \frac{y_0 - 2y_1 + y_2}{2h^2}$

Next, we find the integral of $y = ax^2 + bx + c$ between $x = -h$ and $x = h$:

$\displaystyle \int_{-h}^h (ax^2 + bx + c) \, dx = \left[ \frac{ax^3}{3} + \frac{bx^2}{2} + cx \right]^h_{-h}$

$= \displaystyle \left[ \frac{ah^3}{3} + \frac{bh^2}{2} + ch \right] - \left[ -\frac{ah^3}{3} + \frac{bh^2}{2} - ch \right]$

$= \displaystyle \frac{2ah^3}{3} + 2ch$

$= \displaystyle \frac{(y_0 - 2y_1 + y_2)h}{3} + 2y_1h$

$= \displaystyle \frac{h(y_0 + 4y_1 + y_2)}{3}$.

We now turn to the more general case of finding the area under the parabola passing through $(x_0,y_0)$, $(x_1,y_1)$, and $(x_2,y_2)$, where $x_1 = x_0 +h$ and $x_2 = x_1 + 2h$. Geometrically, it should be clear that this parabola can be obtained from the above parabola by a horizontal translation. Since the area under the curve is not changed by a horizontal translation, the area (and the formula) will be the same.

More formally, if $y = ax^2 + bx + c$ passes through the points $(-h,y_0)$, $(0,y_1)$, and $(h,y_2)$, then $y = a(x-x_1)^2 + b(x-x_1) + c$ will pass through the points $(x_0,y_0)$, $(x_1,y_1)$, and $(x_2,y_2)$. The area under this curve is

$\displaystyle \int_{x_0}^{x_2} \left[ a(x-x_1)^2 + b(x-x_1) + c \right] \, dx$.

After using the substitution $u = x-x_1$, this becomes

$\displaystyle \int_{-h}^h (au^2 + bu + c) \, du$,

which is the same integral that we saw earlier. Therefore,

$\displaystyle \int_{x_0}^{x_2} \left[ a(x-x_1)^2 + b(x-x_1) + c \right] \, dx = \displaystyle \frac{h(y_0 + 4y_1 + y_2)}{3}$.

Finally, we need to find the sum of the areas under all of these parabolas. Similarly, the area under the parabola passing through $(x_2,y_2)$, $(x_3,y_3)$, and $(x_4,y_4)$ will be $\displaystyle \frac{h(y_2 + 4y_3 + y_4)}{3}$. So, for the particular example shown above, the total area under the parabolas will be

$\displaystyle \frac{h(y_0 + 4y_1 + y_2)}{3} + \frac{h(y_2 + 4y_3 + y_4)}{3} = \frac{h}{3} (y_0 + 4 y_1 + 2 y_2 + 4 y_3 + y_4)$.

The coefficients of 4 arose from the above integrals, while the coefficient of 2 came from combining the two areas. In general, if there are $n$ subintervals and $n$ is even, then Simpson’s Rule gives the approximation

$S_n = \displaystyle \frac{h}{3} \left(y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{n-2} + 4 y_{n-1} + y_{n} \right)$.

# Engaging students: Powers and exponents

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Austin Stone. His topic, from Pre-Algebra: powers and exponents.

What interesting (i.e., uncontrived) word problems using this topic can your students do now?

“The number of people who are infected with COVID-19 can double each day. If it does double every day, and one person was infected on day 0, how many people would be infected after 20 days?” This problem can be a current real-life word problem that all students can relate to given the times we are in. This problem would be a good introductory for students to see how quickly numbers can get when using exponents. This would be an engaging introductory to exponents and will get the students interested because they can easily see that this can be used in current problems facing the world. This problem could also work later in Algebra if you ask how many days it would take to infect “blank” amount of people. This makes the question more of a challenge because they would have to solve for “x” (days) which is the exponent.

How has this topic appeared in the news?

This topic has been the news so far in 2020 if we are being honest. COVID-19 is a virus that has an exponential infection rate, just like any virus. When talking about COVID-19, news reporters and doctors usually use graphs to depict the infection rate. These graphs start off small but then grow exponentially until it slows down due to either people being more aware of their hygiene habits and/or the human immune system getting more familiar with the virus. Knowing how exponents work helps people better understand the seriousness of viruses such as COVID-19 and the everlasting impact it can have on the world. Doctors study what are the best ways to slow down the exponential growth so that a limited number of people contract and potentially die from the virus. To do this, they predict the exponential growth keeping in mind the regulations that may be enforced. Whatever regulation(s) slow down the virus the most are the ones that they try to enforce.

How can technology (YouTube, Khan Academy [khanacademy.org], Vi Hart, Geometers Sketchpad, graphing calculators, etc.) be used to effectively engage students with this topic?

An easy way to introduce students who have never seen exponents or exponential growth before is to use a graphing calculator. By plugging in an exponential function into the calculator and viewing the graph and zooming out, students can easily see how quickly numbers start to get massively large. A teacher can set this up by giving the students a problem to think about such as, “how many people would be infected with the virus after “blank” amount of day?” Students then could guess what they believe it would be. After revealing the graph and the actual number, students will probably be surprised at how big the number is in just a short amount of time. After that, the teacher could show a video on YouTube about exponential growth and/or infection rates of viruses and how quickly a small virus can turn into a pandemic. This also has very current real-world applications.

# Thoughts on Numerical Integration (Part 4): Derivation of Trapezoid Rule

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 in this series, I discussed three different ways of numerically approximating the definite integral $\displaystyle \int_a^b f(x) \, dx$, the area under a curve $f(x)$ between $x=a$ and $x=b$.

In this series, we’ll choose equal-sized subintervals of the interval $[a,b]$. If $h = (b-a)/n$ is the width of each subinterval so that $x_k = x_0 + kh$, then the integral may be approximated as

$\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n$

using left endpoints,

$\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n$

using right endpoints, and

$\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n$

using the midpoints of the subintervals.

All three of these approximations were obtained by approximating the above shaded region by rectangles. However, perhaps it might be better to use some other shape besides rectangles. In the Trapezoidal Rule, we approximate the area by using (surprise!) trapezoids, as in the figure below.

The first trapezoid has height $h$ and bases $f(x_0)$ and $f(x_1)$, and so the area of the first trapezoid is $\frac{1}{2} h[ f(x_0) + f(x_1) ]$. The other areas are found similarly. Adding these together, we get the approximation

$T_n = \displaystyle \frac{h}{2}[f(x_0) + f(x_1)] + \frac{h}{2} [f(x_1) + f(x_2)] + \dots +$

$+ \displaystyle \frac{h}{2} [f(x_{n-2})+f(x_{n-1})] + \frac{h}{2} [f(x_{n-1})+f(x_n)]$

$= \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + 2f(x_2) + \dots + 2f(x_{n-2}) + 2f(x_{n-1}) + f(x_n)].$

Interestingly, $T_n$ is the average of the two endpoint approximations $L_n$ and $R_n$:

$\displaystyle \frac{L_n+R_n}{2} = \frac{L_n}{2} + \frac{R_n}{2}$

$= \displaystyle \frac{h}{2} \left[f(x_0) + f(x_1) + f(x_2) + \dots + f(x_{n-1}) \right]$

$+\displaystyle \frac{h}{2} \left[f(x_1) + f(x_2) + \dots + f(x_{n-1}) + f(x_{n}) \right]$

$= \displaystyle \frac{h}{2} \left[f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n) \right]$

$= T_n$.

Of course, as a matter of computation, it’s a lot quicker to directly compute $T_n$ instead of computing $L_n$ and $R_n$ separately and then averaging.

# Engaging students: Using Pascal’s triangle

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Jaeda Ransom. Her topic, from Precalculus: using Pascal’s triangle.

How could you as a teacher create an activity or project that involves your topic?

A great activity that involves Pascal’s Triangle would be the sticky note triangle activity. For this activity students will be recreating an enlarged version of Pascal’s Triangle. To complete this activity students will need a poster of Pascal’s Triangle, poster board, markers, sticky notes, classroom wall (optional), and tape (optional). The teacher’s role is to show students Pascal’s Triangle, along with an explanation of how it was made. Students will be working in pairs and grabbing the necessary materials needed to complete this activity.On the poster board the students will recreate Pascal’s Triangle. Students will write a number 1 on a sticky note and place it at the top of the posterboard, they will then write 2 number 1’s on a sticky note and place it directly under. The students will continue recreating the triangle on their poster board until they run out of space. You can also consider having students use smaller sticky notes so that students are engaged with creating more rows.

What interesting things can you say about the people who contributed to the discovery and/or the development of this topic?

Pascal’s Triangle was named after French mathematician Blaise Pascal. At just the age of 16 years old Pascal wrote a significant treatise on the subject of projective geometry marking him as a child prodigy. Amongst that, Pascal also corresponded with other mathematicians on probability theory, which vastly encouraged the development of modern economics and social science. Pascal was also one of the first two inventors of the mechanical calculator when he started pioneering work on calculating machines, these were called Pascal’s calculators and later Pascalines. Pascal impressively created and invented all of this as a teenager. Though the Pascal Triangle was named after Blaise Pascal, this theory was established well before Pascal in India, Persia, China, Germany, and Italy. As a matter of fact, in China they still call it the Yang Hui’s triangle, named after Chinese mathematician Yang Hui who presented the triangle in the 13th century, though the triangle was known in China since the early 11th century.

How can this topic be used in your students’ future courses in mathematics or science?

This topic can be used in my students future mathematics course to introduce binomial expansions, where it is known that Pascal’s Triangle determines the coefficients that arise in binomial expansion. The coefficients aᵢ in a binomial expansion represents the number of row n in the Pascal’s Triangle. Thus, $a_i = \displaystyle {n \choose i}$.

Another useful application of this topic is in the calculations of combinations. The equation to find the combination is also the formula to find a cell for Pascal’s Triangle. So, instead of performing the calculations using the equation a student can simply use Pascal’s Triangle. In doing this you can continue a lesson over probability or even do an activity using Pascal’s Triangle while implicating probability questions.

Resources:

https://en.wikipedia.org/wiki/Pascal%27s_triangle#Formula