Calculus II Lesson 4: Trigonometric Integrals

  1. Last Time
    1. Multiple Steps
  2. Trigonometric Integrals
    1. Odd Powers
    2. Even Powers
    3. Different angles
  3. Exercises
  4. Upcoming

Last Time

Last timew we covered integration by parts. We ended with an example that it shows that we might need to integrate by parts multiple times.

Multiple Steps

It’s possible that one needs to integrate by parts multiple times. For example, what if the previous problem were changed to $\int x^2 \cos(x) dx$? Then we would set $u = x^2$, $dv = \cos(x) dx$, and end up with $x^2 \sin(x) - \int 2x \sin(x) dx$. Then to compute $\int 2x \sin(x) dx$ at the end we would again need to integrate by parts. So be aware that you may need to continue on several steps! Our saving grace, though, is that the integral we are computing in the second step, $\int 2x \sin(x) dx$, is simpler than the original integral $\int x^2 \cos(x) dx$.

There are times when it seems like we may be going around in circles. Here is an example. Compute $\int e^x \cos(x) dx$.

There is no obvious $u$ here. Remember: for $u$, we want a term so that $du$ is simpler. But whether we choose $u = e^x$ or $u = \cos(x)$, we end up with a similarly complex problem. So what should we do? Just pick one.

Let $u = e^x$, $dv = \cos(x) dx$. Then $du = e^x dx$, and $v = \sin(x)$. So our integral is:

\[\int e^x \cos(x) dx = e^x \sin(x) - \int e^x \sin(x) dx\]

Now what should we do? As I said above, let’s integrate by parts again. Let $u = e^x$, and $dv = \sin(x) dx$. Then $du = e^x dx$ and $v = -\cos(x)$. So now $\int e^x \cos(x) dx$ is:

\[e^x \sin(x) - (e^x(-\cos(x)) - \int (e^x)(-\cos(x)) dx)\]

Distributing negatives, we get $e^x \sin(x) + e^x \cos(x) - \int e^x \cos(x) dx$. But now we are back where we started: the original problem was to compute $\int e^x \cos(x) dx$!

So what do we do? Take a second to look at everything we have done. We know that the integral $\int e^x \cos(x) dx$ is equal to:

\[e^x \sin(x) + e^x \cos(x) - \int e^x \cos(x) dx\]

The fact that $\int e^x \cos(x) dx$ is on both sides makes it appear that we did something wrong. But actually we can use algebra to solve this problem: add $\int e^x \cos(x) dx$ to both sides! Then:

\[2 \int e^x \cos(x) dx = e^x \sin(x) + e^x \cos(x)\]

Or, $\int e^x \cos(x) dx = \frac{e^x \sin(x) + e^x\cos(x)}{2} + C$.

Exercise: Find the antiderivative of $\int e^x \sin(x) dx$.

Trigonometric Integrals

Before we go through trig integrals, please note this reference page on trig formulas, identities, and the unit circle. I will be referencing a few of the formulas / identities here as we need them. In particular, we will first need the Pythagorean identity:

\[\sin^2(x) + \cos^2(x) = 1\]

Odd Powers

Let’s go through an example here. Determine $\int \cos^3(x) \sin^2(x) dx$. Here we can re-write $\cos^3(x)$ as $\cos(x)\cdot \cos^2(x)$. Then use the fact that $\sin^2(x) + \cos^2(x) = 1$ to re-write $\cos^2(x)$ as $1 - \sin^2(x)$. That is, our integral is now:

\[\int \cos(x) \cdot (1 - \sin^2(x))\sin^2(x) dx\]

Let $u = \sin(x)$. Then $du = \cos(x) dx$, and we can simplify the integral to:

\[\int (1 - u^2)u^2 du\]

or:

\[\int u^2 - u^4 du\]

Then we integrate using the power rule: $\frac{u^3}{3} - \frac{u^5}{5} + C$. Substitute back and our general antiderivative is $\frac{\sin^3(x)}{3} - \frac{\sin^5(x)}{5} + C$.

Strategy: If we see an odd power of $\sin$ or $\cos$, pull one factor out, and re-write using $\sin^2(x) = 1 - \cos^2(x)$, or $\cos^2(x) = 1 - \sin^2(x)$. Then use integration by substitution, with either $u = \cos(x)$ or $u = \sin(x)$.

Exercise: Use this strategy on the following examples:

  1. $\int \cos^3(x) dx$
  2. $\int \sin^3(x) dx$
  3. $\int \sin^3(x) \cos(x) dx$
  4. $\int \cos^5(x) \sin^2(x) dx$
