# Tag Archives: integration

## Motivating a Change of Variables in $\int \log x / (x^2 + ax + b) dx$

We will consider the improper definite integral ${\int_0^\infty \frac{\log x}{x^2 + ax + b}dx}$ for ${a,b > 0}$ (to guarantee convergence). This can be done through in many ways, but the purpose of this brief note is to motivate a particular way of writing integrals to look for symmetries to exploit while evaluating them.

Before we begin, let us note something special about integrals of the form

$$\int_0^\infty f(x) \frac{dx}{x}. \tag{1}$$
Under the change of variables ${x \mapsto \frac{1}{x}}$, we see that

$$\int_0^\infty f(x) \frac{dx}{x} = \int_0^\infty f(1/x) \frac{dx}{x}. \tag{2}$$
And under the change of variables ${x \mapsto \alpha x}$, we see that

$$\int_0^\infty f(x) \frac{dx}{x} = \int_0^\infty f(\alpha x) \frac{dx}{x}. \tag{3}$$
In other words, the integral is almost invariant under these changes of variables — only the integrand ${f(x)}$ is affected while the bounds of integration and the measure ${\frac{dx}{x}}$ remain unaffected.

In fact, the measure ${\frac{dx}{x}}$ is the Haar measure associated to the line ${\mathbb{R}_+}$, so this integral property is not random. When working with integrals over the positive real line, it can often be fortuitous to explicitly write the integral against ${\frac{dx}{x}}$ before attempting symmetry arguments.

Here, we rewrite our integral as

$$\int_0^\infty \frac{\log x}{x + a + \frac{b}{x}} \frac{dx}{x}. \tag{4}$$
The denominator is clearly invariant under the map ${x \mapsto \frac{b}{x}}$, while ${\log x}$ becomes ${\log(\frac{b}{x}) = \log b – \log x}$. Along with the special property above, this means that

$$\int_0^\infty \frac{\log x}{x^2 + ax + b}dx = \int_0^\infty \frac{\log b – \log x}{x^2 + ax + b} dx. \tag{5}$$
Adding our original integral to both sides, we see that

$$\int_0^\infty \frac{\log x}{x^2 + ax + b} dx = \frac{\log b}{2} \int_0^\infty \frac{1}{x^2 + ax + b}dx. \tag{6}$$

This now becomes a totally routine integral, albeit not entirely pleasant, to evaluate. Generally, one can complete the square and then either perform an argument by partial fractions or an argument through trig substitution (alternately, always use partial fractions and allow some complex numbers; or use hyperbolic trig sub; etc.). Let ${c = b – \frac{a^2}{4}}$, which arises naturally when completing the square in the denominator. If ${c = 0}$, then the change of variables ${x \mapsto x – \frac{a}{2}}$ transforms our integral into

$$\frac{\log b}{2} \int_{a/2}^\infty \frac{dx}{x^2} = \frac{\log b}{a}. \tag{7}$$

When ${c \neq 0}$, performing the change of variables ${x \mapsto \sqrt{\lvert c \rvert} x – \frac{a}{2}}$ transforms our integral into

$$\frac{\log b}{2\sqrt{\lvert c \rvert}} \int_{\frac{a}{2\sqrt{\lvert c \rvert}}}^\infty \frac{dx}{x^2 + 1} = \frac{\log b}{2\sqrt{\lvert c \rvert}} \left(\frac{\pi}{2} – \arctan\left(\frac{a}{2\sqrt{\lvert c \rvert}}\right)\right) \tag{8}$$
when ${c > 0}$, or

$$\frac{\log b}{2\sqrt{\lvert c \rvert}} \int_{\frac{a}{2\sqrt{\lvert c \rvert}}}^\infty \frac{dx}{x^2 – 1} = \frac{\log b}{4\sqrt{\lvert c \rvert}} \log\frac{a + 2\sqrt{\lvert c \rvert}}{a – 2\sqrt{\lvert c \rvert}} \tag{9}$$
when ${c < 0}$.

## One cute integral served two ways

Research kicks up, writing kicks back. So in this brief note, we examine a pair of methods to examine an integral. They’re both very clever, I think. We seek to understand $$I := \int_0^{\pi/2}\frac{\sin(x)}{\sin(x) + \cos(x)} dx$$

We base our first idea on an innocuous-seeming integral identity.

For ${f(x)}$ integrable on ${[0,a]}$, we have $$\int_0^a f(x) dx = \int_0^a f(a-x)dx. \tag{1}$$

Posted in Mathematics | | 2 Comments

## Trigonometric and related substitutions in integrals

$\DeclareMathOperator{\csch}{csch}$
$\DeclareMathOperator{\sech}{sech}$
$\DeclareMathOperator{\arsinh}{arsinh}$

