The one integration secret mathematicians don’t want you to know

Hey folks, it’s been a while!

One of my New Year’s resolutions is to write more on this blog (at least weekly, says the list), so here I am. My biggest impairment in doing so has been the feeling of incompetence about a lot of the stuff that interests me, hence my good intentions crashed against the Impostor Syndrome wall even before being abandoned in the ‘Drafts’ tab of WordPress (which is now very much akin to a graveyard).

I think the solution should be writing about things I actually feel competent about, such as undergraduate math. And since I’d like my blog to be about my ‘original’ ideas, I think I’ll write about some different perspectives on some of the topics that come up to my attention.

Since I’m giving a lot of private lessons lately, mainly to engineers trying to pass Calculus, I’ll start with some insight on something that, at the time, perplexed me quite a lot: how come integrals such

\displaystyle \int \frac1{x^2-1}\,\mathrm{d}x and \displaystyle \int \frac1{x^2+1}\,\mathrm{d}x

have a strikingly different result?

Let’s see. The first, having \Delta >0, can be solved by using partial fractions decompositions: we proceed by first factoring the denominator

\displaystyle x^2-1 = (x+1)(x-1)

and then we postulate that

\displaystyle \frac{A}{x+1}+\frac{B}{x-1} = \frac1{(x+1)(x-1)}

for some constants A, B to determine with an easy linear system[0], we get A=-1/2, B=1/2 and the integral is magically simplified to

\displaystyle \int \frac1{x^2-1}\,\mathrm{d}x = \frac12 \ln (x-1) - \frac12 \ln(x+1) = \frac12 \ln\frac{x-1}{x+1}


What about the second one? Well, there’s no hope to factor the denominator as we did, since it is a irreducible polynomial. Indeed, we know this ‘immediate’ integral:

\displaystyle \int \frac1{1+x^2}\,\mathrm{d}x = \arctan x + C

But why on Earth changing a single number brings us to a completely different and seemingly unrelated part of mathematics?

What if I told you logarithms and the inverse tangent are both part of the same mathematical conspiracy? What if I told you there’s a world beyond what you know, where the two are just the two sides of the same coin? And what if I told you the key to unlock this door it’s the same that makes every polynomial reducible?

Complex numbers? We may as well talk about the Matrix!

Enter complex numbers. Using the magical powers of the imaginary unit, we can dispense with the distinction between reducible and irreducible polynomials: the polynomial above now factors into (x+i)(x-i) and thus we can proceed with (complexified) partial fractions[1]!

\displaystyle \frac1{x^2+1} = \frac{A+iB}{x+i} + \frac{C+iD}{x-i} \implies A=C=0,\ B=-D=\frac1{2}.

And then

\displaystyle \int \frac1{x^2+1}\,\mathrm{d}x = \frac{i}{2}\ln(x+i) - \frac{i}{2}\ln(x-i) = i\ln\sqrt{\frac{x+i}{x-i}}.

Therefore we get to the identity

$latex \displaystyle \arctan x = \frac{i}2 \ln\frac{x+i}{x-i} + C.

So you might now think that the expression above is equivalent to \arctan x for real $x$, but hold on a second! There’s an integration constant hanging there!

Let’s check, algebraically, what should $\arctan z$ be. We know, from Euler’s formula, that

\displaystyle \sin z = \frac{e^{is} - e^{-is}}{2i},\\ \cos z = \frac{e^{is}+e^{-is}}2,


\displaystyle \tan z = i\frac{e^{-is}-e^{is}}{e^{-is}+e^{is}}.

If we set $s= \tan z$, we can try to express $z$ in terms of $s$ to get the expression of $\arctan s$. I’ll leave this funny exercise to you (it’s not hard, follow your nose) and we get to

\displaystyle s = \frac{i}2 \ln \frac{i+z}{i-z}

which is off by a minus sign from what we got from the integral! Fear no more, because Constant of Integration is coming to the rescue:

\displaystyle \ln (-1) = i\pi \implies C= -\frac{\pi}2

And since $C$ can actually be chosen ad arbiter, our result is indeed consistent with the known integral on the real axis.


[0] Indeed imposing Ax - A + Bx + B = (A+B)x + B - A to be equal to 1 is actually the same as asking the two polynomials to have the same coefficients: then we get two equations

\displaystyle A+B=0\\ B-A=1

By knowing some linear algebra we also can avoid to remember all the complicated stuff for more involved cases, namely when the not all the roots of the denominators are simple (just increase the degree of the unknown polynomial over the fractions corresponding to multiple roots until your linear system doesn’t get overdetermined, that is, until the difference in degree is exactly 1).

[1] It is indeed interesting to note we don’t actually need 4 variables, as the non-real roots of a polynomial with real coefficients always come up in conjugate pairs. This means we’ll always get C=-A and D=-B.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.