Check your answers
  1. $\sin(x) - \frac{\sin^3(x)}{3} + C$
  2. $\frac{\cos^3(x)}{3} - \cos(x) + C$
  3. $\frac{\sin^4(x)}{4}+C$. Note that there is more than one acceptable answer here. Why might that be? The $+C$ is doing some work here. Take a look at this graph, and recall that two functions which differ by a constant have the same derivative.
  4. $\frac{\sin^7(x)}{7} - \frac{2\sin^5(x)}{5} + \frac{\sin^3(x)}{3} + C$

Even Powers

If the powers of both $\sin$ and $\cos$ are even, then we have to find another trick. Here we recall the double angle formulas for cosine (there are three of them):

We will actually use the last two of these. Moreover, we’ll be using them in reverse. That is, we’re going to try to convert $\cos^2(x)$ and $\sin^2(x)$ into expressions involving $\cos(2x)$. To do this, we do some algebra, and compute:

Here’s an example. Suppose we want to compute $\int \cos^2(x) dx$. We use the formula above to convert everything this into $\int \frac{1}{2} + \frac{1}{2}\cos(2x) dx$. Now integrate (use substitution with $u = 2x$ if you need to) and the general antiderivative is $\frac{x}{2} + \frac{1}{4} \sin(2x) + C$.

Another example: $\int \cos^2(x) \sin^2(x) dx$. Here we need to use both formulas. Try this out yourself, and then watch along the video as I go through the problem.

Click for the final answer:

$\frac{x}{8} - \frac{\sin(4x)}{32} + C$

Please watch the video above for the details on all of this! This is a challenging problem, you may need to go through this multiple times.

Exercises:

  1. $\int\limits_{-\pi}^{\pi} \cos^3(x) dx$
  2. $\int \cos^4(x) dx$
  3. $\int \cos(x) \sin^2(x) dx$
Check your answers:
  1. 0
  2. $\frac{3x}{8}+\frac{\sin(2x)}{4}+\frac{\sin(4x)}{32}+C$
  3. $\frac{\sin^3(x)}{3} + C$. This can be solved just using substitution: $u = \sin(x)$.

Different angles

As before, I will remind you of some of the trig identities that we may need before we use them here:

We will use these to help compute integrals of the form $\int \sin(ax) \cos(bx) dx$, $\int \cos(ax) \cos(bx) dx$, and $\int \sin(ax) \sin(bx) dx$. For example, how do we compute $\int \sin(5x) \cos(2x) dx$? We re-write $\sin(5x)\cos(2x)$ using the formulas above.

Since $\sin(5x + 2x) = \sin(5x) \cos(2x) + \cos(5x)\sin(2x)$, and $\sin(5x - 2x) = \sin(5x) \cos(2x) - \cos(5x) \sin(2x)$, if we add these together, we get that $\sin(7x) + \sin(3x) = 2\sin(5x) \cos(2x)$. In other words, $\sin(5x) \cos(2x) = \frac{\sin(7x) + \sin(3x)}{2}$.

More generally, we can use the following formulas:

Let’s do an example: $\int\limits_0^{\pi/2} \sin(3x)\cos(2x) dx$. Using the first formula, we re-write $\sin(3x) \cos(2x)$ as $\frac{\sin(x) + \sin(5x)}{2}$, and so we are looking for $\frac{1}{2}\int\limits_0^{\pi/2} (\sin(x) + \sin(5x))dx$, which is $\left.\frac{1}{2}(-\cos(x) - \frac{\cos(5x)}{5})\right|_0^{\pi/2}$.

Plugging in, we get $\frac{1}{2}(-\cos(\pi/2) - \frac{\cos(5\pi/2)}{5}) - \frac{1}{2}(-\cos(0) - \frac{\cos(0)}{5})$, which is $0 - \frac{1}{2}(-1 - \frac{1}{5})$, or just $\frac{3}{5}$.

As practice, go through exercises 103-108 in Section 3.2 of the textbook.

Exercises

Work on the following on your own to practice these.

Section 3.1 #7, 8, 48, 52
Section 3.2 #80, 98, 100, 104

Exit ticket: Turn in 3.1 #8, 3.2 #100 in class on Monday.

Upcoming

There will be a quiz on Monday (2/9) in class. For quizzes, I allow students to correct any work they got wrong. We can discuss this on Monday.

The first exam is tentatively scheduled for the following Monday, February 16.