Category Archives: Teaching

Some Cute Integrals — Integrations By Parts — Part III

I left off the last post with the promise that this one would be about reduction formulas. And I try not to break promises … so, let’s get into reduction formulas!

A Classical Example

Suppose we wanted to integrate $$\int x^{2}e^{x}\ dx$$

We would integrate by parts and choose \(f = x^{2}\) since it “gets better” as we differentiate it and \(dg = e^{x}\ dx\) because it “doesn’t get worse” as we integrate it. Thus, we would have \(df = 2x\ dx\) and \(g = e^{x}\) yielding

$$\int x^{2}e^{x}\ dx = x^{2}e^{x} – \int 2xe^{x}\ dx$$

Notice that the right-hand side has another integral that is very similar to the integral on the left side. The only differences are that the power of \(x\) has been reduced by one and there is a constant of \(2\) now present. And now the integral on the right-hand side requires an integration by parts. So if we were to integrate $$\int 2xe^{x}\ dx$$
we would have
$$\int 2xe^{x}\ dx = 2xe^{x} – \int 2e^{x}\ dx$$

But now, notice that we have another integral (as we should since we integrated by parts). And this integral has as its integrand, in effect, a lonesome \(e^{x}\). If we pause for a second and look back at the original integral in question, then we’ll notice that by repeated use of integration by parts we “reduced” the power of \(x\) in the integrand by one each time. This is the idea behind reduction formulas.

As is a typical habit of mathematicians, we like to try to generalize as much as reasonably possible (and sometimes even unreasonably so). So, let’s get rid of \(x^{2}\) and replace it by \(x^{n}\) and see what happens.

$$\int x^{n}e^{x}\ dx$$

First we choose \(f = x^{n}\) and \(dg = e^{x}\ dx\) giving \(df = nx^{n-1}\ dx\) and \(g = e^{x}\). This yields $$\int x^{n}e^{x}\ dx = x^{n}e^{x} – \int nx^{n-1}e^{x}\ dx$$

and voilà we have a reduction formula!

The following are typical student reactions (not all students and not all the time … that is, assume the word “some” is associated with “students”):

  • The abstraction to \(n\) befuddles students. This is natural and understandable. There are many ways to address this confusion. One way is to write \(\int x^{n}e^{x}\ dx\) with different choices of \(n\). I’ve found that this alone helps students to see that \(n\) is just a place holder for (yet another) unknown variable.
  • The choice of \(f\) and \(dg\) while “obvious” when \(n\) was some positive integer will be another point of confusion. And again, this is just a problem with handling the abstraction. Students are not yet used to thinking in generalities. They often desire the concreteness of a number for those “unknowns that aren’t variables” (this phrase in quotes is nonsense, but this is how students think of it). So again, one way to help develop a level of comfort with \(n\) is to ask what choice of \(f\) and \(dg\) should be made if \(n = 2\), \(n = 3\), etc.
  • Students won’t know when to “stop” or how to apply the reduction formula. The easiest way to handle this to have them work out the integral with \(n = 3\). First, they should try to integrate it without use of the reduction formula. Then they should try to use the reduction formula to arrive at the same answer.

Going Beyond Traditional — Part I

Now, the typical motions of a Calculus course will show the example in the previous section as well as perhaps $$\int \cos^{n}(x)\ dx = \frac{\cos^{n-1}(x)\sin(x)}{n} + \frac{n-1}{n}\int \cos^{n-2}(x)\ dx$$ or an equivalent one with \(\sin^{n}(x)\) and then proceed to the next topic.

But wait!!!

There’s more to do. Any instructor reading this will have noticed that I made no mention of any constraints on \(n\) (or if you are an instructor and didn’t notice it, odds are you assumed the correct constraints because you are very familiar with this topic anyway). On the contrary, practically any student won’t have thought twice about what the constraints on \(n\) are. If anything they will have just assumed \(n\) was “what it needed to be to make the formula work”.

It’s at moments like these that I feel that many teachers miss an opportunity to promote “mathematical thinking” and miss an opportunity to engage students with mathematical formalism. One major aspect of mathematical thinking and mathematical formalism is about pinning down the “givens”. Typical advanced-level math texts will use language like “given that …”, “provided that …”, “suppose that …”, “let … be given …”, etc.

