# Integrate ${\int\sqrt{1 + \sin\frac{x}2}\,\mathrm{d}x}$

So I was doing a integral question and I stumbled upon this question.

$$\displaystyle{\int\sqrt{1 + \sin\left(\frac x2\right)}\,dx}$$

In order to solve it I did the following:

I took $$u = \frac12x$$ Then $$\frac {du}{dx}$$ Which gave me $$2 du = dx$$.

After that I substituted u in the equation to get $$2\int \sqrt{1 + \sin(u)} du$$.

After this I was stuck as I am new to integration of trigonometry so I checked my textbook which did the same just the same but the step after this was this one

$$2\int{\sqrt{\sin^2 \frac12u + \cos^2\frac12u + 2\sin \frac 12u\cos \frac12u}\text{ du}}$$

I am in a complete awe how the textbook got $$2\int{\sqrt{\sin^2 \frac12u + \cos^2\frac12u + 2\sin \frac 12u\cos \frac12u}\text{ du}}$$ from $$2\int \sqrt{1 + \sin(u)} \text{ du}$$

Can someone please explain me how the this is achieved? I am totally stuck

• Pythagorean theorem and double angle formula for the sine Aug 12, 2019 at 16:52
• You have $1 = \sin^2 \alpha + \cos^2 \alpha$ and also $\sin 2 \alpha = 2 \sin \alpha \cos \alpha$. Sure, I'd be staring at the question for a solid month without seeing that one. Aug 12, 2019 at 17:04

First, they used the double angle formula:

$$\sin u = \sin\left(2\frac{u}{2}\right) = 2\sin\frac{u}{2}\cos\frac{u}{2}.$$

Then they replaced the $$1$$ with $$\sin^2\frac{u}{2}+\cos^2\frac{u}{2}.$$

• Oh Ya I totally forgot. Thank You for your help :) Aug 12, 2019 at 16:58

Use $$\sqrt{1+\sin\frac{x}{2}}=\sqrt{1+\cos\left(\frac{\pi}{2}-\frac{x}{2}\right)}=\sqrt2\left|\cos\left(\frac{\pi}{4}-\frac{x}{4}\right)\right|$$

• @mrtaurho Thank you for your editing. Aug 12, 2019 at 16:57
• is it same as the answer $4[\sin\frac14x - \cos\frac14x] + c$ as this is the answer in my textbook.. Aug 12, 2019 at 16:57
• @Utkarsh Use also $\sqrt2\left(\cos\left(\frac{\pi}{4}-\frac{x}{4}\right)\right)=\cos\frac{x}{4}+\sin\frac{x}{4}$ Aug 12, 2019 at 17:00
• Oh Okay got it. Thank You :) Aug 12, 2019 at 17:01
• @Utkarsh You are welcome! Aug 12, 2019 at 17:01

Obviously, knowing the trigonometric identities as already covered is the far superior and simpler method. Here is a more 'generalised' approach. I hope it serves some value.

Here I will address the integral: $$$$I = \int \sqrt{1 + \sin\left(\frac{x}{2}\right)}\:dx$$$$

First let $$u = \frac{x}{2}$$:

$$$$I = \int \sqrt{1 + \sin(u)} \cdot 2\:du = 2\int \sqrt{1 + \sin(u)}\:du$$$$

We now employ the Weierstrauss Substitution $$t = \tan\left(\frac{u}{2}\right)$$: \begin{align} I &= 2 \int \sqrt{1 + \frac{2t}{1 + t^2}} \cdot \frac{2}{1 + t^2}\:dt = 4 \int \frac{t + 1 }{\left(t^2 + 1 \right)^{\frac{3}{2}}} \:dt = 4\left[ \int \frac{t}{\left(t^2 + 1\right)^{\frac{3}{2}}}\:dt+ \int \frac{1}{\left(t^2 + 1\right)^{\frac{3}{2}}}\:dt \right] \nonumber ]\\ &= 4\left[ -\frac{1}{\sqrt{t^2 + 1}} + J\right] \end{align}

For the remaining integral $$J$$ let $$t = \tan(s)$$: \begin{align} J &= \int \frac{1}{\left(\tan^2(s) + 1\right)^{\frac{3}{2}}} \cdot \sec^2(s)\:ds = \int \cos(s) \:ds = sin(s) + C = \sin\left(\arctan(t)\right) + C \end{align} Where $$C$$ is the constant of integration.

Thus, $$$$I = 4\left[ -\frac{1}{\sqrt{t^2 + 1}} + J\right] = 4\left[ -\frac{1}{\sqrt{t^2 + 1}} + \sin\left(\arctan(t)\right)\right] + C$$$$

Now $$t = \tan\left(\frac{u}{2} \right) = \tan\left(\frac{x}{4}\right)$$

Thus, \begin{align} I &= 4\left[ -\frac{1}{\sqrt{t^2 + 1}} + \sin\left(\arctan(t)\right) \right] + C = 4\left[ -\frac{1}{\sqrt{\tan^2\left(\frac{x}{4}\right) + 1}} + \sin\left(\arctan\left(\tan\left(\frac{x}{4}\right)\right)\right) \right] + C \\ &= 4\left[ -\cos\left(\frac{x}{4} \right) + \sin\left(\frac{x}{4} \right) \right] = 4\cdot \sqrt{2}\sin\left(\frac{x}{4} = \frac{\pi}{4} \right) + C \end{align}