Introduction
During his high school years, renowned American theoretical physicist Richard Feynman was not the best student. Though clearly gifted, he struggled to stay engaged in class. One day, Feynman's physics teacher, Mr. Bader, pulled Feynman after class and said to him,
Feynman, you talk too much, and you make too much noise. I know why. You’re bored. So I’m going to give you a book. You go up there in the back, in the corner, and study this book, and when you know everything that’s in this book, you can talk again (Feynman) .
The book was Advanced Calculus , published in 1926 by MIT mathematician Frederick S. Woods. It contained all kinds of concepts that Feynman didn't know about, including a method of solving integrals called the Leibniz Integral Rule . The Leibniz Integral Rule, also known as differentiation under the integral sign, was not emphasized in university, but Feynman would use it time and time again.
According to Feynman,
When guys at MIT or Princeton had trouble doing a certain integral, it was because they couldn’t do it with the standard methods they had learned in school...Then I come along and try differentiating under the integral sign, and often it worked. So I got a great reputation for doing integrals, only because my box of tools was different from everybody else's (Feynman) .
This article is about the Leibniz Integral Rule, which is colloquially referred to as Feynman's Technique for Computing Integrals .
How Feynman's Technique Works
Leibniz's Rule states that given a differentiable function f ( x , k ) f(x,k) f ( x , k ) ,
d d k ( ∫ a b f ( x , k ) d x ) = ∫ a b ∂ ∂ k f ( x , k ) d x . \frac{d}{dk}\bigg(\int_{a}^{b}f(x,k)dx\bigg)=\int_{a}^{b}\frac{\partial}{\partial k}f(x,k)dx. d k d ( ∫ a b f ( x , k ) d x ) = ∫ a b ∂ k ∂ f ( x , k ) d x .
In other words, it is possible to interchange the derivative operator and the integral in certain circumstances. Feynman's Technique employs this rule to change a seemingly impossible integral into a solvable differential equation.
Examples
Problem 1
Evaluate
∫ 0 1 x 2 − 1 ln x d x . \int_{0}^{1}\frac{x^2-1}{\ln{x}}dx. ∫ 0 1 ln x x 2 − 1 d x .
The integrand must have two unknowns to apply Feynman's technique, so we introduce the constant k k k such that
g ( k ) = ∫ 0 1 x k − 1 ln x d x g(k) = \int_{0}^{1}\frac{x^k-1}{\ln{x}}dx g ( k ) = ∫ 0 1 ln x x k − 1 d x
for k > 0 k>0 k > 0 . This step (assigning a new variable) is the most difficult part, and in some cases there won't be any suitable options. Fortunately, in this case, replacing the exponent with k k k will later allow us to cancel out the ln ( x ) . \ln(x). ln ( x ) .
We proceed with differentiating under the integral sign .
d g d k = d d k ∫ 0 1 x k − 1 ln x d x = ∫ 0 1 ∂ ∂ k x k − 1 ln x d x = ∫ 0 1 x k ln x ln x d x = ∫ 0 1 x k d x = x k + 1 k + 1 ∣ 0 1 = 1 k + 1 . \begin{split}
\frac{dg}{dk} &= \frac{d}{dk}\int_{0}^{1}\frac{x^k-1}{\ln{x}}dx \\
&= \int_{0}^{1}\frac{\partial}{\partial k}\frac{x^k-1}{\ln{x}}dx \\
&= \int_{0}^{1}\frac{x^k\ln{x}}{\ln{x}}dx \\
&= \int_{0}^{1}x^kdx \\
&= \frac{x^{k+1}}{k+1}\bigg\vert_{0}^{1} \\
&= \frac{1}{k+1}.
\end{split} d k d g = d k d ∫ 0 1 ln x x k − 1 d x = ∫ 0 1 ∂ k ∂ ln x x k − 1 d x = ∫ 0 1 ln x x k ln x d x = ∫ 0 1 x k d x = k + 1 x k + 1 ∣ ∣ 0 1 = k + 1 1 .
Therefore
#eq-1 g ( k ) = ln ∣ k + 1 ∣ + C . g(k)=\ln{|k+1|}+C. g ( k ) = ln ∣ k + 1∣ + C .
As our final step, we must find C C C using our original equation
g ( k ) = ∫ 0 1 x k − 1 ln x d x . g(k) = \int_{0}^{1}\frac{x^k-1}{\ln{x}}dx. g ( k ) = ∫ 0 1 ln x x k − 1 d x .
Logically, we start with k = 0 k=0 k = 0 .
g ( 0 ) = ∫ 0 1 1 − 1 ln x d x = 0. g(0)=\int_{0}^{1}\frac{1-1}{\ln{x}}dx = 0. g ( 0 ) = ∫ 0 1 ln x 1 − 1 d x = 0.
Substituting into #eq-1 ,
g ( 0 ) = ln ∣ 0 + 1 ∣ + C 0 = 0 + C C = 0 g ( k ) = ln ∣ k + 1 ∣ . \begin{split}
g(0) &= \ln{|0+1|}+C \\
0 &= 0+C \\
C &= 0 \\
g(k) &= \ln{|k+1|}.
\end{split} g ( 0 ) 0 C g ( k ) = ln ∣0 + 1∣ + C = 0 + C = 0 = ln ∣ k + 1∣ .
Finally, to solve the original integral we calculate g ( 2 ) g(2) g ( 2 ) .
∫ 0 1 x 2 − 1 ln x d x = g ( 2 ) = ln ( 3 ) . \int_{0}^{1}\frac{x^2-1}{\ln{x}}dx = g(2) = \boxed{\ln({3})}. ∫ 0 1 ln x x 2 − 1 d x = g ( 2 ) = ln ( 3 ) .
Not bad! Here is a more complicated example.
Problem 2
Evaluate
∫ 0 π ln ( 1 − 2 α cos x + α 2 ) d x \int_{0}^{\pi} \ln(1-2\alpha\cos{x}+\alpha^2)dx ∫ 0 π ln ( 1 − 2 α cos x + α 2 ) d x
for ∣ α ∣ < 1 |\alpha|<1 ∣ α ∣ < 1 .
Again, the usual tricks will not result in a solution; the reader can attempt it if they wish. It turns out that Feynman's Technique is the only method that works.
This time, there are already two variables in the integrand, α \alpha α and x x x . In this case, we will treat the integral as a function of α \alpha α .
f ( α ) = ∫ 0 π ln ( 1 − 2 α cos x + α 2 ) d x . f(\alpha)=\int_{0}^{\pi}\ln(1-2\alpha\cos{x}+\alpha^2)dx. f ( α ) = ∫ 0 π ln ( 1 − 2 α cos x + α 2 ) d x .
Now we differentiate under the integral sign with respect to alpha.
d f d α = d d α ∫ 0 π − 2 cos x + 2 α 1 − 2 α cos x + α 2 d x = ∫ 0 π ∂ ∂ α ln ( 1 − 2 α cos x + α 2 ) d x = ∫ 0 π − 2 cos x + 2 α 1 − 2 α cos x + α 2 d x . \begin{split}
\frac{df}{d\alpha} &= \frac{d}{d\alpha}\int_{0}^{\pi}\frac{-2\cos{x}+2\alpha}{1-2\alpha\cos{x}+\alpha^2}dx \\
&= \int_{0}^{\pi}\frac{\partial}{\partial \alpha}\ln(1-2\alpha\cos{x}+\alpha^2)dx \\
&= \int_{0}^{\pi}\frac{-2\cos{x}+2\alpha}{1-2\alpha\cos{x}+\alpha^2}dx.
\end{split} d α df = d α d ∫ 0 π 1 − 2 α cos x + α 2 − 2 cos x + 2 α d x = ∫ 0 π ∂ α ∂ ln ( 1 − 2 α cos x + α 2 ) d x = ∫ 0 π 1 − 2 α cos x + α 2 − 2 cos x + 2 α d x .
While this looks messy, it is indeed solvable.
∫ 0 π − 2 cos x + 2 α 1 − 2 α cos x + α 2 d x = 1 α ∫ 0 π − 2 α cos x + 2 α 2 1 − 2 α cos x + α 2 d x = 1 α ∫ 0 π − 2 α cos x + 2 α 2 1 − 2 α cos x + α 2 d x − 1 + 1 = 1 α ∫ 0 π − 2 α cos x + 2 α 2 1 − 2 α cos x + α 2 d x − 1 − 2 α cos x + α 2 1 − 2 α cos x + α 2 + 1 = 1 α ∫ 0 π α 2 − 1 1 − 2 α cos x + α 2 d x + 1 = 1 α ∫ 0 π 1 − 1 − α 2 1 − 2 α cos x + α 2 d x . \begin{split}
\int_{0}^{\pi}\frac{-2\cos{x}+2\alpha}{1-2\alpha\cos{x}+\alpha^2}dx &= \frac{1}{\alpha}\int_{0}^{\pi}\frac{-2\alpha\cos{x}+2\alpha^2}{1-2\alpha\cos{x}+\alpha^2}dx \\&= \frac{1}{\alpha}\int_{0}^{\pi}\frac{-2\alpha\cos{x}+2\alpha^2}{1-2\alpha\cos{x}+\alpha^2}dx - 1 + 1
\\&=\frac{1}{\alpha}\int_{0}^{\pi}\frac{-2\alpha\cos{x}+2\alpha^2}{1-2\alpha\cos{x}+\alpha^2}dx - \frac{1-2\alpha\cos{x}+\alpha^2}{1-2\alpha\cos{x}+\alpha^2} + 1
\\&=\frac{1}{\alpha}\int_{0}^{\pi}\frac{\alpha^2-1}{1-2\alpha\cos{x}+\alpha^2}dx + 1 \\&= \frac{1}{\alpha}\int_{0}^{\pi}1 - \frac{1-\alpha^2}{1-2\alpha\cos{x}+\alpha^2}dx.
\end{split} ∫ 0 π 1 − 2 α cos x + α 2 − 2 cos x + 2 α d x = α 1 ∫ 0 π 1 − 2 α cos x + α 2 − 2 α cos x + 2 α 2 d x = α 1 ∫ 0 π 1 − 2 α cos x + α 2 − 2 α cos x + 2 α 2 d x − 1 + 1 = α 1 ∫ 0 π 1 − 2 α cos x + α 2 − 2 α cos x + 2 α 2 d x − 1 − 2 α cos x + α 2 1 − 2 α cos x + α 2 + 1 = α 1 ∫ 0 π 1 − 2 α cos x + α 2 α 2 − 1 d x + 1 = α 1 ∫ 0 π 1 − 1 − 2 α cos x + α 2 1 − α 2 d x .
Dividing everything by 1 + α 2 1+\alpha^2 1 + α 2 , we get
#eq-2 d f d α = 1 α ( π − 1 − α 2 1 + α 2 ) ∫ 0 π 1 1 − 2 α 1 + α 2 cos x d x = π α − ( 1 α ) ( 1 − α 2 1 + α 2 ) ∫ 0 π 1 1 − 2 α 1 + α 2 cos x d x . \begin{split}
\frac{df}{d\alpha} &= \frac{1}{\alpha}\bigg(\pi-\frac{1-\alpha^2}{1+\alpha^2}\bigg)\int_{0}^{\pi}\frac{1}{1-\frac{2\alpha}{1+\alpha^2}\cos{x}}dx \\&= \frac{\pi}{\alpha}-\bigg(\frac{1}{\alpha}\bigg)\bigg(\frac{1-\alpha^2}{1+\alpha^2}\bigg)\int_{0}^{\pi}\frac{1}{1-\frac{2\alpha}{1+\alpha^2}\cos{x}}dx.
\end{split} d α df = α 1 ( π − 1 + α 2 1 − α 2 ) ∫ 0 π 1 − 1 + α 2 2 α cos x 1 d x = α π − ( α 1 ) ( 1 + α 2 1 − α 2 ) ∫ 0 π 1 − 1 + α 2 2 α cos x 1 d x .
Finally, the rightmost integral is solvable! We use a reverse u u u substitution: let x = 2 arctan u x=2\arctan{u} x = 2 arctan u . Then cos x = 1 − u 2 1 + u 2 \cos{x}=\frac{1-u^2}{1+u^2} cos x = 1 + u 2 1 − u 2 , u = tan x 2 u=\tan{\frac{x}{2}} u = tan 2 x , and d x = 2 d u 1 + u 2 dx=\frac{2du}{1+u^2} d x = 1 + u 2 2 d u .
∫ 0 π 1 1 − 2 α 1 + α 2 cos x d x = ∫ 0 π 2 d u 1 − 2 α 1 + α 2 1 − u 2 1 + u 2 = ∫ 0 π 2 d u 1 + u 2 − 2 α ( 1 − u 2 ) 1 + α 2 = ∫ 0 π 2 ( 1 + α 2 ) d u ( 1 + u 2 ) ( 1 + α 2 ) − 2 α ( 1 − u 2 ) = ∫ 0 π 2 ( 1 + α 2 ) d u 1 + u 2 + α 2 + u 2 α 2 − 2 α + 2 α u 2 = ∫ 0 π 2 ( 1 + α 2 ) d u 1 − 2 α + α 2 + u 2 ( 1 + 2 α + α 2 ) = ∫ 0 π 2 ( 1 + α 2 ) d u ( 1 − α ) 2 + ( 1 + α ) 2 u 2 = 2 ( 1 + α 2 ) ( 1 − α ) 2 ∫ 0 π d u 1 + ( 1 + α 1 − α ) 2 u 2 . \begin{split}
\int_{0}^{\pi}\frac{1}{1-\frac{2\alpha}{1+\alpha^2}\cos{x}}dx &= \int_{0}^{\pi}\frac{2du}{1-\frac{2\alpha}{1+\alpha^2}\frac{1-u^2}{1+u^2}}\\
&= \int_{0}^{\pi}\frac{2du}{1+u^2-\frac{2\alpha(1-u^2)}{1+\alpha^2}} \\&= \int_{0}^{\pi}\frac{2(1+\alpha^2)du}{(1+u^2)(1+\alpha^2)-2\alpha(1-u^2)}
\\&= \int_{0}^{\pi}\frac{2(1+\alpha^2)du}{1+u^2+\alpha^2+u^2\alpha^2-2\alpha+2\alpha u^2} \\&= \int_{0}^{\pi}\frac{2(1+\alpha^2)du}{1-2\alpha+\alpha^2+u^2(1+2\alpha+\alpha^2)}\\&= \int_{0}^{\pi}\frac{2(1+\alpha^2)du}{(1-\alpha)^2+(1+\alpha)^2u^2} \\&= \frac{2(1+\alpha^2)}{(1-\alpha)^2}\int_{0}^{\pi}\frac{du}{1+(\frac{1+\alpha}{1-\alpha})^2u^2}.
\end{split} ∫ 0 π 1 − 1 + α 2 2 α cos x 1 d x = ∫ 0 π 1 − 1 + α 2 2 α 1 + u 2 1 − u 2 2 d u = ∫ 0 π 1 + u 2 − 1 + α 2 2 α ( 1 − u 2 ) 2 d u = ∫ 0 π ( 1 + u 2 ) ( 1 + α 2 ) − 2 α ( 1 − u 2 ) 2 ( 1 + α 2 ) d u = ∫ 0 π 1 + u 2 + α 2 + u 2 α 2 − 2 α + 2 α u 2 2 ( 1 + α 2 ) d u = ∫ 0 π 1 − 2 α + α 2 + u 2 ( 1 + 2 α + α 2 ) 2 ( 1 + α 2 ) d u = ∫ 0 π ( 1 − α ) 2 + ( 1 + α ) 2 u 2 2 ( 1 + α 2 ) d u = ( 1 − α ) 2 2 ( 1 + α 2 ) ∫ 0 π 1 + ( 1 − α 1 + α ) 2 u 2 d u .
Note that 1 + α 1 − α \frac{1+\alpha}{1-\alpha} 1 − α 1 + α ranges from 0 to − ∞ -\infty − ∞ because ∣ α ∣ < 1 |\alpha|<1 ∣ α ∣ < 1 . To simplify things, we declare a constant β \beta β such that
β = 1 + α 1 − α u and d β = 1 + α 1 − α d u (so d u = 1 − α 1 + α d β ) . \beta=\frac{1+\alpha}{1-\alpha}u \text{ and } d\beta=\frac{1+\alpha}{1-\alpha}du \text { (so } du=\frac{1-\alpha}{1+\alpha}d\beta \text{)}. β = 1 − α 1 + α u and d β = 1 − α 1 + α d u (so d u = 1 + α 1 − α d β ) .
Substituting,
2 ( 1 + α 2 ) ( 1 − α ) 2 ∫ 0 π d u 1 + ( 1 + α 1 − α ) 2 u 2 = 2 ( 1 + α 2 ) ( 1 − α ) ( 1 + α ) ∫ 0 − ∞ d β 1 + β 2 . \frac{2(1+\alpha^2)}{(1-\alpha)^2}\int_{0}^{\pi}\frac{du}{1+(\frac{1+\alpha}{1-\alpha})^2u^2} = \frac{2(1+\alpha^2)}{(1-\alpha)(1+\alpha)}\int_{0}^{-\infty}\frac{d\beta}{1+\beta^2}. ( 1 − α ) 2 2 ( 1 + α 2 ) ∫ 0 π 1 + ( 1 − α 1 + α ) 2 u 2 d u = ( 1 − α ) ( 1 + α ) 2 ( 1 + α 2 ) ∫ 0 − ∞ 1 + β 2 d β .
This looks familiar; it's arctan!
2 ( 1 + α 2 ) ( 1 − α ) ( 1 + α ) ∫ 0 − ∞ d β 1 + β 2 = 2 ( 1 + α 2 ) 1 − α 2 arctan β ∣ 0 − ∞ = 2 ( 1 + α 2 ) 1 − α 2 ( − π 2 ) = − π ( 1 + α 2 ) 1 − α 2 . \begin{split}
\frac{2(1+\alpha^2)}{(1-\alpha)(1+\alpha)}\int_{0}^{-\infty}\frac{d\beta}{1+\beta^2} &= \frac{2(1+\alpha^2)}{1-\alpha^2}\arctan{\beta}\bigg\vert_{0}^{-\infty}
\\&= \frac{2(1+\alpha^2)}{1-\alpha^2}(\frac{-\pi}{2}) \\&= \frac{-\pi(1+\alpha^2)}{1-\alpha^2}.
\end{split} ( 1 − α ) ( 1 + α ) 2 ( 1 + α 2 ) ∫ 0 − ∞ 1 + β 2 d β = 1 − α 2 2 ( 1 + α 2 ) arctan β ∣ ∣ 0 − ∞ = 1 − α 2 2 ( 1 + α 2 ) ( 2 − π ) = 1 − α 2 − π ( 1 + α 2 ) .
The integral portion of #eq-2 is now simplified, but we must not forget the multipliers.
d f d α = π α − ( 1 α ) ( 1 − α 2 1 + α 2 ) − π ( 1 + α 2 ) 1 − α 2 = π α − − π α = 2 π α . \frac{df}{d\alpha} = \frac{\pi}{\alpha}-\bigg(\frac{1}{\alpha}\bigg)\bigg(\frac{1-\alpha^2}{1+\alpha^2}\bigg)\frac{-\pi(1+\alpha^2)}{1-\alpha^2} = \frac{\pi}{\alpha}-\frac{-\pi}{\alpha} = \frac{2\pi}{\alpha}. d α df = α π − ( α 1 ) ( 1 + α 2 1 − α 2 ) 1 − α 2 − π ( 1 + α 2 ) = α π − α − π = α 2 π .
We can now solve for f ( α ) f(\alpha) f ( α ) by integrating:
#eq-3 f ( α ) = 2 π ln ∣ α ∣ + C . f(\alpha) = 2\pi\ln{|\alpha|}+C. f ( α ) = 2 π ln ∣ α ∣ + C .
Our final step is to find C C C using our original equation,
f ( α ) = ∫ 0 π ln ( 1 − 2 α cos x + α 2 ) d x . f(\alpha)=\int_{0}^{\pi}\ln(1-2\alpha\cos{x}+\alpha^2)dx. f ( α ) = ∫ 0 π ln ( 1 − 2 α cos x + α 2 ) d x .
We first consider substituting α = 0 \alpha=0 α = 0 , but we note that it would give us ln ( 0 ) \ln{(0)} ln ( 0 ) in #eq-3 , which is undefined. We try α = 1 \alpha=1 α = 1 next:
f ( 1 ) = ∫ 0 π ln ( 2 − 2 cos x ) d x . f(1)=\int_{0}^{\pi} \ln(2-2\cos{x})dx. f ( 1 ) = ∫ 0 π ln ( 2 − 2 cos x ) d x .
This integral evaluates to 0. The derivation is left as an exercise to the reader.
It follows that
f ( 1 ) = 2 π ln ( 1 ) + C = 0 + C = 0 , f(1)=2\pi\ln{(1)}+C=0+C=0, f ( 1 ) = 2 π ln ( 1 ) + C = 0 + C = 0 ,
so C = 0. C=0. C = 0.
Finishing up,
∫ 0 π ln ( 1 − 2 α cos x + α 2 ) d x for ∣ α ∣ < 1 = f ( α ) = 2 π ln ∣ α ∣ . \int_{0}^{\pi} \ln(1-2\alpha\cos{x}+\alpha^2)dx \text{ for } |\alpha|<1 = f(\alpha) = \boxed{2\pi\ln{|\alpha|}}. ∫ 0 π ln ( 1 − 2 α cos x + α 2 ) d x for ∣ α ∣ < 1 = f ( α ) = 2 π ln ∣ α ∣ .
The technique of differentiating under the integral sign is not commonly used, but very powerful in certain situations.
Exercises for the Reader
The solution to these integrals are much shorter than the first example, so don't hesitate to try them.
Use Feynman's technique to evaluate
∫ 0 1 ( 2 x + k 3 ) 2 d x . \int_{0}^{1}(2x+k^3)^2dx. ∫ 0 1 ( 2 x + k 3 ) 2 d x . Hint Take the derivative with respect to k . k. k . Answer 6 k 5 + 6 k 2 \boxed{6k^5+6k^2} 6 k 5 + 6 k 2 Use Feynman's technique to evaluate the following integral (2005 Putnam Competition, #A5)
∫ 0 1 ln ( x + 1 ) x 2 + 1 d x \int_{0}^{1}\frac{\ln(x+1)}{x^2+1}dx ∫ 0 1 x 2 + 1 ln ( x + 1 ) d x Hint Let f ( k ) = ∫ 0 1 ln ( k x − 1 ) x 2 + 1 d x . \displaystyle{f(k)=\int_{0}^{1}\frac{\ln({kx-1})}{x^2+1}}dx. f ( k ) = ∫ 0 1 x 2 + 1 ln ( k x − 1 ) d x . Answer π ln 2 8 \boxed{\dfrac{\pi\ln{2}}{8}} 8 π ln 2 Use Feynman's technique to evaluate
∫ 0 π e cos x cos ( sin x ) d x . \int_{0}^{\pi}e^{\cos{x}}\cos{(\sin{x})}dx. ∫ 0 π e c o s x cos ( sin x ) d x . Hint Let f ( k ) = ∫ 0 π e k cos x cos ( k sin x ) d x . \displaystyle{f(k)=\int_{0}^{\pi}e^{k\cos{x}}\cos({k\sin{x}})}dx. f ( k ) = ∫ 0 π e k c o s x cos ( k sin x ) d x . Answer π \boxed{\pi} π
Happy integrating!
References
Feynman, Richard P. Surely You're Joking, Mr. Feynman! Bantam Books, 1986.
The Red, Panda. Richard Feynman's Integral Trick. . Medium , 16 July 2018, https://medium.com/cantors-paradise/richard-feynmans-integral-trick-e7afae85e25c . Accessed 18 Jan. 2020.