# Integration by special technique

1. Oct 31, 2014

### PhyCalc

Mentor note: Thread was moved to homework section

Hello Folks
I have integral
0π/2 (sinx/sinx+cosx) dx

I have got the answer is π/4

I have even solved indefinite integral
[ln(tan^2(x/2)-2(tan(x/2))-1)]/2 + [tan-1(tan(x/2)) + [ln(1+tan^2(x/2))]/2]/2

my problem is I am not getting pi/4 as final answer

I have got (ln(-2))/2 + π/8 + (ln(2))/4

is there something I am missing?

Last edited by a moderator: Oct 31, 2014
2. Oct 31, 2014

### PeroK

I'm not sure I believe that answer for the indefinite integral. You can use some trig identities to simplify things. Note that:

$sin(x) + cos(x) = \sqrt{2}sin(x + \frac{\pi}{4})$

Then tackle the numerator. Hint: $x = x + \frac{\pi}{4} - \frac{\pi}{4}$

3. Oct 31, 2014

### Staff: Mentor

How? The result is wrong.

4. Oct 31, 2014

### Staff: Mentor

Unless the integral is $\int_0^{\pi/2} 1 + cos(x)dx$, then yes, there is something you're missing - parentheses.

If you meant $\frac{sin(x)}{sin(x) + cos(x)}$, then you should have written it as sin(x)/(sin(x) + cos(x)).

5. Oct 31, 2014

### Dick

Here's a hint. Try the substitution x=pi/2-u.

Last edited: Oct 31, 2014
6. Oct 31, 2014

### Ray Vickson

The integrand is $(\pi/2)[\sin x / \sin x + \cos x] = (\pi/2)[ 1 + \cos x]$, so your integral looks incorrect. Did you mean
$$\frac{\pi}{2} \frac{\sin x}{\sin x + \cos x}?$$
If so, use parentheses, like this: sin(x)/(sin(x) + cos(x)] or sin x /(sin x + cos x).

7. Nov 1, 2014

### Staff: Mentor

That's what I said in post #4.

8. Nov 1, 2014

### Ray Vickson

Yes, but for some reason that post did not appear on my screen until well after I responded. I have seen this type of thing happen several times already (where several previous responses appear only after I make a response).

9. Nov 2, 2014

### PhyCalc

Last edited: Nov 2, 2014
10. Nov 2, 2014

### Dick

That's too bad. There's an easy elementary (if somewhat tricky) solution using the substitution I suggested before. Maybe you could show your work in setting up the Weierstrass substitution?