Techniques to generate horrible integrals

There are some nice tricks one can use to generate very hard integrals semi-automatically. These appear to be very hard if you don’t know the trick, but they aren’t too difficult if you do.

First method

The first method is based on the identity

$$\int_a^b \frac{f(x)}{f(a+b-x)+f(x)} dx = \frac{b-a}{2}$$

which is valid for any function $f$. I find it rather remarkable and unexpected, but it’s not too hard to show using symmetries. In fact, we can replace $x \to a+b-x$ to get

$$I\equiv \int_a^b \frac{f(x)}{f(a+b-x)+f(x)} dx =\int_a^b \frac{f(a+b-x)}{f(a+b-x)+f(x)} dx$$

Now we can add and subtract $f(x)$ from the numerator:

$$I = \int_a^b \frac{f(a+b-x)+f(x)-f(x)}{f(a+b-x)+f(x)} dx$$

And then we get

$$I = \int_a^b dx- \int_a^b \frac{f(x)}{f(a+b-x)+f(x)} dx=b-a-I$$

from which it follows that $I=(b-a)/2$. Using this method we get for example

$$\int_0^{\pi/2} \frac{\sqrt{\sin(x)}}{\sqrt{\cos(x)}+\sqrt{\sin(x)}} dx = \frac{\pi}{4}$$

or similarly

$$\int_0^{\pi/2} \frac{\sin^{27}(x)}{\cos^{27}(x)+\sin^{27}(x)} dx = \frac{\pi}{4}$$

or even

$$\int_0^6 \frac{\log(x^2)}{\log(x^2)+\log(36-12x+x^2)} dx = 3$$

It’s quite unclear to see how one could tackle such integrals without knowing the trick.

Second method

The second method is based on complex analysis, and in particular on Cauchy’s integral formula, according to which

$$\frac{1}{2\pi i}\oint  \frac{f(z)}{z-z_0}dz = f(z_0)$$

for any complex holomorphic function $f$. Applying the formula with $z_0=0$ we get

$$\oint  \frac{f(z)}{z}dz = 2\pi i f(0)$$

Choosing as integration contour the circle of radius $r$ centred at the origin, we can parametrise it as $z=re^{i\varphi}$, where $\varphi$ goes from $0$ to $2\pi$. Then we get

$$2\pi i f(0) = \oint  \frac{f(z)}{z}dz=\int_0^{2\pi}  \frac{f(r e^{i\varphi})}{re^{i\varphi}}r i e^{i\varphi} d\varphi = i\int_0^{2\pi} f(r e^{i\varphi})d\varphi$$

Taking real and imaginary part,

$$\int_0^{2\pi} \mathrm{Re} f(r e^{i\varphi})d\varphi=2\pi \mathrm{Re}f(0)\\
\int_0^{2\pi} \mathrm{Im} f(r e^{i\varphi})d\varphi=2\pi \mathrm{Im}f(0)$$

In this manner we can generate incredibly hard integrals. For example taking the real part of

$$f(z)=e^{z^2} \cos{z}$$

and setting $r=1$ we get

$$f(e^{i\varphi})=e^{e^{2i\varphi}} \frac{1}{2}\pqty{ e^{ie^{i\varphi}}+e^{-ie^{i\varphi}}}=\frac{1}{2}e^{\cos{2\varphi}+i\sin{2\varphi}}\pqty{ e^{i\cos{\varphi}-\sin{\varphi}}+e^{-i\cos{\varphi}+\sin{\varphi}}}=\\
=\frac{1}{2}e^{\cos{2\varphi}-\sin{\varphi}+i\sin{2\varphi}+i\cos{\varphi}}+\frac{1}{2}e^{\cos{2\varphi}+\sin{\varphi}+i\sin{2\varphi}-i\cos{\varphi}}$$

Therefore

$$\mathrm{Re} f(e^{i\varphi})=\frac{1}{2}e^{\cos{2\varphi}-\sin{\varphi}}\cos{\pqty{\sin{2\varphi}+\cos{\varphi}}}+\frac{1}{2}e^{\cos{2\varphi}+\sin{\varphi}}\cos{\pqty{\sin{2\varphi}-\cos{\varphi}}}$$

and we finally obtain the horrible identity

$$\int_0^{2\pi}\bqty{e^{\cos{2\varphi}-\sin{\varphi}}\cos{\pqty{\sin{2\varphi}+\cos{\varphi}}}+e^{\cos{2\varphi}+\sin{\varphi}}\cos{\pqty{\sin{2\varphi}-\cos{\varphi}}} }d\varphi=4\pi$$

We can also manipulate it further by sending $\varphi \to -\varphi$ in the second term, obtaining

$$\int_{-2\pi}^{2\pi}e^{\cos{2\varphi}-\sin{\varphi}}\cos{\pqty{\sin{2\varphi}+\cos{\varphi}}}d\varphi=4\pi$$

In the same manner, choosing weirder starting functions, we can generate very hard integral identities.

This entry was posted in analysis. Bookmark the permalink.

Comment

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