## Solving integrals of the form tanm x secn x

In a recent post, I showed you how to approach integrals of the form

$\displaystyle \int \sin^m{x} \; \cos^n{x} \; dx$

In this post, we look at the similar integral of the form

$\displaystyle \int \tan^m{x} \; \sec^n{x} \; dx$

As before, m and n are integers. The technique we use requires m to be odd or n to be even and we factor out terms of the associated function. We demonstrate with an example. Evaluate:

$\displaystyle \int \tan^5{x} \; \sec^6{x} \; dx$

Here, m is odd and n is even, so we can factor either the tan x or the sec x function. We’ll do it both ways here to show both techniques. First, when m is odd, we factor out a single power of both tan x and sec x and the rest of the integral follows the method we saw in the sinm x cosnx integral example:

$\displaystyle \int \tan^5{x} \; \sec^6{x} \; dx = \int \sec{x} \; \tan{x} \; \tan^4{x} \; \sec^5{x} \; dx =$

$\displaystyle \int \sec{x} \; \tan{x} \; (\tan^2{x})^2 \; \sec^5{x} \; dx = \int \sec{x} \; \tan{x} \; (\sec^2{x} - 1)^2 \; \sec^5{x} \; dx =$

$\displaystyle \int \sec{x} \; \tan{x} \; (\sec^4{x} - 2 \sec^2{x} + 1) \; \sec^5{x} \; dx =$

$\displaystyle \int \sec{x} \; \tan{x} \; (\sec^9{x} -2 \sec^7{x} + \sec^5{x}) \; dx =$

Then letting u = sec x leads to

$\displaystyle f(x) = \frac{1}{10} \sec^{10}{x} - \frac{1}{4} \sec^8{x} + \frac{1}{6} \sec^6{x} + C$

Now let’s do the same integral the other way. When n is even, we factor out a sec2 x, and the rest of the process is similar to the first method:

$\displaystyle \int \tan^5{x} \; \sec^6{x} \; dx = \int \sec^2{x} \; \tan^5{x} \; \sec^4{x} \; dx =$

$\displaystyle \int \sec^2{x} \; \tan^5{x} \; (\sec^2{x})^2 \; dx = \int \sec^2{x} \; \tan^5{x}\; (\tan^2{x} + 1)^2 \; dx =$

$\displaystyle \int \sec^2{x} \; \tan^5{x} \; (\tan^4{x} +2\tan^2{x} + 1) \; dx =$

$\displaystyle \int \sec^2{x} (\tan^9{x} + 2 \tan^7{x} + \tan^5{x}) \; dx$

Then letting u=tan x,

$\displaystyle f(x) = \frac{1}{10} \tan^{10}{x} + \frac{1}{4} \tan^8{x} + \frac{1}{6} \tan^6{x} + C$

Wait! That’s not the same integral we got in the method above. Well, actually, it is! After a trig substitution (1 + tan2 x = sec2 x) and a lot of messy algebra, you can show they are the same function. I’ll leave you to work out the details. Better yet, graph them both on your graphing calculator and you will see they are the same.

## Solving integrals of the form sinm x cosn x when m and n are even

In my last post, I showed you the method for integrating functions of the form

$\int \sin^m{x} \; \cos^n{x} \; dx$

when either m or n is odd. If they are both even, the process is more complicated. In this post, I’ll show you how to attack this problem. There are two different methods you can use; if one doesn’t work so well, try the other. We will demonstrate both methods here with an example. Let’s integrate

$\int \sin^2{x} \; \cos^4{x} \; dx$

Method 1

First, rewrite the integral so that the factors are powers of sinx and cosx.

$\int \sin^2{x} \; (\cos^2{x})^2 \; dx$

Use the power reducing formulas

$\sin^2{x} = \frac{1}{2}(1- \cos{2x}) \text{ and } \cos^2{x} = \frac{1}{2}(1+\cos{2x})$

to replace both the sinx and the cosx terms.

$\displaystyle \int \sin^2{x} \; (\cos^2{x})^2 \; dx = \int \left(\frac{1}{2}(1- \cos{2x})\right) \left(\frac{1}{2} (1+\cos{2x}) \right)^2 \; dx$

Then expand each term and multiply it all out (hey, I said it was more complicated…)

$\displaystyle \int \left(\frac{1}{2}(1- \cos{2x})\right) \left(\frac{1}{2} (1+\cos{2x}) \right)^2 \; dx =$

$\displaystyle \frac{1}{8} \int (1- \cos{2x})(1 + 2 \cos{2x} + \cos^2{2x}) \; dx =$