1. Introduction

In many ways, a first semester of calculus is a big ideas course. Students learn the basics of differentiation and integration, and some of the big-hitting theorems like the Fundamental Theorems of Calculus. Even in a big ideas course, students learn how to differentiate any reasonable combination of polynomials, trig, exponentials, and logarithms (elementary functions).

But integration skills are not pushed nearly as far. Do you ever wonder why? Even at the end of the first semester of calculus, there are many elementary functions that students cannot integrate. But the reason isn’t that there wasn’t enough time, but instead that integration is hard. And when I say hard, I mean often impossible. And when I say impossible, I don’t mean unsolved, but instead provably impossible (and when I say impossible, I mean that we can’t always integrate and get a nice function out, unlike our ability to differentiate any nice function and get a nice function back). An easy example is the sine integral $$\int \frac{\sin x}{x} \mathrm d x,$$
which cannot be expressed in terms of elementary functions. In short, even though the derivative of an elementary function is always an elementary function, the antiderivative of elementary functions don’t need to be elementary.

Worse, even when antidifferentiation is possible, it might still be really hard. This is the first problem that a second semester in calculus might try to address, meaning that students learn a veritable bag of tricks of integration techniques. These might include ${u}$-substitution and integration by parts (which are like inverses of the chain rule and product rule, respectively), and then the relatively more complicated techniques like partial fraction decomposition and trig substitution.

In this note, we are going to take a closer look at problems related to trig substitution, and some related ideas. We will assume familiarity with ${u}$-substitution and integration by parts, and we might even use them here from time to time. This, after the fold.

## Math 100: Week 4

This is a post for my math 100 calculus class of fall 2013. In this post, I give the 4th week’s recitation worksheet (no solutions yet – I’m still writing them up). More pertinently, we will also go over the most recent quiz and common mistakes. Trig substitution, it turns out, is not so easy.

Before we hop into the details, I’d like to encourage you all to avail of each other, your professor, your ta, and the MRC in preparation for the first midterm (next week!).

1. The quiz

There were two versions of the quiz this week, but they were very similar. Both asked about a particular trig substitution

$\displaystyle \int_3^6 \sqrt{36 – x^2} \mathrm{d} x$

And the other was

$\displaystyle \int_{2\sqrt 2}^4 \sqrt{16 – x^2} \mathrm{d}x.$

They are very similar, so I’m only going to go over one of them. I’ll go over the first one. We know we are to use trig substitution. I see two ways to proceed: either draw a reference triangle (which I recommend), or think through the Pythagorean trig identities until you find the one that works here (which I don’t recommend).

We see a ${\sqrt{36 – x^2}}$, and this is hard to deal with. Let’s draw a right triangle that has ${\sqrt{36 – x^2}}$ as a side. I’ve drawn one below. (Not fancy, but I need a better light). In this picture, note that ${\sin \theta = \frac{x}{6}}$, or that ${x = 6 \sin \theta}$, and that ${\sqrt{36 – x^2} = 6 \cos \theta}$. If we substitute ${x = 6 \sin \theta}$ in our integral, this means that we can replace our ${\sqrt{36 – x^2}}$ with ${6 \cos \theta}$. But this is a substitution, so we need to think about ${\mathrm{d} x}$ too. Here, ${x = 6 \sin \theta}$ means that ${\mathrm{d}x = 6 \cos \theta}$.

Some people used the wrong trig substitution, meaning they used ${x = \tan \theta}$ or ${x = \sec \theta}$, and got stuck. It’s okay to get stuck, but if you notice that something isn’t working, it’s better to try something else than to stare at the paper for 10 minutes. Other people use ${x = 6 \cos \theta}$, which is perfectly doable and parallel to what I write below.

Another common error was people forgetting about the ${\mathrm{d}x}$ term entirely. But it’s important!.

Substituting these into our integral gives

$\displaystyle \int_{?}^{??} 36 \cos^2 (\theta) \mathrm{d}\theta,$

where I have included question marks for the limits because, as after most substitutions, they are different. You have a choice: you might go on and put everything back in terms of ${x}$ before you give your numerical answer; or you might find the new limits now.

It’s not correct to continue writing down the old limits. The variable has changed, and we really don’t want ${\theta}$ to go from ${3}$ to ${6}$.

If you were to find the new limits, then you need to consider: if ${x=3}$ and ${\frac{x}{6} = \sin \theta}$, then we want a ${\theta}$ such that ${\sin \theta = \frac{3}{6}= \frac{1}{2}}$, so we might use ${\theta = \pi/6}$. Similarly, when ${x = 6}$, we want ${\theta}$ such that ${\sin \theta = 1}$, like ${\theta = \pi/2}$. Note that these were two arcsine calculations, which we would have to do even if we waited until after we put everything back in terms of ${x}$ to evaluate.

