# Trig integral

Markjdb

## Homework Statement

Find the integral from 0 to pi/2 of sin(x)dx/(cos(x)+sin(x)).

## The Attempt at a Solution

You can easily make it into the integral of tan(x)dx/(1+tan(x)), but the substitution u=tanx can't work because tan(pi/2) is undefined. Any ideas for a good substitution?

rohanprabhu
Use the identity for definite integrals:

$$\int_a^b f(x)dx = \int_a^b f((a + b) - x)dx$$

and the trignometric identity:

$$\sin\left(\frac{\pi}{2} - x\right) = \cos(x)$$

$$\cos\left(\frac{\pi}{2} - x\right) = \sin(x)$$

Last edited:
Homework Helper
Where did that identity come from? When does it apply? It doesn't hold for f(x) = x for example.

As for the original integral, it's a little tricky and you have to express it in a special form to arrive at the answer.

$$\frac{sin (x)}{sin (x) + cos (x)} = \frac{1}{2} \ \frac{sin (x) + cos (x) - (cos (x) - sin (x)}{sin (x) + cos (x)} = \frac{1}{2} \left(1 - \frac{cos(x) - sin(x)}{sin(x)+cos(x)} \right)$$

The rightmost expression can be easily integrated.

rohanprabhu
Where did that identity come from?

Are you kidding me?? The identity is very well valid:

http://img124.imageshack.us/img124/1265/integralabproof1zs8.jpg [Broken]

When does it apply?

It applies for any function f(x)

It doesn't hold for f(x) = x for example.

really??

$$\int_a^b xdx = \frac{x^2}{2}|_a^b = \frac{b^2}{2} - \frac{a^2}{2}$$

$$\int_a^b (a + b - x)dx = ax|_a^b + bx|_a^b - \frac{x^2}{2}\left|_a^b$$

$$~ =~ a(b - a)~ +~ b(b - a)~ +~ \frac{b^2}{2}~ -~ \frac{a^2}{2}~ = ~ab~ -~ a^2~ + ~b^2~ - ab~ + ~\frac{a^2}{2}~ -~ \frac{b^2}{2}$$

$$= \frac{b^2}{2} - \frac{a^2}{2}$$

even mathematica agrees with me:

http://img140.imageshack.us/img140/5850/integralabproof2fb8.jpg [Broken]

Last edited by a moderator:
Homework Helper
My mistake, I was mentally exhausted when I chanced upon this earlier. But I don't see how this could help evaluate the integral. After applying the transformation, you're left with the same function as before, except this time the top trigo function is cos x.

rohanprabhu
My mistake, I was mentally exhausted when I chanced upon this earlier.

That's all right.. happens with all of us :D

But I don't see how this could help evaluate the integral. After applying the transformation, you're left with the same function as before, except this time the top trigo function is cos x.

The question given above is a VERY common illustration of the above mentioned identity. Let the required integral be 'I'. Then,

$$I = \int_0^\frac{\pi}{2} \frac{\sin(x)}{\sin(x) + \cos(x)}dx$$

(eqn. 1)

$$I = \int_0^\frac{\pi}{2} \frac{\sin\left(\frac{\pi}{2} - x\right)}{\sin\left(\frac{\pi}{2} - x\right) + \cos\left(\frac{\pi}{2} - x\right)}dx = \frac{\cos(x)}{\sin(x) + \cos(x)}dx$$

(eqn. 2)

$$2I = \int_0^\frac{\pi}{2} \frac{\sin(x) + \cos(x)}{\sin(x) + \cos(x)}dx = \int_0^\frac{\pi}{2} dx = \frac{\pi}{2}$$

and hence,

$$I = \frac{\pi}{4}$$

DavidWhitbeck
That was very slick Rohan!

Homework Helper
That's something I never did think of. Quite novel indeed.

Staff Emeritus
Much nicer than the identity

$$\sin x = \frac 1 2 \bigl((\cos x + \sin x) - (\cos x - \sin x)\bigr)$$

from which

$$\int_0^{\pi/2} \frac{\sin x}{\cos x + \sin x}\,dx = \frac 1 2 \bigl(x - \ln(\cos x + \sin x)\bigr)\Bigl|_0^{\pi/2} = \frac {\pi} 4$$

rohanprabhu
Much nicer than the identity

$$\sin x = \frac 1 2 \bigl((\cos x + \sin x) - (\cos x - \sin x)\bigr)$$[/tex]

which is what Defennder already suggested... and what makes this much nicer??

Staff Emeritus