0

How to integrate $$\int \sqrt{\cos^{2}(x)}dx$$ ? I know that $\sqrt{\cos^{2}(x)}=|\cos(x)|$. Therefore $|\cos(x)|=\cos(x)${when $\cos(x)>0$} , $|\cos(x)|=-\cos(x)${when $\cos(x)<0$} , $|\cos(x)|=0${when $\cos(x)=0$}. Now when $|\cos(x)|=\cos(x)$, then the result of the above integral will be $$\int \cos(x)dx=\sin(x)+C$$. When $|\cos(x)|=-\cos(x)$, then the result of the above integral will be $$\int -\cos(x)dx=-\sin(x)+C_1$$. And finally when $|\cos(x)|=0$, then the result of the above integral will be $0$. Therefore, we can clearly see here that $3$ different results are occuring. So, finally I thought of writing $|\cos(x)|=\cos(x)sgn(\cos(x))$. Therefore we can write the above integral as $$\int \sqrt{\cos^{2}(x)}dx$$= $$\int |\cos(x)|dx$$= $$\int \cos(x)sgn(\cos(x))dx$$. Now I am facing problem to integrate $$\int \cos(x)sgn(\cos(x))dx$$. So, please help me out with this integral.

1 Answers1

1

Since

$$\mbox{sgn}\cos x= \frac{\sqrt{\cos^2 x}}{\cos x},$$

You can just write

$$\int \sqrt{\cos^2 x} \; dx = \frac{\sqrt{\cos^2 x}}{\cos x}\sin x +C.$$