Some people left their answers in terms of these arcsines. As far as mistakes go, this isn’t a very serious one. But this is the sort of simplification that is expected of you on exams, quizzes, and homeworks. In particular, if something can be written in a much simpler way through the unit circle, then you should do it if you have the time.

So we could rewrite our integral as

$\displaystyle \int_{\pi/6}^{\pi/2} 36 \cos^2 (\theta) \mathrm{d}\theta.$

How do we integrate ${\cos^2 \theta}$? We need to make use of the identity ${\cos^2 \theta = \dfrac{1 + \cos 2\theta}{2}}$. You should know this identity for this midterm. Now we have

$\displaystyle 36 \int_{\pi/6}^{\pi/2}\left(\frac{1}{2} + \frac{\cos 2 \theta}{2}\right) \mathrm{d}\theta = 18 \int_{\pi/6}^{\pi/2}\mathrm{d}\theta + 18 \int_{\pi/6}^{\pi/2}\cos 2\theta \mathrm{d}\theta.$

The first integral is extremely simple and yields ${6\pi}$ The second integral has antiderivative ${\dfrac{\sin 2 \theta}{2}}$ (Don’t forget the ${2}$ on bottom!), and we have to evaluate ${\big[9 \sin 2 \theta \big]_{\pi/6}^{\pi/2}}$, which gives ${-\dfrac{9 \sqrt 3}{2}}$. You should know the unit circle sufficiently well to evaluate this for your midterm.

And so the final answer is ${6 \pi – \dfrac{9 \sqrt 2}{2} \approx 11.0553}$. (You don’t need to be able to do that approximation).

Let’s go back a moment and suppose you didn’t re”{e}valuate the limits once you substituted in ${\theta}$. Then, following the same steps as above, you’d be left with

$\displaystyle 18 \int_{?}^{??}\mathrm{d}\theta + 18 \int_{?}^{??}\cos 2\theta \mathrm{d}\theta = \left[ 18 \theta \right]_?^{??} + \left[ 9 \sin 2 \theta \right]_?^{??}.$

Since ${\frac{x}{6} = \sin \theta}$, we know that ${\theta = \arcsin (x/6)}$. This is how we evaluate the left integral, and we are left with ${[18 \arcsin(x/6)]_3^6}$. This means we need to know the arcsine of ${1}$ and ${\frac 12}$. These are exactly the same two arcsine computations that I referenced above! Following them again, we get ${6\pi}$ as the answer.

We could do the same for the second part, since ${\sin ( 2 \arcsin (x/6))}$ when ${x = 3}$ is ${\sin (2 \arcsin \frac{1}{2} ) = \sin (2 \cdot \frac{\pi}{6} ) = \frac{\sqrt 3}{2}}$; and when ${x = 6}$ we get ${\sin (2 \arcsin 1) = \sin (2 \cdot \frac{\pi}{2}) = \sin (\pi) = 0}$.

Putting these together, we see that the answer is again ${6\pi – \frac{9\sqrt 3}{2}}$.

Or, throwing yet another option out there, we could do something else (a little bit wittier, maybe?). We have this ${\sin 2\theta}$ term to deal with. You might recall that ${\sin 2 \theta = 2 \sin \theta \cos \theta}$, the so-called double-angle identity.

Then ${9 \sin 2\theta = 18 \sin \theta \cos \theta}$. Going back to our reference triangle, we know that ${\cos \theta = \dfrac{\sqrt{36 – x^2}}{6}}$ and that ${\sin \theta = \dfrac{x}{6}}$. Putting these together,

$\displaystyle 9 \sin 2 \theta = \dfrac{ x\sqrt{36 – x^2} }{2}.$

When ${x=6}$, this is ${0}$. When ${x = 3}$, we have ${\dfrac{ 3\sqrt {27}}{2} = \dfrac{9\sqrt 3}{2}}$.

And fortunately, we get the same answer again at the end of the day. (phew).

2. The worksheet

Finally, here is the worksheet for the day. I’m working on their solutions, and I’ll have that up by late this evening (sorry for the delay).

Ending tidbits – when I was last a TA, I tried to see what were the good predictors of final grade. Some things weren’t very surprising – there is a large correlation between exam scores and final grade. Some things were a bit surprising – low homework scores correlated well with low final grade, but high homework scores didn’t really have a strong correlation with final grade at all; attendance also correlated weakly. But one thing that really stuck with me was the first midterm grade vs final grade in class: it was really strong. For a bit more on that, I refer you to my final post from my Math 90 posts.