Recitation Nine

In this recitation, we covered integration by parts, trigonometric integrals, and trigonometric substitutions.

Integration by Parts

The theory behind integration by parts is pretty straightforward. Remember that the product rule says

\[(f(x)g(x))' = f'(x) g(x) + f(x) g'(x).\]

Integrating this gives us

\[f(x) g(x) = \int f'(x) g(x)dx + \int f(x)g'(x)dx,\]

which we can rearrange to get the “integration by parts” identity:

\[\int f'(x)g(x)dx = f(x)g(x) - \int f(x)g'(x)dx.\]

Most people are probably not familiar with this way of writing it, but there’s an easy way to swtich things around. If we let \(u = u(x) = g(x)\) and $v = v(x) = f(x)$$, then

\[du = g'(x)dx \text{ and } dv = f'(x)dx.\]

We can now write this as

\[\int udv = uv - \int v du.\]

While theoretically straightforward, this is an immensely useful trick for solving integrals. Let’s look at a few examples now.

Problem: Evaluate

\[\int x \ln(x)dx.\]

Solution: We essentially have no tricks for evaluating this as is. However, notice that if we could somehow get rid of the natural log, this would be much easier. Let’s try letting \(u = \ln(x)\) and \(dv = x dx\). We see that

\[du = \frac{dx}{x} \text{ and } v = \frac{1}{2} x^2.\]

So:

\[\int x \ln(x)dx = \int u dv = uv - \int v du = \frac{1}{2}x^2 \ln(x) - \int \frac{x^2}{2x}dx.\]

This integral is much easier to deal with. We evaluate to get

\[\int x \ln(x)dx = \frac{1}{2}x^2 \ln(x) - \frac{1}{4}x^2 + C.\]

If we take the derivative of the right hand side, we see that

\[( \frac{1}{2}x^2 \ln(x) - \frac{1}{4}x^2 + C)' = x \ln(x) + \frac{x}{2} - \frac{x}{2} = x \ln(x),\]

so the answer is correct!

Problem: Evaluate

\[\int \sin(x) e^x dx.\]

Solution: This is an easier version of what is in the handout, but it captures the same technique. We’re going to make up a “variable” (really a family of functions)

\[I = \int \sin(x) e^x dx.\]

Now, the question is what to make \(u\) and what to make \(dv\). Something to notice is that the derivative of \(\sin(x)\) cycles, meaning that

\[\frac{d}{dx} \sin(x) = \cos(x), \ \frac{d^2}{dx^2} \sin(x) = - \sin(x), \text{ etc.}\]

What will happen is that, as we do integration by parts twice with \(u\) the trig function, we will get some expression along with an \(I\). We can then do simple algebra to solve for what \(I\) should be. Let’s explore this now. Let \(u = \sin(x)\) and \(dv = e^x dx\). Then \(du = \cos(x)dx\), \(v = e^x\), and

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

Now we do integration by parts again. Let \(u = \cos(x)\), \(dv = e^xdx\). Then \(du = - \sin(x)dx\) and \(v = e^x\), so

\[I = \sin(x)e^x - \left(\cos(x)e^x + \int \sin(x) e^x dx\right) = \sin(x)e^x - \cos(x)e^x - I.\]

Now we solve for \(I\):

\[2I = \sin(x) e^x - \cos(x)e^x \implies I = \frac{e^x}{2} (\sin(x) - \cos(x)).\]

This is a little bit of a lie – I left off the arbitrary constant throughout the process. Let’s just throw it on now:

\[I = \frac{e^x}{2} (\sin(x) - \cos(x)) + C.\]

If we take the derivative of the right hand side, notice we get

\[\left( \frac{e^x}{2} (\sin(x) - \cos(x)) \right)' = \frac{e^x}{2} (\sin(x) - \cos(x)) + \frac{e^x}{2} (\cos(x) + \sin(x)) = e^x \sin(x).\]

It’s magic!

Problem: Evaluate

\[\int x^5 \cos(x^3)dx.\]

Solution: This is a fun one because we need to combine a \(u\)-substitution with integration by parts. I believe your book refers to this as a “\(w\)-substitution” (this is a little silly since it’s the same thing, but I get why they are doing it – they don’t want your \(u\)’s to get mixed up). The \(x^3\) on the inside of cosine is annoying, so we’re going to get rid of it by letting \(w = x^3\). The price we pay is that \(dw = 3x^2 dx\), so

\[\int x^5 \cos(x^3)dx = \int x^5 \cos(w) \frac{dw}{3x^2} = \frac{1}{3} \int x^3 \cos(w) dw = \frac{1}{3} \int w \cos(w)dw.\]

Now it’s much nicer, and it’s obvious we need to do integration by parts. Unlike the prior one, we only need to do it once and it’s straightforward. Let’s get rid of the lonely \(w\) by setting \(u = w\), so \(du = dw\). This means that \(dv = \cos(w)dw\), so \(v = \sin(w)\). We have

\[\int w \cos(w)dw = w \sin(w) - \int \sin(w) dw = w \sin(w) + \cos(w) + C.\]

We’re almost done. We need to rewrite this in terms of \(x\), so remember that \(w = x^3\). We get

\[\int x^5 \cos(x^3)dx = x^3 \sin(x^3) + \cos(x^3) + C.\]

Trigonometric Integrals

While nothing is technically new in this section, this really relies on us remembering our trig identities. There are three identities that will be useful. The first is the Pythagorean theorem:

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

Next up is the half-angle identity:

\[\cos^2(\theta) = \frac{1 + \cos(2\theta)}{2}.\]

Finally, we have the double angle formula:

\[\cos(2\theta) = \cos^2(\theta) - \sin^2(\theta).\]

The other useful thing to remember is just the definition of the trig functions. Remember that on a right triangle, \(\sin(\theta)\) is opposite over hypotenuse, \(\cos(\theta)\) is adjacent over hypotenuse, \(\tan(\theta) = \sin(\theta)/\cos(\theta)\), \(\sec(\theta) = 1/\cos(\theta)\), \(\csc(\theta) = 1/\sin(\theta)\), and \(\cot(\theta) = 1/\tan(\theta)\). With these, we have the ingredients to solve some problems.

Problem: Evaluate

\[I(n) = \int \cos^n(\theta) d\theta, \text{ where } n \geq 1.\]

Solution: Let’s do some baby cases. First, if \(n =1\), then

\[I(1) = \int \cos(\theta) d\theta = \sin(\theta) + C.\]

Next, if \(n =2\), we use the half-angle formula:

\[I(2) = \int \cos^2(\theta)d\theta = \int \frac{1 + \cos(2\theta)}{2} d\theta = \frac{\theta}{2} + \frac{\sin(2\theta)}{4} + C.\]

Now, if \(n=3\), we have

\[\int \cos^3(\theta)d\theta = \int \cos(\theta) \cos^2(\theta) d\theta.\]

Let’s use the Pythagorean theorem. Solving for \(\cos^2(\theta)\), we have

\[\cos^2(\theta) = 1 - \sin^2(\theta),\]

so

\[\int \cos^3(\theta)d\theta = \int \cos(\theta)(1 - \sin^2(\theta)) d\theta.\]

Now distribute to get

\[I(3) = I(1) - \int \cos(\theta) \sin^2(\theta)d\theta.\]

Aha! If we let \(u = \sin(\theta)\), then \(du = \cos(\theta) d\theta,\) so

\[I(3) = I(1) - \int u^2 du = I(1) - \frac{u^3}{3} + C = I(1) - \frac{\sin(\theta)^3}{3} + C.\]

If \(n=4\), then

\[I(4) = \int \cos^4(\theta)d\theta = \int (\cos^2(\theta))^2 d\theta.\]

Let’s use the half-angle formula again:

\[I(4) = \int \left( \frac{1 + \cos(2\theta)}{2} \right)^2 d\theta = \int \left(\frac{1}{4} + \frac{\cos(2\theta)}{2} + \frac{\cos^2(2\theta)}{4} \right) d\theta.\]

Now we’re getting somewhere. The first and second integrals are easy:

\[\int \int \left(\frac{1}{4} + \frac{\cos(2\theta)}{2} \right)d\theta = \frac{\theta}{4} + \frac{\sin(2\theta)}{4} + C.\]

The last one is still a little too hard as is. There are two ways of approaching it. For practice, let’s use the half-angle formula (the other way is to do a \(u\)-sub and use our prior work). Notice

\[\cos^2(2\theta) = \frac{1 + \cos(4\theta)}{2} \implies \frac{\cos^2(2\theta)}{4} = \frac{1 + \cos(4\theta)}{8}.\]

Substitute this in to get

\[\int \frac{\cos^2(2\theta)}{4} d\theta = \frac{\theta}{8} + \frac{\sin(4\theta)}{32} + C.\]

So:

\[I(4) = \frac{\theta}{4} + \frac{\sin(2\theta)}{4} + \frac{\theta}{8} + \frac{\sin(4\theta)}{32}.\]

We’re going to start to see a pattern. We have

\[I(5) = \int \cos^5(\theta) d\theta = \int \cos(\theta) (\cos^2(\theta))^2d\theta = \int \cos(\theta) (1 - \sin^2(\theta))^2 d\theta.\]

Let \(u = \sin(\theta)\), so \(du = \cos(\theta)d\theta\). Then

\[I(5) = \int (1 - u^2)^2 du.\]

In fact, let’s just make this observation now. If \(n \geq 3\) is odd, so we can write it as \(2k + 1\) for $k \geq 1$$, then

\[I(2k+1) = \int \cos^{2k+1}(\theta)d\theta = \int \cos(\theta) (1 - \sin^2(\theta))^k d\theta = \int (1 - u^2)^k du.\]

Remember that the binomial theorem says

\[(1 - u^2)^k = \sum_{j=0}^k \binom{k}{j} (-u^2)^j.\]

So

\[I(2k+1) = \sum_{j=0}^k \binom{k}{j} (-1)^j \int u^{2j} du.\]

Now

\[I(2k+1) = \sum_{j=0}^k \binom{k}{j} (-1)^j \frac{u^{2j+1}}{2j+1},\]

and we remember that \(u = \sin(\theta)\), so

\[I(2k+1) = \sum_{j=0}^k \binom{k}{j} (-1)^j \frac{(\sin(\theta))^{2j+1}}{2j+1}.\]

It’s amazing, we now just have a formula we can use if someone asks for \(\int \cos^{2k+1}(\theta)d\theta\) for \(k \geq 1\).

For even powers, we have to hope there’s a nice formula for \(\cos^{2k}(\theta)\) when \(k \geq 1\). Combining the half angle formula with the binomial theorem, we have

\[\cos^{2k}(\theta) = (\cos^2(\theta))^k = \left( \frac{1 + \cos(2\theta)}{2}\right)^k = \sum_{j=0}^k \binom{k}{j} \left( \frac{1}{2} \right)^{k} \cos^j(2\theta).\]

So

\[I(2k) = \int \cos^{2k}(\theta) d\theta = \sum_{j=0}^k \binom{k}{j} \left(\frac{1}{2}\right)^k \int \cos^j(2\theta)d\theta.\]

If we let \(u = 2\theta\), then \(du = 2d\theta\), so

\[I(2k) = \int \cos^{2k}(\theta) d\theta = \sum_{j=0}^k \binom{k}{j} \left(\frac{1}{2}\right)^{k+1} \int \cos^j(u)du = \sum_{j=0}^k \binom{k}{j} \left(\frac{1}{2}\right)^{k+1} \int \cos^j(u)du.\]

We have to be careful with this formula and remember that \(u = 2\theta\), but this lets us use our prior work to solve for the integral. Sadly, this is sort of the best we can expect for now (there is a way to get a closed formula, but unless you’re really interested this is good enough for now). Either way, we have a nice iterative procedure for solving for the integral, and one could theoretically program this into a computer.

Problem: Evaluate

\[\int \tan^{17}(x) \sec^3(x)dx.\]

Solution: As I pointed out in recitation, there are a few ways to approach this. I’m going to first do the “right” way and then the “wrong” way – they both technically give the same answer, but one is a lot of work and the other one is very easy.

The easy way: notice

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

so dividing everything by \(\cos^2(x)\) gives us

\(\tan^2(x) + 1 = \sec^2(x)\).

Now we’re going to write

\[\int \tan^{17}(x) \sec^3(x)dx = \int (\sec^2(x) - 1)^8 \tan(x) \sec^3(x)dx.\]

Let \(u = \sec(x)\), so \(du = \sec(x)\tan(x)dx\). Then

\[\int \tan^{17}(x) \sec^3(x)dx = \int u^2(u^2 - 1)^8 du.\]

Now we have to foil:

\[(u^2 - 1)^8 = \sum_{j=0}^8 \binom{8}{j} (-1)^j u^{2j},\]

so

\[u^2(u^2 - 1)^8 = \sum_{j=0}^8 \binom{8}{j} (-1)^j u^{2j+2}.\]

Integrating gives us

\[\int \tan^{17}(x) \sec^3(x)dx = \sum_{j=0}^8 \binom{8}{j} (-1)^j \frac{u^{2j+3}}{2j+3},\]

and we substitute in \(u = \sec(x)\) to get

\[\int \tan^{17}(x) \sec^3(x)dx = \sum_{j=0}^8 \binom{8}{j} (-1)^j \frac{\sec^{2j+3}(x)}{2j+3}.\]

The hard way: we can write

\[\int \tan^{17}(x) \sec^3(x) dx = \int \tan^{17}(x) (1 + \tan^2(x))\sec(x) dx.\]

Distributing:

\[\int \tan^{17}(x) \sec^3(x) dx = \int \tan^{17}(x) \sec(x) dx + \int \tan^{19}(x) \sec(x)dx.\]

Now we can remember \(\sec(x) = 1/\cos(x)\) and \(\tan(x) = \sin(x)/\cos(x)\):

\[\int \tan^{17}(x) \sec^3(x) dx = \int \frac{\sin^{17}(x)}{\cos^{18}(x)} dx + \int\frac{\sin^{19}(x)}{\cos^{20}(x)}dx.\]

Now we gotta put in some work. Remember

\[\sin^{17}(x) = \sin^{16}(x) \sin(x) = (\sin^2(x))^8 \sin(x) = (1 - \cos^2(x))^8 \sin(x).\]

If we let \(u = \cos(x)\), then \(du = -\sin(x)dx\), so

\[\int \frac{\sin^{17}(x)}{\cos^{18}(x)} dx = -\int \frac{(1-u^2)^8}{u^{18}}.\]

Now it’ll be helpful to use the binomial theorem:

\[(1 - u^2)^8 = \sum_{j=0}^8 \binom{8}{j} (-1)^j u^{2j}, \text{ so } \frac{(1 - u^2)^8}{u^{18}} = \sum_{j=0}^8 \binom{8}{j} (-1)^j u^{2j-18}.\]

Notice that for \(0 \leq j \leq 8\) an integer we have \(2j - 18 \neq -1\), so we can just apply the power rule:

\[\int \frac{(1-u^2)^8}{u^{18}} du = \sum_{j=0}^8 \binom{8}{j} (-1)^j \frac{u^{2j-17}}{2j-17}.\]

Finally, remember that \(u = \cos(x)\), so

\[\int \frac{(1-u^2)^8}{u^{18}} du = \sum_{j=0}^8 \binom{8}{j} (-1)^j \frac{\cos^{2j-17}(x)}{2j-17}.\]

The same sort of trick applies for the other integral to give us

\[\int\frac{\sin^{19}(x)}{\cos^{20}(x)}dx = \sum_{j=0}^9 \binom{9}{j} (-1)^j \frac{\cos^{2j-19}(x)}{2j-19}.\]

So at the end of the day:

\[\int \tan^{17}(x) \sec^3(x) dx = \sum_{j=0}^8 \binom{8}{j} (-1)^{j+1} \frac{\cos^{2j-17}(x)}{2j-17} + \sum_{j=0}^9 \binom{9}{j} (-1)^{j+1} \frac{\cos^{2j-19}(x)}{2j-19}.\]

Both answers are technically the same (up to some algebra mistakes), but one was much easier.

Problem: Evaluate

\[\int \tan^2(x) \sin(x) dx.\]

Solution: We’re going to write it in terms of sines and cosines:

\[\int \tan^2(x) \sin(x) dx = \int \frac{\sin^3(x)}{\cos^2(x)}dx.\]

Now, \(\sin^3(x) = (1 - \cos^2(x))\sin(x),\) so we can write

\[\int \tan^2(x) \sin(x) dx = \int \frac{1-\cos^2(x)}{\cos^2(x)} \sin(x)dx.\]

Let \(u = \cos(x)\), so \(du = - \sin(x)dx\). Then

\[\int \tan^2(x) \sin(x) dx = - \int \frac{1-u^2}{u^2}du = \int du - \int u^{-2} du = u + u^{-1} + C.\]

Substitute in \(u = \cos(x)\) to get

\[\int \tan^2(x) \sin(x) dx = - \int \frac{1-u^2}{u^2}du = \int du - \int u^{-2} du = \cos(x) + \sec(x) + C.\]

Problem: Evaluate

\[\int \sec(x) dx \text{ and } \int \sec^3(x)dx.\]

Solution: This is hard one. Integration by parts breaks, there’s nothing to substitute, and no trig identities are helpful (immediately). Instead, we have to do a classic trick of multiplying the top and bottom by \(\sec(x) + \tan(x)\). Notice that

\[\int \sec(x) dx = \int \frac{\sec^2(x) + \sec(x)\tan(x)}{\sec(x) + \tan(x)}dx.\]

Now let \(u = \sec(x) + \tan(x)\), so \(du = (\sec(x) \tan(x) + \sec^2(x))dx.\) In particular, we have

\[\int \sec(x) dx = \int \frac{du}{u} = \ln \mid \sec(x) + \tan(x) \mid + C.\]

Let’s try integration by parts for the second one. Notice that

\[\int \sec^3(x) dx = \int \sec^2(x) \sec(x) dx.\]

Now let \(dv = \sec^2(x) dx\), so \(v = \tan(x)\), and let \(u = \sec(x)\), so \(du = \sec(x)\tan(x) dx\). We get

\[\int \sec^3(x) dx = \sec(x) \tan(x) - \int \sec(x) \tan^2(x) dx.\]

Next, \(\tan^2(x) = \sec^2(x) - 1\), so

\[\int \sec^3(x) dx = \sec(x) \tan(x) - \int \sec(x) (\sec^2(x) - 1) dx = \sec(x) \tan(x) - \int \sec^3(x)dx + \int \sec(x)dx.\]

If we move everything to one side, we get

\[2\int \sec^3(x) dx = \sec(x) \tan(x) + \int \sec(x)dx.\]

Using our answer from above:

\[\int \sec^3(x)dx = \frac{\sec(x) \tan(x)}{2} + \frac{\ln \mid \sec(x) + \tan(x) \mid}{2} + C.\]

Remark: Along the way, we have also discovered that

\[\int \sec(x) \tan^2(x) dx = \int (\sec^3(x) - \sec(x))dx = \frac{\sec(x) \tan(x)}{2} - \frac{\ln \mid \sec(x) + \tan(x) \mid}{2} + C.\]

Trigonometric Substitution

This is one of the trickier subjects in Calculus. Generally, we have a square root and we want to get rid of it, so for example we have something like

\[\int \sqrt{x^2 - 9}dx.\]

None of our integration techniques so far seem very useful. However, this looks awfully similar to the Pythagorean identity (after squinting a lot). Let’s try to rearrange it a bit: factor out the \(9\) to get

\[3\int \sqrt{(x/3)^3 - 1}dx.\]

Now notice

\[\tan^2(\theta) + 1 = \sec^2(\theta) \implies \tan^2(\theta) = \sec^2(\theta) - 1.\]

This looks promising! Let’s suppose \(\theta\) is such that

\[(x/3) = \sec(\theta) \text{ or } 3 \sec(\theta) = x.\]

Solving for \(dx\), we have

\[3 \sec(\theta) \tan(\theta) d\theta = dx,\]

so we go back and we have

\[\int \sqrt{x^2 - 9}dx = 9 \int \sqrt{\tan^2(\theta)} \sec(\theta) \tan(\theta) d\theta.\]

Annoyingly, square roots and squares don’t interact very nicely with one another. However, notice that I am lying to you, in the sense that I am hiding information when I flippantly say “let \(x = 3\sec(\theta)\).” To be precise, I am actually saying

\[\theta = \text{arcsec} \left( \frac{x}{3} \right).\]

This means that \(0\leq \theta \leq \pi\) and \(\theta \neq \pi/2\) (see here). On this interval, we have that \(\tan(\theta)\) is positive. So we do not have to worry about the absolute value here. Note that nobody really spends any time on this, and it’s okay to be flippant here, but it is an important detail. With this, let’s go back and observe that

\[\int \sqrt{x^2 - 9}dx = 9 \int \sec(\theta) \tan^2(\theta) d\theta.\]

As we noted in the last section, this last integral is hard. We have

\[\int \sqrt{x^2 - 9}dx = 9 \int \sec(\theta) \tan^2(\theta) d\theta = 9 \left(\frac{\sec(\theta) \tan(\theta)}{2} - \frac{\ln \mid \sec(\theta) + \tan(\theta) \mid}{2} \right) + C.\]

This seems terrible, but it’s not as bad as it could be. Remember that \(\sec(\theta) = \frac{x}{3}\). We also see that

\[\tan^2(\theta) + 1 = \sec^2(\theta) = \frac{x^2}{9}.\]

Since \(\tan(\theta)\) is positive, we get

\[\tan(\theta) = \sqrt{ \frac{x^2}{9} - 1}.\]

Putting it all together:

\[\int \sqrt{x^2 - 9}dx = 9 \int \sec(\theta) \tan^2(\theta) d\theta = 9 \left(\frac{\frac{x}{3}\sqrt{ \frac{x^2}{9} - 1} }{2} - \frac{\ln \mid \frac{x}{3} + \sqrt{ \frac{x^2}{9} - 1} \mid}{2} \right) + C.\]

The important thing to notice here is that this went from something impossible to something doable (even if it is a nasty answer at the end). This is the power of a trig substitution.

Problem: Evaluate the following integral using a trigonometric substitution

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx.\]

Solution: In the denominator, we have something squared plus a constant. This suggests that we want to use a substitution with \(\tan(\theta)\). Let’s do some algebra to make this better. Rearrange the terms to get

\[\frac{27 x^2}{(4 + 9x^2)^{3/2}} = \frac{27 x^2}{4^{3/2} (1 + (3x/2)^2)^{3/2}}.\]

Let’s also just point out now that \(4^{3/2} = 8\), so

\[\frac{27 x^2}{(4 + 9x^2)^{3/2}} = \frac{27 x^2}{8 (1 + (3x/2)^2)^{3/2}}.\]

Next, let’s pull all of the constants out of our integral:

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx = \frac{27}{8} \int \frac{x^2}{(1 + (3x/2)^{2})^{3/2}}dx.\]

Now we’re in business. Let \(\theta\) be such that \(\tan(\theta) = 3x/2\), or \(2 \tan(\theta) = 3x\). Then:

\[2 \sec^2(\theta) d\theta = 3 dx,\]

so

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx = \frac{9}{4} \int \frac{x^2 \sec^2(\theta)}{(1 + \tan(\theta)^{2})^{3/2}} d\theta.\]

