Back to Blog
MathematicsFebruary 15, 20263 min read

Evaluating a Beautiful Integral Using Differentiation Under the Integral Sign

A detailed walkthrough of Feynman's favorite technique — differentiating under the integral sign — applied to a classic integral involving logarithms and rational functions.

Introduction

One of the most powerful and elegant techniques in integral calculus is differentiation under the integral sign, sometimes called Leibniz's rule or, more colloquially, Feynman's trick. Richard Feynman famously learned this technique from the book Advanced Calculus by Frederick S. Woods, and it became one of his go-to methods for evaluating difficult integrals.

In this post, we'll use this technique to evaluate the following beautiful integral:

I=01ln(1+x)1+x2dxI = \int_0^1 \frac{\ln(1+x)}{1+x^2} \, dx

The Setup

The key idea behind Feynman's trick is to introduce a parameter into the integral, differentiate with respect to that parameter, evaluate the resulting (hopefully simpler) integral, and then integrate back to obtain the original result.

Let us define:

I(a)=01ln(1+ax)1+x2dxI(a) = \int_0^1 \frac{\ln(1+ax)}{1+x^2} \, dx

where a0a \geq 0. Notice that:

  • I(0)=0I(0) = 0 (since ln(1)=0\ln(1) = 0)
  • I(1)=II(1) = I (our target integral)

Differentiating Under the Integral Sign

We differentiate I(a)I(a) with respect to aa:

I(a)=01a[ln(1+ax)1+x2]dx=01x(1+ax)(1+x2)dxI'(a) = \int_0^1 \frac{\partial}{\partial a} \left[ \frac{\ln(1+ax)}{1+x^2} \right] dx = \int_0^1 \frac{x}{(1+ax)(1+x^2)} \, dx

Now we need to evaluate this integral. We use partial fraction decomposition:

x(1+ax)(1+x2)=A1+ax+Bx+C1+x2\frac{x}{(1+ax)(1+x^2)} = \frac{A}{1+ax} + \frac{Bx + C}{1+x^2}

Multiplying both sides by (1+ax)(1+x2)(1+ax)(1+x^2) and solving for the coefficients, we get:

A=a1+a2,B=a1+a2,C=11+a2A = \frac{-a}{1+a^2}, \quad B = \frac{a}{1+a^2}, \quad C = \frac{1}{1+a^2}

Computing the Derivative

Substituting back:

I(a)=11+a201[a1+ax+ax+11+x2]dxI'(a) = \frac{1}{1+a^2} \int_0^1 \left[ \frac{-a}{1+ax} + \frac{ax+1}{1+x^2} \right] dx

Evaluating each part:

01a1+axdx=ln(1+a)\int_0^1 \frac{-a}{1+ax} \, dx = -\ln(1+a) 01ax+11+x2dx=a2ln2+π4\int_0^1 \frac{ax+1}{1+x^2} \, dx = \frac{a}{2}\ln 2 + \frac{\pi}{4}

Therefore:

I(a)=11+a2[ln(1+a)+a2ln2+π4]I'(a) = \frac{1}{1+a^2} \left[ -\ln(1+a) + \frac{a}{2}\ln 2 + \frac{\pi}{4} \right]

Integrating Back

Now we integrate from 00 to 11:

I(1)I(0)=01I(a)da=01ln(1+a)1+a2da+ln2201a1+a2da+π40111+a2daI(1) - I(0) = \int_0^1 I'(a) \, da = \int_0^1 \frac{-\ln(1+a)}{1+a^2} \, da + \frac{\ln 2}{2}\int_0^1 \frac{a}{1+a^2} \, da + \frac{\pi}{4}\int_0^1 \frac{1}{1+a^2} \, da

But notice that 01ln(1+a)1+a2da=I(1)=I\int_0^1 \frac{\ln(1+a)}{1+a^2} da = I(1) = I! So we have:

I=I+ln22ln22+π4π4I = -I + \frac{\ln 2}{2} \cdot \frac{\ln 2}{2} + \frac{\pi}{4} \cdot \frac{\pi}{4} 2I=(ln2)24+π2162I = \frac{(\ln 2)^2}{4} + \frac{\pi^2}{16}

The Final Result

I=01ln(1+x)1+x2dx=π232+(ln2)28\boxed{I = \int_0^1 \frac{\ln(1+x)}{1+x^2} \, dx = \frac{\pi^2}{32} + \frac{(\ln 2)^2}{8}}

This is a remarkably clean result! The appearance of both π\pi and ln2\ln 2 in the answer reflects the deep connections between logarithmic and trigonometric functions that arise naturally in integral calculus.

Key Takeaways

  1. Feynman's trick (differentiation under the integral sign) is a powerful technique for evaluating integrals that resist standard methods.

  2. The technique works best when you can find a natural parameter aa such that both I(0)I(0) and I(a)I'(a) are tractable.

  3. Sometimes the "trick within the trick" is recognizing that the integral you're trying to evaluate appears on both sides of an equation, allowing you to solve for it algebraically.

Further Reading

  • Inside Interesting Integrals by Paul J. Nahin — an excellent book full of integral evaluation techniques
  • Advanced Calculus by Frederick S. Woods — the book where Feynman learned this method
  • Rudin's Principles of Mathematical Analysis, Chapter 9 — for rigorous conditions on differentiation under the integral sign

What's your favorite integration technique? Let me know through the contact page!