$\displaystyle \frac{1}{8} \int 1 + 2 \cos{2x} + \cos^2{2x} - \cos{2x} - 2 \cos^2{2x} - \cos^3{2x} \; dx$

$\displaystyle \frac{1}{8} \int 1 + \cos{2x} - \cos^2{2x} - \cos^3{2x} \; dx$

Now we are finally ready to integrate. The first two terms can be integrated by inspection. The third term is attacked by using the power reducing formula. In the last term, the exponent is odd, so apply the technique we used in the last blog post:

$\displaystyle \frac{1}{8} \int 1 + \cos{2x} - \frac{1}{2} (1+\cos{4x}) - \cos{2x}\cos^2{2x} \; dx =$

$\displaystyle \frac{1}{8} \int 1 + \cos{2x} - \frac{1}{2} (1+\cos{4x}) - \cos{2x}(1- \sin^2{2x}) \; dx =$

$\displaystyle \frac{1}{8} \int \frac{1}{2} - \frac{1}{2} \cos{4x} + \cos{2x} \sin^2{2x} \; dx =$

$\displaystyle \frac{1}{8} \left( \frac{1}{2}x - \frac{1}{8} \sin{4x} + \frac{1}{6} \sin^3{2x} \right) + C = \frac{1}{16}x - \frac{1}{64} \sin{4x} + \frac{1}{48} \sin^3{2x} + C$

Whew!

Method 2:

First, rearrange terms so that there is a power of (sin x cos x).

$\displaystyle \int \sin^2{x} \cos^4{x} \; dx = \int \sin^2{x} \cos^2{x} \cos^2{x} \; dx =$

$\displaystyle \int (\sin{x} \cos{x})^2 \cos^2{x} \; dx$

Then use the double angle formula $\sin{x} \cos{x} = \frac{1}{2} \sin{2x}$ and the power reducing formulas as necessary:

$\displaystyle \int (\sin{x} \cos{x})^2 \cos^2{x} \; dx = \int \left(\frac{1}{2} \sin{2x} \right)^2 \left(\frac{1}{2} (1+ \cos{2x}) \right) \; dx$

Expand the terms and multiply out:

$\displaystyle \int \left(\frac{1}{2} \sin{2x} \right)^2 \left(\frac{1}{2} (1+ \cos{2x}) \right) \; dx = \frac{1}{8} \int \sin^2{2x} (1+ \cos{2x}) \; dx =$

$\displaystyle \frac{1}{8} \int \sin^2{2x} + \sin^2{2x} \cos{2x} \; dx = \frac{1}{8} \int \frac{1}{2} (1- \cos{4x}) + \sin^2{2x} \cos{2x} \; dx =$

$\displaystyle \frac{1}{8} \left( \frac{1}{2}x - \frac{1}{8} \sin{4x} + \frac{1}{6} \sin^3{2x} \right) + C = \frac{1}{16}x - \frac{1}{64} \sin{4x} + \frac{1}{48} \sin^3{2x} + C$

Note that this is the same result as in Method 1 above.

## Solving integrals of the form sinm (x) cosn (x)

An important class of integrals is of the form:

$\int \sin^m{x} \; \cos^n{x} \; dx$

where m and n are integers. If either m or n is odd, factor out a single power of that function and rewrite the integral to solve with a u substitution. This is best demonstrated with an example:

$\int \sin^5{x} \; \cos^7{x} \; dx$

Here, both m and n are odd, so we can select either function to factor. The process is easier when you pick the smaller of the two exponents, so let’s choose the sin x and we factor out one power as follows:

$\int \sin{x} \; \sin^4{x} \; \cos^7{x} \; dx$

We then rewrite the even power as a power of sin2 x so that we can apply a trig identity:

$\int \sin{x} \; \sin^4{x} \; \cos^7{x} \; dx = \int \sin{x} \; (\sin^2{x})^2 \; \cos^7{x} \; dx =$

$\int \sin{x} \; (1-\cos^2{x})^2 \; \cos^7{x} \; dx = \int \sin{x} \; (1-2 \cos^2{x} + \cos^4{x}) \; \cos^7{x} \; dx =$

$\int \sin{x} \; (\cos^7{x} -2 \cos^9{x} + \cos^{11}{x}) \; dx$

This is easily integrated with a u substitution (let u = cos x):

$\dfrac{1}{8} \cos^8{x} - \dfrac{1}{5} \cos^{10}{x} + \dfrac{1}{12} \cos^{12}{x} + C$

So what do you do if both m and n are even? Well, most students just skip the problem and go on to the next one. ☺ But if you want to see the technique, look for my next blog post.

