# How do you integrate int (sinx) / ((cos^2x + cosx -2)) dx using partial fractions?

Dec 16, 2015

$\frac{1}{3} \ln | \frac{\cos x + 2}{\cos x - 1} |$

#### Explanation:

When dealing with trigonometric functions during partial fraction expansions, it can be very helpful to make some substitutions to simplify the problem. We will let $u = \cos x$. Then we have

$\int \sin \frac{x}{{\cos}^{2} x + \cos x - 2} \mathrm{dx} = \int \sin \frac{x}{{u}^{2} + u - 2} \mathrm{dx}$

We may actually take this one step further and eliminate the $\sin$ from the numerator. In this case we will note that $\frac{\mathrm{du}}{\mathrm{dx}} = - \sin x$.

One can think of this as being equivalent to $- \mathrm{du} = \sin x \mathrm{dx}$.

After replacing $\sin x \mathrm{dx}$ with $- \mathrm{du}$ we have

$\int \sin \frac{x}{{u}^{2} + u - 2} \mathrm{dx} = \int \frac{- \mathrm{du}}{{u}^{2} + u - 2}$

Now we can simply expand our new, trig-less expression and integrate normally.

We will factor the denominator, and set the expression equal to a general expression involving these factors to begin the partial fraction expansion:

$- \frac{1}{\left(u + 2\right) \left(u - 1\right)} = \frac{A}{u + 2} + \frac{B}{u - 1}$

To continue our expansion we will multiply through by $\left(u + 2\right) \left(u - 1\right)$ as follows,

$- 1 = A \left(u - 1\right) + B \left(u + 2\right) = A u - A + B u + 2 B$

We may now find $A$ and $B$ by equating coefficients. To show more clearly what we're working with, I'll rearrange everything a bit:

$- 1 = \left(A + B\right) u + \left(2 B - A\right)$

On the left-hand side, we have no multiples of $u$. Thus, $A + B$ must equal zero. $2 B - A$ then must equal $- 1$.

$A + B = 0$
$2 B - A = - 1$

This is a simple linear system which I will not bother with in too much detail, so you'll just have to trust me when I say the solution is
$A = \frac{1}{3} , B = - \frac{1}{3}$

The expanded integral, then, is

$\int \frac{- \mathrm{du}}{{u}^{2} + u - 2} = \int \frac{1}{3 \left(u + 2\right)} \mathrm{du} - \int \frac{1}{3 \left(u - 1\right)} \mathrm{du}$

From here the answer should be fairly clear:

$\int \frac{\mathrm{du}}{3 \left(u + 2\right)} - \int \frac{\mathrm{du}}{3 \left(u - 1\right)} = \frac{1}{3} \ln | u + 2 | - \frac{1}{3} \ln | u - 1 | + C$

However, we must substitute $u$ back to get our answer in terms of $x$. Our final answer then is

$\frac{1}{3} \ln | \cos x + 2 | - \frac{1}{3} \ln | \cos x - 1 |$

After a small tweak for the sake of aesthetics:

$\frac{1}{3} \ln | \frac{\cos x + 2}{\cos x - 1} |$