# Trig substitution; why can we ignore the absolute value?

If we have to integrate $$f(x)=\frac{x}{\sqrt{1-x^2}}$$ and we substitute $x=\sin \theta$ then we eventually have to take the square root of $\cos^2x$ which is equal to $|\cos x|$. But in my textbook and class lectures, we simply remove the absolute value sign and replace it with $\cos x$.

Why do we do this? I don't understand how we can do this.

• What are you integrating $f$ over? – Clarinetist Jan 25 '15 at 2:33
• Normally positive values. Oh, I get it now. If we integrate for positive values then $x=\cos \theta > 0$ – Jason Jan 25 '15 at 2:35
• Not related to your question. But why don't $\int\frac{x}{\sqrt{1-x^2}}dx=-\frac{1}{2}\int\frac{d(1-x^2)}{\sqrt{1-x^2}}$? – velut luna Jan 25 '15 at 2:45
• You are actually asking about $\cos\theta$, not $\cos x$. When you chose to substitute $x=\sin\theta$ you implicitly chose $\theta$ in a certain range, and that range determines the sign of $\cos\theta$. – Marc van Leeuwen Jan 25 '15 at 14:17

This is a good question. It is a very easy mistake to assume that $\sqrt{u^2} = u$ (whether the $u$ in question is $\cos^2 \theta$ or something else). Of course the equation is true if $u$ is positive, but then we must have a good reason to say $u$ is positive.

So we started with the integral $$\int \frac{x}{\sqrt{1-x^2}}\, dx,$$ and we decide to try the trig substitution $x = \sin\theta$. This gives us $$\int \frac{\sin \theta}{\sqrt{\cos^2\theta}}\, \cos\theta \, d\theta.$$ But before we go any further, let's consider what kind of values $x$ might have and how our substitution might relate values of $x$ with values of $\theta$ in this new integral.

I'm assuming you are not doing complex analysis here, that is, only real numbers are allowed, not complex numbers. So $\sqrt{1-x^2}$ is defined only for $-1 \leq x \leq 1,$ because if $|x| > 1$ then $1 - x^2$ is negative.

Now if we allow $x$ to vary within the range $-1 \leq x \leq 1,$ what is the correct range of $\theta$? We want a one-to-one relationship between the values of $x$ in $-1 \leq x \leq 1$ and our chosen range of values of $\theta$. For example, $x = -1$ should correspond to exactly one value of $\theta$ within the range of values we allow for $\theta$.

Clearly if $x = -1$ and $\sin\theta = x$, we must have $\theta = -\frac\pi2 + 2n\pi$ where $n$ is an integer. Suppose we choose $n = 0$, so $\theta = -\frac\pi2$. If we increase $\theta$ toward $\frac\pi2$, then $x$ increases toward $1$. So let's let $\theta$ vary within the range $-\frac\pi2 \leq \theta \leq \frac\pi2.$

But if $-\frac\pi2 \leq \theta \leq \frac\pi2$, then $\cos\theta \geq 0$, and the statement that $\sqrt{\cos^2\theta} = \cos\theta$ is justified. Everything proceeds smoothly from there in the way you have already (presumably) seen in your textbook and lectures.

How can we justify the assumption that $-\frac\pi2 \leq \theta \leq \frac\pi2$? It isn't so much an assumption as a definition on our part. When we substitute one variable for another variable, we get to say what range of values of the new variable we want to relate to the range of values the old variable might have, provided that these are consistent with the function we chose to use to relate the two variables.

Now just out of curiosity, suppose we had done the substitution just a little bit differently? We could have tried letting $\theta$ vary within the interval $\frac\pi2 \leq \theta \leq \frac{3\pi}2$. These values of $\theta$ also give us all the values of $x$ we might need. For these values of $\theta$, $\cos \theta \leq 0$, so $\sqrt{\cos^2\theta} = -\cos\theta$. Our integral then becomes $$\int \frac{\sin \theta}{\sqrt{\cos^2\theta}}\, \cos\theta \, d\theta = \int -\sin \theta \, d\theta = \cos\theta + C.$$ Now we want to reverse the substitution in order to get the answer to our original integral in terms of $x$. Since $\cos\theta \leq 0$, the only substitution consistent with our original substitution is $$\cos\theta = -\sqrt{1-x^2}.$$ We conclude that $$\int \frac{x}{\sqrt{1-x^2}}\, dx = -\sqrt{1-x^2} + C,$$ which is the same result we got when we let $-\frac\pi2 \leq \theta \leq \frac\pi2.$

We would also get the same result if we tried $-\frac{3\pi}2 \leq \theta \leq -\frac\pi2$ or $\frac{7\pi}2 \leq \theta \leq \frac{9\pi}2$. That's good; the solution to the integral is not a mere accident of exactly which substitution we chose.

• Late question but, what about the substitution $x=a\sec\theta$ in $\sqrt{x^2-a^2}$ ? why textbooks remove the square root without putting absolute sign although the range of $\tan\theta$ is $\Re$ ? – Mohamed Mostafa Jan 23 '16 at 20:06
• @MohamedMostafa If $x\geq a$ then let $0\leq\theta<\pi/2$; if $x\leq -a$ then let $\pi\leq\theta<3\pi/2$. In either case $\tan\theta\geq0$. If that doesn't explain it, I suggest you click "Ask Question" and explain your doubts in a new question. – David K Jan 23 '16 at 22:07
• aha, got it. Thanks – Mohamed Mostafa Jan 24 '16 at 10:38

We are letting $\theta=\arcsin x$. So $\theta$ ranges from $-\pi/2$ to $\pi/2$. Over this interval the cosine is non-negative.

Although in most cases positive sign is adequate to see how the integrand magnitude varies, we in fact neither ignore nor remove the double sign $\pm$ in front of radical sign. Either sign is implicitly understood. The above integral is strictly

$$\pm \sqrt{ 1-x^2} + C$$

which you may like to call minus or plus to correspond with + or - of original integrand .

If you integrate $\frac {1}{\sqrt {x^2}}$ in such a situation you get (up to constant of integration) $\; \log x$ and $\dfrac {1}{\log x}.$

EDIT 1:

Without reference to $\theta$ substitution two curves can be drawn one above x-axis and another below x-axis. For the former, area under curve is > 0, and for latter, < 0.

• No, the above integral is always $-\sqrt{1-x^2}+C$, and $\int \frac{1}{\sqrt{x^2}} \;dx = \log x, -\log -x$. – Strants Jan 25 '15 at 18:26
• @Strants:If the sign of integrand changes the sign of integral does not change? – Narasimham Jan 25 '15 at 19:13
• The sign of the integrand does not change, for reasons explained in the other answers. Moreover, we can verify that $$\frac{d}{dx}\sqrt{1-x^2} = \frac{-x}{\sqrt{1-x^2}} \not= \frac{x}{\sqrt{1-x^2}}$$ – Strants Jan 25 '15 at 19:16
• @Strants: For a semi-circle,this curve or any other curve found by square root, both possibilities exist as shown without at all referring to $\theta$ – Narasimham Jan 25 '15 at 19:50