Indefinite Integration Problem

1. Dec 21, 2007

ron_jay

1. The problem statement, all variables and given/known data

Integrate: $$\int \frac{1}{\sin{x}+cos{x}}dx$$

2. Relevant equations

The one above and basic integration formulae which need not be mentioned.

3. The attempt at a solution

$$\int \frac{1}{(\sin{x}+cos{x})} \times\frac{(\sin{x}-cos{x})}{(\sin{x}-cos{x})} dx$$

$$- \int \frac{\sin{x}-cos{x}}{\cos^2{x}-sin^2{x}} dx$$

$$- \int \frac{\sin{x}-cos{x}}{\cos{2x}} dx$$

Well after that I can't figure out what to do next...

Last edited: Dec 21, 2007
2. Dec 21, 2007

rocomath

$$-\int \frac{\sin{x}-cos{x}}{\cos^2{x}-sin^2{x}} dx$$

break up the numerator and then use trig identities to change the denominator so you have it in terms of only cosine and sine respectively.

i'm doing it right now, interesting.

Last edited: Dec 21, 2007
3. Dec 21, 2007

rocomath

argh ... hm

4. Dec 21, 2007

Hootenanny

Staff Emeritus
This is incorrect. There should be no negative sign in front of the integral.

5. Dec 21, 2007

rocomath

he factored out a negative so he could change it to cos2x unless i forgot my algebra.

$$\sin^{2}x-\cos^{2}x \rightarrow -(\cos^{2}x-\sin^{2}x)$$

6. Dec 21, 2007

Hootenanny

Staff Emeritus
Whao! My bad, didn't realise he'd swapped the cosine and sine.

7. Dec 21, 2007

morphism

How about using the identity sin(x)+cos(x)=sqrt(2)cos(x-pi/4), if you know the antiderivative of sec(x)?

Or the substitution t=tan(x/2)?

8. Dec 21, 2007

Dick

How about splitting this into two terms and substituting 2cos^2(x)-1 for the denominator in one case and 1-2sin^2(x) in the other? (Though morphisms first suggestion is much more direct).

9. Dec 21, 2007

rocomath

Yes, that's what I meant. I didn't state it clearly so that the OP could work it. After doing that though, I didn't like the results.

10. Dec 21, 2007

Dick

It's not that bad. Then you just have to apply partial fractions to integrate 1/(2u^2-1). You can see the sqrt(2) popping up, which corresponds to stuff you would get in morphism's approach if you expand the trig functions and use stuff like sin(pi/4)=sqrt(2)/2.

11. Dec 21, 2007

rocomath

K let me keep going further, I bet I'm having more fun with this Integral than ron_jay, lol.

12. Dec 21, 2007

ron_jay

This is an interesting proposition, however, I have not come across the given identity yet or the anti-derivative of sec(x). So either I do it in a different way or learn these new identities, the proof of which I would be glad if you could post a link to.

By splitting, is this what you mean:

$$\int \frac{\cos{x}}{1-2\sin^2{x}} - \frac{\sin{x}}{2\cos^2{x}-1} dx$$

Last edited: Dec 21, 2007
13. Dec 21, 2007

unplebeian

Where did you get this identity from? Just plug in x= 60 or any value and see if you get LHS=RHS

14. Dec 21, 2007

rocomath

you chose the wrong trig identities

if you switch around the denominators, do you notice that you can use u-substitutions?

from there, 1 will be nice to integrate while the other you will need to use partial fractions.

15. Dec 21, 2007

morphism

The identity is just cos(x-y)=sin(x)sin(y)+cos(x)cos(y) with y=pi/4 so that sin(y)=cos(y)=1/sqrt(2). [unplebeian: make sure you don't confuse radians with degrees.]

As for the antiderivative of sec(x), there are several ways of computing it - I count 3 off the top of my head. I will demonstrate how it can be done with the substitution t=tan(x/2), although it's not the slickest way to go about it.

First we need the following preliminary result:
cos(x) = cos^2(x/2) - sin^2(x/2) = (1 - tan^2(x/2))/sec^2(x/2) = (1-t^2)/(1+t^2)
(Try to see if you can get a corresponding result for sin(x)!)

Now onto $\int \sec x \, dx$. If we let t=tan(x/2), then dt/dx=(1/2)sec^2(x/2)=(1+t^2)/2. So:

$$\int \sec x \, dx = \int \frac{1}{\cos x} \, dx = \int \frac{1}{\frac{1-t^2}{1+t^2}} \cdot \frac{2}{1+t^2} \, dt$$

Try to take it from here.

16. Dec 21, 2007

chickendude

I prefer this way:

$$\int \sec x dx = \int \frac{\sec x(\sec x + \tan x)}{\sec x + \tan x} dx$$

$$= \int \frac{\sec^2 x + \sec x \tan x}{\sec x + \tan x}dx = ln |\sec x + \tan x| + C$$

Last edited: Dec 21, 2007
17. Dec 22, 2007

ron_jay

Is this right?

the square root of the sum of the squares of the coefficients of the sine and cosine is $$\sqrt2$$. Therefore, we multiply both the numerator and the denominator by $$\frac{1}{\sqrt2}$$:

$$\frac{1}{\sqrt2} \int \frac{1}{\frac{1}{\sqrt2}\sin{x}+\frac{1}{\sqrt2}\cos{x}} dx$$

$$\frac{1}{\sqrt2} \int \frac{1}{\cos{x}\cos{\frac{\pi}{4}}+\sin{x}sin{\frac{\pi}{4}}} dx$$

$$\frac{1}{\sqrt2} \int \frac{1}{\cos{(x-\frac{\pi}{4}})} dx$$

$$\frac{1}{\sqrt2} \int \sec{(x-\frac{\pi}{4})} dx$$

using the integration :$$\int \sec{x} dx = ln|\sec{x}+tan{x}|+C$$

$$\frac{1}{\sqrt2} ln|\sec{(x-\frac{\pi}{4})}+tan{(x-\frac{\pi}{4})}|+C$$

Is this it?

Last edited: Dec 22, 2007
18. Dec 22, 2007

Dick

Looks fine to me.

19. Dec 24, 2007

unplebeian

You first wrote the above and then said this to explain it

Am I just not getting this? It's been known to happen.

20. Dec 24, 2007

Hootenanny

Staff Emeritus
Explicitly starting from the sum angle identity (working in radians);

$$\cos(A-B) = \sin(A)\sin(B)+\cos(A)\cos(B)$$

Setting $A = x, \;\;\; B = \pi/4$;

$$\cos\left(x-\frac{\pi}{4}\right) = \sin(x)\sin\underbrace{\left(\frac{\pi}{4}\right)}_{=1/\sqrt{2}} +\cos(x)\underbrace{\cos\left(\frac{\pi}{4}\right)}_{=1/\sqrt{2}}$$

Multiply both sides by $\sqrt{2}$;

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

Does that make more sense?

Last edited: Dec 24, 2007