# Thread: Integral... where is my error

1. ## Integral... where is my error

I've done a pretty similar one, but for this one I don't get what I should get. I post the integral and my steps : $\omega=\int_0^{\frac{\pi}{4}} \frac{dx}{1+\sin (x)}$.
Let $x=2\arctan (u)$, $dx= \frac{2}{1+u^2}du$.
$\Rightarrow \omega=\int \frac{\frac{2}{1+u^2}}{1+\sin (2\arctan(u))}du$. Let $\theta=\arctan (u)$. $\Rightarrow \sin (2\arctan (u))=\sin (2\theta)=2\cos (\theta)\sin (\theta)$. But as $\cos (\theta)=\frac{1}{\sqrt{1+u^2}}$ and $\sin (\theta)=\frac{u}{\sqrt{1+u^2}}$, we have that $\omega= \int \frac{\frac{2}{1+u^2}}{\frac{2u}{1+u^2}}du=\int \frac{du}{u}=\ln |u| +C$, backsub I get $\ln |\tan \left( \frac{x}{2}\right)|+C$. Putting the limits I finally get that $\omega$ is worth $\ln|\tan \left( \frac{\pi}{8}\right) |+C$ since $\tan(0)=0$. But the answer should be $2-\sqrt 2$ according to Mathematica...
I didn't see my error even when typing all this in Latex. Note that for simplicity I didn't take in count the limits of the integral, so it's not mathematically correct to say that $\omega$ is worth all the steps I did before to get to the last value (from which it should be equal to, but it seems it isn't).

2. Originally Posted by arbolis
I've done a pretty similar one, but for this one I don't get what I should get. I post the integral and my steps : $\omega=\int_0^{\frac{\pi}{4}} \frac{dx}{1+\sin (x)}$.
.
$\frac{1}{1+\sin x} \cdot \frac{1-\sin x}{1-\sin x} = \frac{1-\sin x}{\cos^2 x} = \sec^2 x - \frac{\sin x}{\cos^2 x}$.
Can you finish it from there?

3. .
Can you finish it from there?
Thanks a lot, I think yes. I must go to sleep now so I will try tomorrow. But to my eyes I have to do an integration by parts for $\int \sec^2(x)dx$ and a u-sub for $-\int \frac{\sin(x)}{cos^2(x)}dx$. I'd be grateful also if someone point an error of mine when I did my trig-sub since I don't see where I make an error.

4. Originally Posted by arbolis
But to my eyes I have to do an integration by parts for $\int \sec^2(x)dx$ .
This is simply $\tan x + k$.

5. Originally Posted by arbolis
I'd be grateful also if someone point an error of mine when I did my trig-sub since I don't see where I make an error.

you forgot that there was a $1$ in the denominator of the original equation..

your final integral should have been

$\omega = \int\frac{du}{(1+u)^2}$