On the integral $\int\sqrt{1+\cos x}\text{d} x$

2.9k Views Asked by At

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.

3

There are 3 best solutions below

6
On BEST 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.

0
On

Probably not what you intended, but it follows geometrically due to the period of $\cos$ that

$$\int_0^x\sqrt{1+\cos(t)}\ dt=(x\text{ mod }2\pi)\int_0^{2\pi}\sqrt{1+\cos(t)}\ dt+\int_0^{(x\text{ mod }2\pi)}\sqrt{1+\cos(t)}\ dt$$

That is, we really only need to take the integral for $x\in[0,2\pi)$ and we're set. To do this, let $t=\arccos(u)$ with $x\in[0,2\pi)$.

$$\begin{align}\int_0^x\sqrt{1+\cos(t)}\ dt&=-\int_1^{\cos(x)}\sqrt{\frac{1+u}{1-u^2}}\ du\\&=\int_{\arccos(x)}^1\frac1{\sqrt{1-u}}\ du\\&=\left.-2\sqrt{1-u}\vphantom{\frac11}\right|_{\cos(x)}^1\\&=2\sqrt{1-\cos(x)}\end{align}$$

which reduces to yours via trig identities. The extension to $x\ge2\pi$ via modular operations is also continuous, and the derivative is always $\sqrt{1+\cos(t)}$.

2
On

\begin{equation} \int \sqrt{1+\cos(x)} dx = \int \frac{1+\cos(x)}{\sqrt{1+\cos(x)}} dx \end{equation}

Consider the substitution, $u=1+\cos(x)$. Then,

\begin{equation} -\frac{du}{\sqrt{2u-u^2}}=dx \end{equation}

Thus, the new equation in terms of $u$ will be

\begin{equation} I= -\int \frac{\sqrt{u}}{\sqrt{2u-u^2}} du \end{equation}

\begin{equation} I= -\int \frac{du}{\sqrt{2-u}} \end{equation}

With the substitution, $t=2-u$, we get

\begin{equation} I=\int \frac{dt}{\sqrt{t}} \end{equation}

By making substitutions for $t(u)$ and $u(x)$, the final answer becomes

\begin{equation} I=2\sqrt{1-\cos(x)}+C. \end{equation}

Multiplying and dividing by $\sqrt{1+\cos(x)}$ results in

\begin{equation} \int \sqrt{1+\cos(x)} dx = \frac{2 \sqrt{{\sin}^2(x)}}{\sqrt{1+\cos(x)}}+C. \end{equation}

However only when the term in numerator is taken to be $\sin(x)$ instead of absolute value of $\sin(x)$ the answer seems to be correct. The conclusion is drawn based on plotting the derivative of answer and comparing it with integrand.