There’s an annoying \(x^2\) in the numerator, but notice that

\[x^2 = \frac{4}{9} \tan^2(\theta),\]

so

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx = \int \frac{\tan^2(\theta) \sec^2(\theta)}{(1 + \tan(\theta)^{2})^{3/2}} d\theta.\]

Now we use our identity. \(1 + \tan^2(\theta) = \sec^2(\theta)\). Furthermore, the range of \(\arctan\) is \(-\pi/2\) to \(\pi/2\), so \(\sec(\theta)\) is always positive (meaning we can ignore issues with the absolute value). This let’s us write

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx = \int \frac{\tan^2(\theta) \sec^2(\theta)}{\sec^3(\theta)} d\theta = \int \frac{\tan^2(\theta)}{\sec(\theta)} d\theta.\]

Now let’s write this in terms of sines and cosines:

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx= \int \frac{\sin^2(\theta)}{\cos(\theta)} d\theta.\]

Next, write \(\sin^2(\theta) = 1 - \cos^2(\theta)\), so

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx= \int \frac{1 - \cos^2(\theta)}{\cos(\theta)} d\theta = \int \sec(\theta)d\theta - \int \cos(\theta)d\theta.\]

Going back, we know what the integral of secant is, so

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx = \int \sec(\theta)d\theta - \int \cos(\theta)d\theta = \ln \mid \sec(\theta) + \tan(\theta) \mid - \sin(\theta) + C.\]