## Solving differential equations by separation of variables

A common differential equation is of the form $y' = f(x) \cdot g(y)$. In this situation, the equation can be solved by a technique called “separation of variables”. It involves putting all the y terms on one side of the equation and all the x terms on the other side. Then integration on both sides leads to a solution. Let’s look at a couple of examples.

Example 1

Solve: $\dfrac{dy}{dx} = \dfrac{2x}{y^2}$ with the initial condition $y(0) = 2.$

First, multiply both sides by y2 and by dx to separate the variables (all the y terms on one side and all the x terms on the other):

$y^2 \; dy = 2x \; dx$

Note that dy/dx isn’t really a fraction, but you can treat it as a fraction to separate the variables. Now you have an exact differential on each side, so you can integrate both sides:

$\int y^2 \; dy = \int 2x \; dx$

$\dfrac{1}{3} y^3 = x^2 + C$

Why isn’t there a constant of integration on the left side? Well, there was, but we subtracted it and combined it with the constant of integration on the right so there is only one constant. Always do it this way, and put the constant on the independent variable side. Now solve for y:

$y = \sqrt[3]{3x^2 + C}$

Why didn’t we multiply the constant by 3? Well, we did, but a constant times three is still a constant, so we simplified it. Always keep your constant as simple as possible. Now solve for the constant, using the initial condition given:

$2 = \sqrt[3]{3(0)^2 + C} \rightarrow C = 8$

$\therefore y = \sqrt[3]{3x^2 + 8}$

Example 2:

Solve: $\dfrac{dy}{dx} = \dfrac{y}{\sqrt{x}}$ with the initial condition $y(0) = 2.$

As before, separate the variables:

$\dfrac{dy}{y} = \dfrac{dx}{\sqrt{x}}$

Note that the dy and dx terms must always be in the numerator. Now integrate and solve for y:

$\displaystyle \int \dfrac{dy}{y} = \int \dfrac{dx}{\sqrt{x}}$

$\ln |y| = 2 \sqrt{x} + C$

$y = e^{2 \sqrt{x} + C} = Ce^{2 \sqrt{x}}$

Wait, how did the constant move from the exponent to the coefficient? It’s a simplification trick. Proceed as follows:

$y = e^{2 \sqrt{x} + C} = e^{2 \sqrt{x}} \cdot e^C$

But eC is a constant too, so just call it C. Where did the absolute value sign go? Because C can be either positive or negative, we can drop the absolute value sign around the y. Let’s finish the problem by solving for C:

$2 = Ce^{2 \sqrt{0}} \rightarrow C = 2$

$\therefore y = 2e^{2 \sqrt{x}}$

## How to approach integration by parts

In an earlier post, I described a strategy for approaching integrals and how to decide what technique to use. One question I suggested you ask yourself is “Can I use integration by parts?” In this post, I describe how you decide when integration by parts is the right approach, and how you decide which term will be u and which will be dv.

There is no product rule for integrals, but when you see an integrand that is the product of two functions [and u substitution has been ruled out], integration by parts is often the right approach. For example, each of the following integrals should be solved using integration by parts:

$\displaystyle \int x^2e^x \; dx \\ \displaystyle \int e^x \sin x \; dx \\ \displaystyle \int x \tan^{-1} x \; dx$

Once you decide that integration by parts is the correct technique, does it matter which factor you make u and which you make dv? Usually, yes. But don’t worry if you make the wrong choice—you’ll know that pretty quickly. Remember that the purpose of integration by parts is to take a complicated integrand and make it simpler. If you choose your u and dv incorrectly, your integrand will get more complicated. When you find your integral getting worse, just start again and switch your choices for u and dv. (If switching choices doesn’t make your integral look better, perhaps integration by parts isn’t the proper technique for the integral.)

Here’s a trick to help you decide which factor should be the u term: LIPET. This is a mnemonic to help you determine the priority for assigning factors to be u. The acronym stands for the following:

L: logarithmic functions
I: inverse trigonometric functions
P: polynomials
E: exponential functions
T: trigonometric functions

For example, the first integral above is the product of a polynomial and an exponential function. P precedes E in LIPET, so make x2 the u term and ex the dv term. The third integral above is the product of a polynomial and an inverse trig function, so let tan-1 x be the u term and x will be the dv term.

Finally, note that even though integration by parts creates a simpler integral, it won’t always create an integral you can evaluate by inspection. Often, you will need to use another technique to integrate the new integrand, or perhaps you will need to do integration by parts a second time.

Blue Taste Theme created by Jabox