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.
Asked
Active
Viewed 100 times
0
-
1Wolfram functions already had the answer here – Тyma Gaidash Nov 21 '23 at 18:36
-
Possible explanations here and here? – Accelerator Nov 22 '23 at 02:04
1 Answers
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.$$
-
1Why you considered $sgn(\cos(x))$ to be a constant?@B.Goddard – Syamaprasad Chakrabarti Nov 21 '23 at 16:44
-
-
1How you evaluated $\int cos(x)sgn(cos(x))dx$ ?@B. Goddard – Syamaprasad Chakrabarti Nov 21 '23 at 17:40
-
@SyamaprasadChakrabarti,Evaluate the integral By taking two cases,After that One of Them will be $\sin x$ for $\cos x>0$,and Other will be $-\sin x$ for $\cos x \leq0$,Which means Integral depends on sign of $\cos x$,hence can be written as $(sgn(\cos x))\sin x$ which then Includes both cases – Dheeraj Gujrathi Nov 22 '23 at 10:06