Finally, we need our answer in terms of \(x\)’s. If \(\tan(\theta) = \frac{3}{2}x,\) then we draw a right triangle where the opposite side has length \(3x\) and the adjacent side has length \(2\). The hypotenuse will have length \(\sqrt{4 + 9x^2},\) so we get

\[\tan(\theta) = \frac{3x}{2}, \ \ \sec(\theta) = \frac{\sqrt{4 + 9x^2}}{2}, \ \ \sin(\theta) = \frac{3x}{\sqrt{4 + 9x^2}}.\]

So:

\[\int \frac{27 x^2}{(4 + 9x^2)^{3/2}}dx = \ln \mid \frac{\sqrt{4 + 9x^2}}{2} +\frac{3x}{2} \mid - \frac{3x}{\sqrt{4 + 9x^2}} + C.\]

Remark: Do we need an absolute value in the above? Let’s think for a second. We have that the inside is negative when

\[\frac{\sqrt{4 + 9x^2}}{2} +\frac{3x}{2} \leq 0.\]

Notice that it is equal to \(0\) when

\[\sqrt{4 + 9x^2} = 3x \implies 4 + 9x^2 = 9x^2,\]

but this is impossible. Also notice that at \(x =0\) the inside is positive. By the intermediate value theorem, the only way the inside (which is a continuous function) could go from positive to negative is if it passed through zero, and we just observed this doesn’t happen. The inside is always positive, and we can drop the absolute value.

Written on September 18, 2023