1
$\begingroup$

In some of my calculus classes, we are generally allowed to do something like

$$\int{\sqrt{\cos^2x}}\ dx = \int{\cos x}\ dx$$

with the justification that the trig function (in this particular case, cosine) is positive over "the interval", so the absolute value that should be around the trig function when the square root is gotten rid of is not necessary.

What logic is this assumption based on and why is it generally considered to be okay in certain practices of calculus? Otherwise, besides the obvious case of definite integrals where the interval is one in which the trig function is fully positive, when are we allowed to make these kinds of assumptions, in integration?

This question strays slightly into subjectivity, so if there is any objective clarification I can provide, please let me know.

$\endgroup$
1
  • 2
    $\begingroup$ It might be useful to note that $\sqrt{x^2}=\mid x\mid$ $\endgroup$ Commented Jun 25, 2021 at 14:26

4 Answers 4

1
$\begingroup$

I don't think it's ever okay to do that unless there's a given interval that $\cos x$ is always non-negative on.

The absolute value is definitely necessary.

E.g. $$\int_0^{2\pi} \sqrt{\cos^2 x} dx = 4 > 0$$ but $$\int_0^{2\pi} \cos x dx =0.$$

$\endgroup$
2
  • $\begingroup$ Okay so for integrals like $\int \sqrt{a^2- x^2} dx$, we make the substitution $x=a \sin t$. In this case, do we integrate $a|\cos t|\cos t$ or $a\cos^2 t$? $\endgroup$ Commented Feb 12, 2018 at 9:08
  • $\begingroup$ @SharvLaad it depends on the domain of $t$. The most convenient choice is $\left[-\frac\pi2,\frac\pi2\right]$ since $\cos$ is bijective in this interval and is non-negative, so we have $a^2\displaystyle\int\cos^2t~\mathrm dt$. $\endgroup$ Commented May 27 at 12:00
1
$\begingroup$

In general

\begin{align} \int\sqrt{\cos^2x}\>dx=&\>\text{sgn}(\cos x)\int\cos x \>dx\\ = &\frac{ \sqrt{\cos^2x}}{\cos x}\sin x +C= \tan x \sqrt{\cos^2x}+C \end{align}

$\endgroup$
0
$\begingroup$

It depends on the bounds of your equation, however if we want to be precise, you can do it but you have to include your absolute value signs $$ \int\sqrt{\cos^2x}dx = \int|\cos{x}|dx $$

Otherwise you cannot make the simplification for any arbitrary bounds

$\endgroup$
0
$\begingroup$

Let us first recall what the Fundamental Theorem of Calculus tells us. It says that if $f: [a,b] \to \mathbb{R}$ (here $a < b$) is a continuous function then the function $F:[a,b] \to \mathbb{R}$ defined by $$F(x) = \int_a^x f(t) \, dt,$$ is continuous on the closed interval $[a,b]$, differentiable on the open interval $(a,b)$, and has a derivative given by $F'(x) = f(x)$.

In the case of $$\int \sqrt{\cos^2 x} \, dx = \int |\cos x| \, dx,$$ as $f(x) = |\cos x|$ is clearly continuous for all $x \in \mathbb{R}$, $f$ in integrable (in the Riemann sense) and thus has a primitive which is continuous on $x \in [a,b]$ and differentiable on $x \in (a,b)$.

If the interval of integration you are interested in is $x \in [-\pi/2,\pi/2]$, then clearly $$\int |\cos x| \, dx = \sin x + C, \quad x \in [-\pi/2,\pi/2].$$

If you are however interested in some more general interval $x \in [a,b]$ then more care is needed. In such a case a primitive that satisfies the conditions imposed by the Fundamental Theorem of Calculus (namely continuity on the closed interval and differentiability on the open interval) is $$\int |\cos x| \, dx = F(x) + C,$$ where $$F(x) = \begin{cases} |\cos x| \cdot \tan x + 2 \left \lfloor \dfrac{2x + \pi}{2\pi} \right \rfloor, & \text{if} \,\,x \neq (2k + 1) \dfrac{\pi}{2}, k \in \mathbb{Z}\\[2ex] 2k + 1, & x = (2k + 1) \dfrac{\pi}{2}, \text{if} \,\,k \in \mathbb{Z}\\ \end{cases}$$ Here $\lfloor \cdot \rfloor$ denotes the floor function.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.