8.3. Partial Fractions RevisitedSuppose we want to evaluate the integral \[\int \frac{dx}{x^2+1}\] by the method of partial fractions. The quadratic formula tells us that the roots are i and i, setting 1/(x^{2}+1) = A/(x+i) + B/(xi) gives A = i/2 and B = i/2, so \begin{align} \int \frac{dx}{x^2+1} &= \frac{i}{2} \int \frac{dx}{x+i} \frac{i}{2}\int \frac{dx}{xi} \\ &= \frac{i}{2}\ln(x+i)  \frac{i}{2}\ln(xi) \\ &= \frac{i}{2}\ln\frac{x+i}{xi} . \end{align} The attractive thing about this approach, compared with the method used on page 88, is that it doesn't require any tricks. If you came across this integral ten years from now, you could pull out your old calculus book, flip through it, and say, “Oh, here we go, there's a way to integrate one over a polynomial  partial fractions.” On the other hand, it's odd that we started out trying to evaluate an integral that had nothing but real numbers, and came out with an answer that isn't even obviously a real number. But what about that expression (x+i)/(xi)? Let's give it a name, w. The numerator and denominator are complex conjugates of one another. Since they have the same magnitude, we must have w=1, i.e., w is a complex number that lies on the unit circle, the kind of complex number that Euler's formula refers to. The numerator has an argument of tan^{1}(1/x) = π/2  tan^{1}x, and the denominator has the same argument but with the opposite sign. Division means subtracting arguments, so arg w = π  2tan^{1}x. That means that the result can be rewritten using Euler's formula as \begin{align} \int \frac{dx}{x^2+1} &= \frac{i}{2}\ln e^{i(\pi2\tan^{1}x)} \\ &= \frac{i}{2}\cdot i(\pi2\tan^{1}x) \\ &= \tan^{1}x + c . \end{align} In other words, it's the same result we found before, but found without the need for trickery. Example 93◊ Evaluate \(\int dx/\sin x\). ◊ This can be tackled by rewriting the sine function in terms of complex exponentials, changing variables to u=e^{ix}, and then using partial fractions. \begin{align} \int \frac{dx}{\sin x} &= 2i \int \frac{dx}{e^{ix}e^{ix}} \\ &= 2i \int \frac{du/iu}{u1/u} \\ &= 2\int \frac{du}{u^21} \\ &= \int \frac{du}{u1}  \int \frac{du}{u+1} \\ &= \ln(u1)ln(u+1) +c \\ &= \ln \frac{e^{ix}1}{e^{ix}+1} +c \\ &= \ln(i\tan(x/2)) +c \\ &= \ln\tan(x/2)+ c' \end{align}
