-1

I want to solve the following integral:

$$\int_0^\pi \sqrt{1+\sin x} \, dx$$

I want to do this with the substitution:

$$u=\sin x$$

so that:

$$du=\cos x\,dx=\sqrt{1-\sin^2x}\,dx = \sqrt{1-u^2} \, dx$$

$$dx = \frac{du}{1-u^2}$$

$$u(0) = 0, \quad u(\pi/2)=1, \quad u(\pi)=0$$

$$\int\sqrt{1+\sin x} \, dx = \int\frac{1}{\sqrt{1-u}} \, du = -2\sqrt{1-u}$$

So since $u$ isn't defined for 1 (corresponding $x$ is $\pi/2$), I split the integration to ($0, \pi/2$) and ($\pi/2, \pi$) However when I assign the substitution I get:

$$\int_0^1 \frac{1}{\sqrt{1-u}} \, du + \int_1^0 \frac{1}{\sqrt{1-u}} \, du = 2-2 = 0$$

But the result should be $4.$ It seems like I should flip the sign here for some reason but I can't figure it out, help would be appreciated.

Paul
  • 1

3 Answers3

0

"I want to specifically know why my substitution fails". (OP quoted from a comment on a now-deleted answer. I agree that it would have been nice for OP to actually put his question in the Question.)

$$ \cos x = \sqrt{1 - \sin^2 x} $$ is only true when $\cos x \geq 0$ (because the radical on the right-hand side is always nonnegative). This fails for $x \in (\pi/2, \pi]$. In that interval, you need the other choice of sign of the radical , which gives your missing minus sign.

Eric Towers
  • 67,037
0

$$I=\int \sqrt{1+\sin x} dx= \int (\sin(x/2)+ \cos(x/2)) dx=2[\cos(x/2)-\sin(x/2)]+C$$

Z Ahmed
  • 43,235
0

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\on}[1]{\operatorname{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ $\ds{\bbox[5px,#ffd]{}}$


\begin{align} &\bbox[5px,#ffd]{\int_{0}^{\pi}\root{1 + \sin\pars{x}}\dd x} = \int_{-\pi/2}^{\pi/2}\root{1 + \cos\pars{x}}\dd x \\[5mm] = &\ 2\int_{0}^{\pi/2}\root{1 + \cos\pars{x}}\dd x = 2\int_{0}^{\pi/2} \root{1 + \bracks{2\cos^{2}\pars{x \over 2} - 1}}\dd x \\[5mm] = &\ 2\root{2}\int_{0}^{\pi/2}\cos\pars{x \over 2}\,\dd x = 2\root{2}\,{\sin\pars{\pi/4} \over 1/2} = \bbx{4} \\ & \end{align}
Felix Marin
  • 89,464