To some extent, I don’t really care about reduction formulas (later you’ll see that I do care). They are cute little results that we can derive almost unconsciously. I like to get students to talk about assumptions. This is crucial! Not just with mathematics, but generally, with life! Misunderstandings are a result of not understanding assumptions. There is a disconnect sometimes in what a teacher knows, what a teacher understands to be obvious, what a student knows, and what a student understands to be obvious. These are pedagogical assumptions made by all sides involved. Sometimes the teacher assumes too much. Sometimes the students assume too much.

So, back to Calculus land: what is an acceptable \(n\) for our reduction formula?
$$\int x^{n}e^{x}\ dx = x^{n}e^{x} – \int nx^{n-1}e^{x}\ dx$$

  • Can \(n = \frac{1}{2}\)?
  • Can \(n \lt 0\)?
  • Can \(n = 0\)?
  • Can \(n = \pi\)?
  • Is there a particular category of \(n\) that’s acceptable? Does \(n\) have to be a positive integer?

These are the types of questions to get students to ask! The more an instructor does this from the start, the more of a habit it will be for students to start looking for assumptions — and again, not just with mathematics, but with other aspects of life (eg, critical reading). Students don’t really know how to do this correctly (and heck, it’s not obvious that any of us can do this correctly all the time, but I’d like to reduce that error rate and thinking mathematically is one way to do it).

Have students try the reduction formula when \(n = \frac{1}{2}\). What happens? Is the formula wrong or is it that it will never end?

Going Beyond Traditional — Part II

Another opportunity that many instructors pass up, that is related to working with mathematical symbolism, is working with the conventional notation of functions. As I have mentioned many times, students are overconditioned with \(x\) and \(f(x)\) (and my integration posts are an example of that — next post, I’ll use \(dw\) or something like this.). Students also are unaccustomed to thinking of \(\int g(x)\ dx\) as some \(G(x)\) even though there may have been some mention of this when discussing the Fundamental Theorems of Calculus. Here’s another opportunity!

Our reduction formula again:
$$\int x^{n}e^{x}\ dx = x^{n}e^{x} – \int nx^{n-1}e^{x}\ dx$$

But now, let’s function-ify this. Let (formal math-speak)

$$F(n, x) = \int x^{n}e^{x}\ dx$$

then, the task is to express the right hand side in a similar way. And this is done as

$$F(n,x) = x^{n}e^{x} – nF(n-1,x)$$

Undoubtedly, many students’ heads will explode. In fact, their heads were ready to burst at \(F(n,x)\). But the cranial detonation is not because they don’t understand — they do understand — but more so that they are still trying to process the symbolism. So slow down for them. Ask them, one step at a time if they can understand what a function of two variables is. Show them what \(F(2,x)\) would look like. Ask them to write down what \(F(3,x)\) would be, etc. and eventually (and fair quickly, in my experience) they’ll accept the new rewrite of the reduction formula.

Admittedly, this may be a bit too much for some students, but that doesn’t mean it shouldn’t be shown. This is worthwhile because students taking Calculus II will almost surely (measure theory anyone?) will take several more math courses and some of those courses are going to use recursion heavily (combinatorics, number theory, etc.). In any case, the classroom decisions I make revolve around a few factors and one of them is time. I don’t mind spending an extra fifteen to thirty minutes in class showing students something like what I am writing about here than using those extra minutes to go over something that they can easily learn on their own.

In any case, let’s continue. What more can we do with our re-writing of the recursion formula?
$$F(n,x) = x^{n}e^{x} – nF(n-1,x)$$

What is \(F(2,x)\)?
$$F(2,x) = x^{2}e^{x} – 2F(1,x)$$
and \(F(1,x)\)?
$$F(1,x) = x^{1}e^{x} – 1F(0,x)$$
and \(F(0,x)\)? We can see that \(F(0,x) = e^{x} + C\) where \(C\) is just the constant of integration (and just as a note, I will use \(C\) generally as the constant of integration from one equation to the next, even if it is (could be), technically, a different value — this is an abuse of notation, but not loss of meaning).

Thus, $$F(2,x) = x^{2}e^{x} – 2x^{1}e^{x} + 2\cdot 1e^{x} + C$$

