# In trig substitution integration problems why is the square root of tan^2(theta) = tan(theta)?

I mean...for a number ...say 64, we always take its positive square root $\sqrt{64} = 8$, whereas an algebraic number (i.e., a variable) $x^2$, applying the square root to it gives, by definition, $\sqrt{x^2} = |x|$

If what I wrote above is all true...then why in trig substitutions is, for example, $\sqrt{tan^2{\theta}} = tan(\theta)$? Theta is an integration variable...so shouldn't it really be $|tan(\theta)|$?

I think that I may be missing some pre-calculus knowledge here.

Thanks,

• What is an "integration variable?" – zz20s Dec 30 '15 at 23:27
• Hi @zz20s, say, integration against the differential $d\theta$ ... thanks, – user301813 Dec 30 '15 at 23:28
• You can assume $\tan(\theta)<0$ just as easily as one can assume $\tan(\theta) \ge 0$. I think we don't usually write both cases because of the "simpleness" (like $\tan(\theta)$ can be integrated in a similar way to that of $-\tan(\theta)$, the constant multiple is just a difference of signs. – randomgirl Dec 30 '15 at 23:29
• Hi @randomgirl, hmm....or perhaps, knowing the lower and upper limits of integration, say from 0 to $\large \frac{\pi}{2}$, we know that tan is always positive, and hence we take the positive square root? Does that sound right? Thanks, – user301813 Dec 30 '15 at 23:31
• Another example if we are integrating $\sqrt{\tan^2(\theta)}$ from -pi/2 to 0, then we know tan is negative there so $\sqrt{\tan^2(\theta)}=-\tan(\theta)$ – randomgirl Dec 30 '15 at 23:35

I think this example might sum up our discussion from above: $\int_\frac{-\pi}{2}^\frac{\pi}{2} \sqrt{\tan^2(\theta)} d \theta=\int_\frac{-\pi}{2}^0 -\tan(\theta) d \theta+\int_0^\frac{\pi}{2} \tan(\theta)d \theta$ I had to break up the integral because $\tan(\theta) <0$ on $(\frac{-\pi}{2},0)$ and $\tan(\theta) > 0$ on $(0,\frac{\pi}{2})$ So this is actually an improper integral since tan isn't defined at $\pm \frac{\pi}{2}$ Anyways for an easier not improper integral... see below: $\int_{-8}^9 \sqrt{x^2}dx=\int_{-8}^0 -x dx+\int_0^9 x dx$ I will add the following example (which is a non-improper integral) for fun: $\int_\frac{-\pi}{3}^\frac{\pi}{4} \sqrt{\tan^2(\theta)} d \theta=\int_\frac{-\pi}{3}^0 -\tan(\theta) d \theta+\int_0^\frac{\pi}{4} \tan(\theta)d \theta$
• You could rewrite it with the bounds as $\frac{\pm \pi}{4}$ – zz20s Dec 30 '15 at 23:50