help with a calculus question

## integral 1/(sin(x)+cos(x))

# 3 Answers

Int dx/(sinx+cosx)= Int (cosx-Sinx)dx/(Cos^{2}x-sin^{2}x)= Int cosx dx/ (1-2Sin^{2}x) - Int sinx dx/ (2cos^{2}x-1) ..(.1)

Let 1-2sin^{2}x =u and 2cos^{2}x-1 =v

so, du= -2 (2)cosx dx =-4cosx dx, thus cosx dx = -1/4 du........(2)

and dv= -2 (2) sinx dx = -4sin x dx, thus sinx dx= -1/4 dv....(3)

let's now plug-in the value of sin x and cosx in (1)

We have int -1/4 (du)/u - Int (-1/4) dv/v

=-1/4 ln(u) -1/4 ln (v)+C

= -1/4 ln (2cos^{2}x-1)-1/4 ln (1-2sin^{2}x) +C

Hint: sin(x)+cos(x) = sqrt(2)sin(x+pi/4), and integral of 1/sin(x) = ln(|sin(x/2)| - ln(|cos(x/2)|

Hi Joseph,

You may be interested to know that there is a general formula for condensing the
*sum* of a sine and a cosine wave into a *single* sine or cosine wave. I'll show you how to condense such a sum into a single sine wave, but the derivation for a single cosine wave is exactly the same.

**Goal**: Find C and D, in terms of A and B, so that Asin(x)+Bcos(x)=Csin(x+D)

Well, we might make some progress if we expand the right-hand side using the sum formula for sine. This becomes

C[sin(D)cos(x)+cos(D)sin(x)]=Csin(D)cos(x)+Ccos(D)sin(x)

Now we should just compare the coefficients of sin(x) and cos(x) on each side of the equation. The coefficient of sin(x) on the left-hand side is A and the coefficient of sin(x) on the right-hand side is Ccos(D), so we want A=Ccos(D). Similarly, comparing
coefficients for cos(x) on both sides of the equation shows we want B=Csin(D). If we divide this second equation by the first, we get tan(D)=B/A.
**That means D should be arctan(B/A). **So we've figured out what D should be. What about C? Well, notice that

A^{2}+B^{2}=C^{2}cos^{2}(D)+C^{2}sin^{2}(D)=C^{2}[cos^{2}(D)+sin^{2}(D)]=C^{2}[1]=C^{2}

by the Pythagorean identity. **So C should just be sqrt(A ^{2}+B^{2}).** This tells us what numbers C and D to choose if we want to write

*any*sum Asin(x)+Bcos(x) as a single sine wave. This fact is very important in analyzing

*simple harmonic motion*and the differential equation that governs it.

Now we can see where Robert's hint comes from. He told you that

sin(x)+cos(x)=sqrt(2)sin(x+pi/4)

But where does this fact come from? It just comes from the fact we just proved. In this case, A=1 and B=1, so C should be sqrt(1^{2}+1^{2})=sqrt(2). And D should be arctan(B/A)=arctan(1/1)=arctan(1)=pi/4. That's where he gets those numbers.

Hope this deeper explanation helps!

Matt L

## Comments

Asok, your u-substitution isn't correct. The derivative of cos

^{2}x -sin^{2}x IS NOT -2sinx-2cosx. You didn't use the chain rule. The derivative of cos^{2}x-sin^{2}x is 2cosx(-sinx)-2sinxcosx = -4sinxcosx=-2sin2x.You are still wrong. The derivative of 1-2sin

^{2}x IS NOT -4cosx. It is -4cosxsinx. You should stop trying to give mathematical advice because you don't know what you're talking about.Comment