Tuesday, April 30, 2019

integration - On the integral $intsqrt{1+cos x}text{d} x$




I've been wondering about the following integral recently:
$$
I = \int\sqrt{1+\cos x}\,\text{d}x
$$
The way I integrated it is I used the identity $\sqrt{1+\cos x} = \sqrt2\cos\frac x2$, and so
$$
I = 2\sqrt2\sin\frac x2 + C
$$




the problem is that $\sqrt{1+\cos x}$ is actually integrable over the entire real line, but the derivative of $2\sqrt2\sin\frac x2$ is only equal to $\sqrt{1+\cos x}$ in certain intervals. This is because the actual identity is $\sqrt{1+\cos x} = \sqrt2\left|\cos\frac x2\right|$. Now, I wasn't exactly sure how to integrate the absolute value, so I thought I would "fix" the function after integration.



The first fix we can do is making sure that the sign of the result of integration is correct:
$$
I = 2\sqrt2\sin\frac x2\text{sgn}\cos\frac x2 + C
$$
The problem with just $\sin\frac x2$ was that sometimes it was "flipped", on certain intervals it was actually the antiderivative of the $-\sqrt{1+\cos x}$ (this is because we dropped the absolute value signs).



There is one further problem with this, however. The above function is not continuous, meaning it's not continuously differentiable with derivative equal to $\sqrt{1+\cos x}$ everywhere. Namely, it is discontinuous at $x=(4n\pm1)\pi$ where $n\in\mathbb{Z}$.




I noticed, however, that the limit of the derivative on either side of $x=(4n\pm1)\pi$ existed and was equal to each other. Hence, I figured that I could somehow "stitch" these continuous sections end to end and get a continuous result whose derivative was $\sqrt{1+\cos x}$ everywhere. The resulting function I got was
$$
I = 2\sqrt2\sin\frac x2\text{sgn}\cos\frac x2 + 4\sqrt2\left\lfloor\frac1{2\pi}x+\frac12\right\rfloor + C
$$



Now, I was wondering, is there any way to arrive at this result just by integrating $\sqrt{1+\cos x}$ using the usual techniques? The method I used can be boiled down to "integrating" then "fixing", but I'm just wondering if you can arrive at a result that is continuous and differentiable on the entire real line by doing just the "integrating" part.



Any help would be appreciated. Thanks!



Edit: To be clear, I'm not looking for exactly the function above, but rather simply any function that is "nice", continuous and differentiable on $\mathbb{R}$, and has derivative equal to $\sqrt{1+\cos x}$ everywhere, and which is attainable through "simple" integration methods.



Answer



The function to be integrated is
$$
\sqrt{1+\cos x}=\sqrt{2}\left|\cos\frac{x}{2}\right|
$$
so we can as well consider the simpler
$$
\int\lvert\cos t\rvert\,dt
$$
or, with $t=u+\pi/2$, the even simpler

$$
\int|\sin u|\,du
$$
One antiderivative is
$$
\int_0^u\lvert\sin v\rvert\,dv
$$
Note that the function has period $\pi$, so let $u=k\pi+u_0$, with $0\le u_0<\pi$. Then
$$
\int_0^u\lvert\sin v\rvert\,dv=

\int_0^{k\pi}\lvert\sin v\rvert\,dv+
\int_{k\pi}^{k\pi+u_0}\lvert\sin v\rvert\,dv
\\=2k+\int_0^{u_0}\sin v\,dv=
2k+1-\cos(u-k\pi)
$$
Now do the back substitution; write $k=u\bmod\pi$, if you prefer.


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection $f \colon A \rightarrow B$ and I want to get bijection. Can I just resting codomain to $f(A)$? I know that every function i...