But, wait a second. There’s actually something kind of interesting going on here. And this is a good way to really drive home some of those Algebra skills (it’s that “total math workout” again!).

What about \(F(3,x)\)? It would just be $$F(3,x) = x^{3}e^{x} – 3F(2,x)$$ and we already know what \(F(2,x)\) is. Thus, $$F(3,x) = x^{3}e^{x} – 3(x^{2}e^{x} – 2x^{1}e^{x} + 2\cdot 1e^{x}) + C$$
which gives
$$F(3,x) = x^{3}e^{x} – 3x^{2}e^{x} + 3\cdot 2x^{1}e^{x} – 3\cdot 2\cdot 1e^{x} + C$$

So, can you show how to write \(F(n,x)\) in its expanded form without any \(F(k,x)\) on the right-hand side for positive integer \(n\)? We always have that \(F(0,x) = e^{x} + C\). Notice that the signs alternate (thus, we need something like \((-1)^{k}\), we have \(r\cdot (r-1)\cdots\) like products, etc. This is a nice challenge problem for students — they’ll have to get used to writing with \(\Sigma\) and \(\Pi\) (and if they don’t get used to it now, then a few weeks later in the course they will have to because that’s part is about sequences and series and what is \(F(n,x)\) other than a summation?). If you offer extra credit, you now have a nice problem you can give or you can save this for the sequences and series section.

Going Beyond Traditional — Part III

You thought I was done? Ha! Wait ’til I get started!

I do care about reduction formulas. In a typical introductory programming course, students are introduced to the idea of recursion. And they don’t understand it. The examples that are used to demonstrate how recursion works are the formulas for \(n!\) and the Fibonacci sequences. These are good, easily understood, and accessible examples for students at almost all but the most basic level of mathematical knowledge. But a nice programming challenge? What is \(F(10,x)\)?

$$\begin{aligned}
F(10,x) =& x^{10}e^{x} \\ &-10x^{9}e^{x} \\ &+10\cdot 9x^{8}e^{x} \\ &-10\cdot 9\cdot 8x^{7}e^{x} \\ &+10\cdot 9\cdot 8\cdot 7x^{6}e^{x} \\ &-10\cdot 9\cdot 8\cdot 7\cdot 6x^{5}e^{x} \\ &+10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5x^{4}e^{x} \\ &-10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5\cdot 4x^{3}e^{x} \\ &+10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5\cdot 4\cdot 3x^{2}e^{x} \\ &-10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5\cdot 4\cdot 3\cdot 2x^{1}e^{x} \\ &+10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5\cdot 4\cdot 3\cdot 2\cdot 1e^{x} \\ & + C
\end{aligned}
$$

How about \(F(20,x)\)?
$$\begin{aligned}
F(20,x) =& x^{20}e^{x} \\ &-20x^{19}e^{x} \\ &+20\cdot 19x^{18}e^{x} \\ &-20\cdot 19\cdot 18x^{17}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17x^{16}e^{x} \\ &-20\cdot 19\cdot 18\cdot 17\cdot 16x^{15}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15x^{14}e^{x} \\ &-20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14x^{13}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13x^{12}e^{x} \\ &-20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12x^{11}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11x^{10}e^{x} \\ &-20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10x^{9}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9x^{8}e^{x} \\ &-20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9\cdot 8x^{7}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9\cdot 8\cdot 7x^{6}e^{x} \\ &-20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9\cdot 8\cdot 7\cdot 6x^{5}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5x^{4}e^{x} \\ &-20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5\cdot 4x^{3}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5\cdot 4\cdot 3x^{2}e^{x} \\ &-20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5\cdot 4\cdot 3\cdot 2x^{1}e^{x} \\ &+20\cdot 19\cdot 18\cdot 17\cdot 16\cdot 15\cdot 14\cdot 13\cdot 12\cdot 11\cdot 10\cdot 9\cdot 8\cdot 7\cdot 6\cdot 5\cdot 4\cdot 3\cdot 2\cdot 1e^{x}
\\ & + C
\end{aligned}
$$
And do you think I typed this by hand?

Anyhow, there we have it. We can go well beyond the basics of reduction formulas and start to touch on other aspects of mathematics and perhaps even incorporate aspects of programming and other disciplines. I’ll stop here with one last comment: proof by induction …

Next in the series … something to do with integration of sines and cosines.