Learning Feynman's Trick for Integrals
Recorded: Nov. 30, 2025, 1:05 a.m.
| Original | Summarized |
Feynman's Trick Home Hello, World! Feynman's Trick a.k.a. Differentiation under the Integral Sign & Leibniz Integral Rule Among a few other integral tricks and techniques, Feynman's trick was a strong reason that made me love evaluating integrals, and although the technique itself goes back to Leibniz being commonly known as the Leibniz integral rule, it was Richard Feynman who popularized it, which is why it is also referred to as Feynman's trick. "One thing I never did learn was contour integration. I had learned to do integrals One day he told me to stay after class. "Feynman," he said, "you talk too much and you make too much noise. So every physics class, I paid no attention to what was going on with Pascal's Law, or whatever they were That book also showed how to differentiate parameters under the integral sign -- it's a certain operation. The result was, when guys at MIT or Princeton had trouble doing a certain integral, it was because they For me, employing this trick felt like I was using cheat codes to deal with integrals. At the same time, it enabled a lot of creativity and wishful thinking, which transformed integrals into puzzles. Unfortunately, this also means that there is no clear path on how and when to use this technique. In addition, what Feynman wrote still applies today since the method isn't taught much, if at all, in universities. Therefore, the trick can seem obscure and difficult to grasp for newcomers. In the following section, we will embark on a journey to develop some rules of thumb to have at our disposal when using Feynman's trick. These are merely some heuristics that I tend to use, so deviating from them can be perfectly acceptable. However, I hope that they can provide a path to follow when nothing obvious or intuitive occurs when someone tries to use this trick, or even better, so that they can serve as motivation for someone to start using the method. Hello, World! Feynman already provided a significant hint about the trick when he mentioned differentiating under the integral sign, which is also an alternative name for the technique. More explicitly, if \(f(x,t)\) and \(\frac{\partial f(x,t)}{\partial t}\) is continuous with respect to both variables over the \([a,b]\) interval, then the following holds: \[\frac{d}{dt} \int_a^b f(x, t)dx = \int_a^b \frac{\partial f(x, t)}{\partial t}dx\] This is nice, but not so useful by itself since it doesn't say anything about how and when to apply it. Moreover, learning is not a spectator sport and one has to get their hands dirty as there are no shortcuts to it. Thus, with the goal to develop some strategies here as well, we will dive straight into action and approach Feynman's trick using practical examples. As a "Hello, World!" introduction, let's take a look at the following integral: \[I=\int_0^1 \frac{x-1}{\ln x}dx\] You are encouraged to try and evaluate the integral using basic methods, but the logarithm being in the Unfortunately in the integral from above we lack a parameter, therefore the first step is to parameterise the integral, which can even mean introducing a whole function, but for this example we will simply consider: \[I(t)=\int_0^1 \frac{x^t-1}{\ln x}dx\] Keep in mind that our original integral is just \(I(1)\). Also, surely we could've placed a parameter in many \[I(a)=\int_0^1 \frac{x-a}{\ln x}dx, \quad I(b)=\int_0^1 \frac{x-1}{b-\ln x}dx, \quad I(c)=\int_0^1 \frac{x-1}{\ln (cx)}dx\ ...\] However, the main idea behind the trick is to obtain an integral that we can evaluate easier, after differentiating with respect to the new parameter. Let's put this in action and see what happens to \(I(t)\). \[I'(t)=\int_0^1 \frac{\partial}{\partial t}\left(\frac{x^t-1}{\ln x}\right)dx = \int_0^1x^tdx = \frac{x^{t+1}}{t+1}\bigg|_0^1 = \frac{1}{t+1}\] Notice how easy it was to evaluate the integral \(I'(t)=\int_0^1x^tdx\) from above, had we kept \(I(a)\), \(I(b)\) We can already sense that the following might be an important question in the future: We will worry about that a bit later, for now let's finish the integral as we only found \(I'(t)\). \[\int_a^b f'(x) dx = f(b)-f(a)\] For us, \(f(x)\) is just \(I(t)\) in the above expression. Luckily \(I(0)=0\), and as we are looking for \[I= I(1)-I(0)=\int_0^1 I'(t)dt = \int_0^1 \frac{1}{1+t}dt=\ln(1+t)\bigg|_0^1 = \ln 2\] So that is the big picture of Feynman's trick - we have an integral that is hard to evaluate The parameter As emphasized above, the main goal of the technique is to obtain an integral that is easier to evaluate after \[I=\int_0^1 \frac{\ln(1+x)}{1+x^2}dx\] The most annoying thing is the logarithm, so if we get rid of it everything should be straightforward. \[I(a)=\int_0^1\frac{\ln(a+x)}{1+x^2}dx, \quad I(b) = \int_0^1 \frac{\ln(1+bx)}{1+x^2}dx\] With the first one we are out of luck, as differentiating with respect to \(a\) gives: \[I'(a)=\int_0^1 \frac{1}{(a+x)(1+x^2)}dx = \frac{1}{1+a^2}\int_0^1\left(\frac{1}{a+x}+\frac{a}{1+x^2}-\frac{x}{1+x^2}\right)dx\] Therefore, if we would try to go back to what we're looking, which is \(I=I(1)-I(0)\), we would end up with In contrast, things work out nicely with the second choice from above. \[I'(b)=\int_0^1\frac{x}{(1+bx)(1+x^2)}dx=\frac{1}{1+b^2}\int_0^1\left(\frac{b}{1+x^2}+\frac{x}{1+x^2}-\frac{b}{1+bx}\right)dx\] Again, we are looking to find \(I(1)\), and as \(I(0) = 0\), we have: \[I=\int_0^1 I'(b)db \Rightarrow 2I=\int_0^1 \left(\frac{\pi}{4}\frac{b}{1+b^2}+\frac{\ln 2}{2}\frac{1}{1+b^2}\right)db \Rightarrow I=\frac{\pi}{8}\ln 2\] This works, but we can do even better. Looking at the Hello, World! integral we can see that there we simplified the logarithm in the denominator while performing \(\frac{\partial}{\partial t}x^t\). This is also the first thing that I always attempt to look for when using this technique - namely, to simplify something from the integrand which is independent to the parameter when differentiating. Surely for the current integral we got rid of the logarithm, but the denominator remained intact. In short this will be our first rule of thumb: if possible, place the parameter so that something from the integral, which is not related to the parameter, gets simplified. In order to achieve this with our integral we would need to get rid of \(1+x^2\), and by using \(\ln x=\frac12\ln(x^2)\) we can rewrite the integral as: \[I=\int_0^1\frac{\ln(1+x)}{1+x^2}dx=\frac12\int_0^1\frac{\ln(1+2x+x^2)}{1+x^2}dx\] Finally, in this form it's more natural to place the parameter so that it simplifies \(1+x^2\) when differentiating with respect to \(t\), namely we can consider: \[I(t)=\frac12\int_0^1 \frac{\ln(2x+t(1+x^2))}{1+x^2}dx\Rightarrow I'(t)=\frac12\int_0^1 \frac{1}{2x+t(1+x^2)}dx=\frac14\frac{\ln\left(\frac{1+\sqrt{1-t^2}}{t}\right)}{\sqrt{1-t^2}}\] Like for \(I(b)\) we are looking to find \(I(1)\), however here \(I(0)\) is equal to \(\frac12\int_0^1\frac{\ln(2x)}{1+x^2}dx\) not \(0\). \[\Rightarrow I=I(1)-I(0)+I(0)=\frac14\int_0^1\frac{\ln\left(\frac{1+\sqrt{1-t^2}}{t}\right)}{\sqrt{1-t^2}}dt+\frac12\int_0^1\frac{\ln(2x)}{1+x^2}dx\] For this specific integral we only avoided performing partial fractions so there wasn't really a big improvement by simplifying the denominator. However I want to emphasize the importance of this because it will make things come way more natural when deciding where place the parameter. Of course, in case there's not an appropiate or immediate way to achieve this, it's perfectly fine to place the parameter elsewhere too. As mentioned previously, practicing is the best approach to get along with new techniques, therefore below are more integrals to evaluate alongside some hidden steps in case those will be needed. However, I strongly recommend to try and deal with the integrals before looking at any hints, and only check them afterwards for correctness. \[\int_0^\frac{\pi}{2} \frac{\ln(1-\sin x)}{\sin x}dx = ?\] Consider introducing the following parameter: \[\int_0^1 \frac{\ln(1-x+x^2)}{x-x^2}dx = ?\] Consider introducing the following parameter: \[\int_0^\frac{\pi}{2} \frac{\arctan(\sin x)}{\sin x}dx = ?\] Consider introducing the following parameter: \[\int_0^\infty x^2e^{-\left(4x^2+\frac{9}{x^2}\right)}dx = ?\] Consider introducing the following parameter: \[\int_0^1 \frac{\ln x}{1-x^2}dx = ?\] Consider parameterising the integral as: \[\int_0^\infty \frac{e^{-x^2}}{1+x^2}dx = ?\] Consider parameterising the integral as: \[\int_0^\infty \frac{\ln\left(\frac{1-x^2+x^4}{(1-x^2)^2}\right)}{(1+x^2)^2}dx = ?\] Since \(1-x^2+x^4=(1+x^2)^2-3x^2\), consider parameterising the integral as: Accelerated Feynman's trick The previous chapter emphasized to parameterise integrals so that something from the integral, which is not related to the parameter, gets simplified when differentiating (if possible). However there are times when even though we can introduce a parameter to accomplish that, it wouldn't be enough to finish the integral. In this chapter we will look at a different way to obtain this simplification. Let's start by looking at a modified version of an integral that was previously given as an exercise. \[I=\int_{-\infty}^\infty \frac{e^{-x^2}}{1+x^4}dx\] With \(\int_{-\infty}^\infty \frac{e^{-x^2}}{1+x^2}dx\) it was quite direct to parameterise the integral as \(\int_{-\infty}^\infty \frac{e^{-t(1+x^2)}}{1+x^2}dx\) since it simplifies the denominator, however the similar way to do that for our integral, \(\int_{-\infty}^\infty \frac{e^{-x^2-t(1+x^4)}}{1+x^4}dx\), doesn't seem to work as it complicates things a bit too much. There is however a way to simplify the denominator and in the same time to obtain a decent integral afterwards. Without getting into too much details I will parameterise the integral as: \[I(t)=\int_{-\infty}^\infty \frac{e^{-x^2}}{1+x^4} e^{-tx^2}(x^2\sin t+\cos t) dx\] This will seem obscure, but fear not as we will never use this approach again. \[I'(t)=-\sin t\int_{-\infty}^\infty e^{-x^2}e^{-tx^2}dx \overset{(1+t)x^2\to x^2}= -\frac{\sin t}{\sqrt{1+t}} \int_{-\infty}^\infty e^{-x^2}dx=-\sqrt \pi \frac{\sin t}{\sqrt{1+t}}\] Here we are looking to find \(I=I(0)\), and we also have \(I(\infty)=0\), therefore: \[I=-\int_0^\infty I'(t)dt=\sqrt \pi \int_0^\infty \frac{\sin t}{\sqrt{1+t}}dt\overset{\sqrt{1+t}=x}=2\sqrt \pi \int_1^\infty \sin(x^2-1)dx\] Where \(S(x)\) and \(C(x)\) are the Fresnel integrals. However, the approach is important here, not the result itself. We can avoid the parametrisation from above by directly using \(\frac{1}{1+x^4}=\int_0^\infty e^{-tx^2}\sin t \, dt\), and then switch to double integrals, or put in other words: employ the accelerated Feynman's trick (in which we skip the usual parameterisation step). \[I=\int_{-\infty}^\infty \frac{e^{-x^2}}{1+x^4}dx = \int_{-\infty}^\infty e^{-x^2}\int_0^\infty e^{-tx^2}\sin t \, dtdx\] The rest goes exactly as with the previous method, as all we did here was to skip differentiation step and instead we switched to double integrals. A natural question that arises here is how did \(\frac{1}{1+x^4}=\int_0^\infty e^{-tx^2}\sin t\, dt\) appear? Or even better, how can someone come up with similar results for other integrals? In the case from above, simply the Laplace transform of the sine function was used, however in general it's useful to have a list of such identities. There are tables of integral results that can be used - for example: Table of Integrals, Series, and Products by Gradshteyn and Ryzhik - but alternatively one can build up their own list of results which tend to appear often while evaluating other integrals. Let's conclude this chapter by evaluating one of the most popular integrals that appears when Feynman's trick gets into the conversation. \[I=\int_0^\infty \frac{\sin x}{x}dx\] Since \(\int_0^\infty e^{-xt} dt = \frac{1}{x}\), we can make use of this to rewrite the integral as: \[I=\int_0^\infty \int_0^\infty \sin x e^{-xt}dtdx = \int_0^\infty \int_0^\infty \sin x e^{-xt}dxdt=\int_0^\infty \frac{1}{1+t^2}dt =\frac{\pi}{2}\] Alternatively, we can also consider the parameter version of this integral, \(\int_0^\infty \frac{\sin x}{x}e^{-xt}dx\), however I feel like switching to double integrals is way more intuitively. It might be worth to highlight again that this method should be used preferable when parameterising the integral leads to nowhere. For the above integral, the natural introduction of \(\int_0^\infty \frac{\sin(tx)}{x}dx\) unfortunatelly does fail, as we obtain a divergent integral after differentiating under the integral sign. Like in the previous chapter below are more integrals alongside some hints in order to practice with the accelerated variation of Feynman's trick. However in this case I do recommend to peek at hints faster in case nothing obvious comes to mind, and afterwards to attempt and understand why the mentioned identity can be used. \[\int_0^\infty \sin(x^2)dx=?\] Start by substituting \(x^2\to x\) and then switch to double integrals using: \[\int_0^\infty \frac{\operatorname{Li}_2(x)}{x\sqrt{1-x^2}}dx=?\] Switch directly to double integrals by using: \[\int_0^1 \frac{\arctan x\ln(1+x^2)}{x(1+x)}dx = ?\] Switch to double integrals by using the following result: \[\int_{-\infty}^\infty \frac{x}{\pi^2+x^2}\frac{e^{2x}}{(1+e^{x})^3}dx\] Consider switching to double integrals with: \[\int_0^\infty x\left(\operatorname{Ci}^2(x)+\operatorname{si}^2(x)\right)\operatorname{Ci}(x)dx\] Consider switching to double integrals using: Above \(\operatorname{Li}_2(x)\) denotes the dilogarithm function and \(\operatorname{Ci}(x)\), \(\operatorname{si}(x)\) are the cosine and the sine integral functions, defined as: \[\operatorname{Li}_2(x)=\sum_{n=1}^\infty \frac{x^n}{n^2},\ \operatorname{Ci}(x) = - \int_x^\infty \frac{\cos t}{t}dt,\ \operatorname{si}(x) = - \int_x^\infty \frac{\sin t}{t}dt\] More Feynman's trick variants We already got familiar with a popular version of Feynman's trick in the previous chapter. Similarly, now we will take a look at other interesting variants of Feynman's trick, which although might appear less often, they can still help to expand the applicability of the technique. Differentiating under the integral sign We will start by taking a look at a much simpler case of Feynman's trick, namely, in the situation when it would be enough to simply differentiate under the integral sign without performing that "undo" step to integrate back. As a small note, it's true that "differentiating under the integral sign" tends to be used as an alternative name for Feynman's trick, however I prefer to keep this for the variant where only the differentiating process takes part, or as mentioned above, when there's no need to integrate back the result, and the name describes quite literally what we are doing. Let's make this more clear by looking at the following integral: \[I=\int_0^1 x^3 \ln^2 x \, dx \] We are already aware from the Hello, World! integral how \(\ln x\) can be simplified, since \(\frac{\partial}{\partial a}x^a = x^a \ln x\). However, by introducing the parameter in that original form as \(x^a \ln^2 x\), we would just produce a third logarithm, so that's going in the opposite direction. Fortunatelly, if we take a step back, we can observe that after we find the result of \(\int_0^1 x^a dx\), then differentiating it w.r.t.\(a\) would give us as many logarithms as we want. So, let's put that integral to use. \[\mathcal J(a)=\int_0^1 x^a dx = \frac{1}{a+1}\] Of course the integral itself was quite simple this time, however the important part that should be highlighted is that not always we need to perform that "undo" step after differentiating under the integral sign - and sometimes knowing a general integral result can provide us more useful integrals by differentiating it. Feynman's trick & indefinite integrals Further, we will take a look at how Feynman's trick can be applied to indefinite integrals. Let's consider: \[\int \frac{1}{\sqrt{x^3}} \exp\left({-\frac{(a-bx)^2}{2x}}\right) dx\] In this form it makes no sense to differentiate the integral with respect to any parameter, but we can extend the integral with temporary bounds by writing: \[\int f(x)dx = F(x) + C = F(x) - F(0) = \int_0^x f(t)dt\] After this we can go on apply Feynman's trick, however, first we are going get rid of the square root via the substitution \(\frac{1}{\sqrt x}\to x\). \[I(a,b,t)=2\int_\frac{1}{\sqrt t}^\infty \exp\left(-\frac12 \left(ax-b/x\right)^2\right)dx\] Here, we can notice that the derivative of \(ax-\frac{b}{x}\) is \(a+\frac{b}{x^2}\) so it would be quite helpful if we had that additional term. \[\frac{\partial}{\partial b}I(a,b,t)=2\int_\frac{1}{\sqrt t}^\infty \exp\left(-\frac12 \left(ax-b/x\right)^2\right)\left(a-\frac{b}{x^2}\right)dx\] Where \(\operatorname{erfc}(x)\) is the complementary error function. Now we'll go back to \(I(a,b,t)\), but we should be careful to replace the dummy variable \(b\), with something else as the \(b\) parameter does also appear in the bounds. \[\lim_{b\to -\infty}I(a,b,t)=0\Rightarrow I(a,b,t)=\sqrt{2\pi}\int_{-\infty}^be^{2ax}\operatorname{erfc}\left(\frac{\frac{a}{\sqrt t}+x\sqrt t}{\sqrt 2}\right)dx\] Or for the indefinite integral, this would lead to: \[\small \int \frac{1}{\sqrt{x^3}} \exp\left({-\frac{(a-bx)^2}{2x}}\right) dx=\sqrt{\frac{\pi}{2}}\frac{1}{a}\left(e^{2ab}\operatorname{erfc}\left(\frac{\frac{a}{\sqrt x}+b\sqrt x}{\sqrt 2}\right)+\operatorname{erfc}\left(\frac{\frac{a}{\sqrt x}-b\sqrt x}{\sqrt 2}\right)\right)+C\] Feynman's trick & power series Next, we will take a look at how to combine Feynman's trick with power series. For this we are going to look at: \[I=\int_{0}^{1}\int_{0}^{1}\frac{x\ln x\ln y}{1-xy}\frac{dxdy}{\ln(xy)}\] We are already got familiar with what to do when there is a logarithm in the denominator as we saw that we can get rid of them by using \(\frac{d}{dt} x^t = x^t\ln x\), however here also the \(1-xy\) term appears. In order to solve this issue we'll make use of the geoemtric series, namely \(\frac{1}{1-x}=\sum_{n=0}^\infty x^n\), but we will expand into series a bit later and for now continue with the following integral: \[I(n)=\int_{0}^{1}\int_{0}^{1}\frac{(xy)^{n-1}x\ln x\ln y}{\ln(xy)}dxdy\Rightarrow I'(n)=\int_0^1\int_0^1 (xy)^{n-1} x \ln x \ln y dxdy\] Now we have to to get back to \(I(n)\): \[I(n)=-(I(\infty)-I(n))=-\int_n^\infty \frac{1}{(x+1)^2 x^2 } dx=-\frac{1}{n}-\frac{1}{n+1}+2\ln\left(1+\frac{1}{n}\right)\] And finally, we'll put the geometric series to use. \[\int_0^1\int_0^1 \frac{ x\ln x\ln y}{(1-xy)\ln(xy)}dx\ dy=\sum_{n=1}^\infty \int_0^1\int_0^1 \frac{(xy)^{n-1} x\ln x\ln y}{\ln(xy)}dxdy\] So the result is simply \(1-2\gamma\), where \(\gamma\) is the Euler-Mascheroni constant. Feynman's trick & differential equations In what's to come we are going to take a look at a combination between Feynman's trick and differential equations. Let's consider the following integral: \[I=\int_0^\infty \frac{\cos x}{1+x^2}dx\] We can start by parameterising the cosine function and then employ the accelerated Feynman's trick: \[I(t)=\int_0^\infty \frac{\cos(tx)}{1+x^2}dx=\int_0^\infty \int_0^\infty \cos(tx)\sin y e^{-xy}dydx\] We haven't made much progress above, since we simply arrived at another integral with \(x\sin(tx)\) instead of \(\cos(tx)\), thus complexity is the same. However, as \(\frac{\partial}{\partial t}\cos(tx)\) is \(x\sin(tx)\), differentiating \(I(t)\) gives us a differential equation to work with, namely: \[I'(t)=- \int_0^\infty \frac{x\sin(tx)}{1+x^2}dx = - I(t) \Rightarrow \frac{I'(t)}{I(t)}=-1\Rightarrow I(t) = C e^{-t}\] As a small note for the starting step, although employing the accelerated Feynman's trick was rather obvious as to get rid of the denominator, the additional introduction of the \(t\) parameter might be weird first. However performing the same steps without this parameter gives us: \[\int_0^\infty \frac{\cos x}{1+x^2}dx=\int_0^\infty \frac{x\sin x}{1+x^2}dx\] Which indicates that one might put to use the fact that \(I(1)=-I'(1)\), by adding the additional \(t\) parameter. Generalizing Feynman's trick So far we've seen the Feynman's trick applied only when the parameter was inside the integrand, however it can also be used when the bounds are parameterised as well. More generally, the following holds: \[\frac{d}{dt} \int_{a(t)}^{b(t)} f(x, t)dx = \frac{d}{dt}b(t)f(x,b(t))-\frac{d}{dt}a(t)f(x,a(t))+\int_{a(t)}^{b(t)} \frac{\partial f(x, t)}{\partial t}dx\] We'll put this to use with the integral from below. \[I=\int_\frac{1}{\sqrt 2}^1 \frac{\operatorname{arccosh}\left(\sqrt 2 x\right)}{\sqrt{1-x^2}}dx\] Above we can see that the same \(\sqrt 2\) appears in both the lower bound and the \(\operatorname{arccosh}\) function, so we'll parameterise the integral as: \[I(t)=\int_\frac{1}{t}^1 \frac{\operatorname{arccosh}\left(t x\right)}{\sqrt{1-x^2}}dx We're looking to find \(I=I\left(\sqrt 2\right)\), and since \(I\left(1\right)=0\), we have: \[I=\int_1^\sqrt 2I'(t)dt = \frac{\pi}{2} \int_1^\sqrt 2 \frac{1}{t}dt=\frac{\pi}{4}\ln 2\] Generating integrals using Feynman's trick Now we'll take a look at a fancier way to use Feynman's trick, especially in order to generate new integrals, for this we're considering: \[I(t)=\int_0^\frac{\pi}{2} \arctan\left(\frac{\sin x-\tan\frac{t}{2}}{\cos x}\right)dx\] Note that we are not trying to evaluate the above integral, instead we are simply using it in order to build up new integrals with the result that follows after differentiating w.r.t. \(t\). \[I'(t)=-\frac12\int_0^\frac{\pi}{2}\frac{\cos x}{1-\sin t\sin x}dx=\frac12 \frac{\ln(1-\sin t)}{\sin t}\] We also have that \(I(\pi)=-\frac{\pi^2}{4}\) and \(I(0)=\frac{\pi^2}{8}\), therefore: \[I(\pi)-I(0)=-\frac{\pi^2}{4}-\frac{\pi^2}{8}=\frac12\int_0^\pi \frac{\ln(1-\sin x)}{\sin x}dx\] In retrospect, this integral also appeared as an exercise in the second chapter, and with the same suggestion from there, we can evaluate the integral by applying Feynman's trick to: \[I(t)=\int_0^\pi \frac{\ln(1-\sin t\sin x)}{\sin x}dx\] Admittedly, following this parameterisation is much more intuitevely than what we've shown with the new variation, however it's also useful to have this trick in the bag. To keep the practice going, underneath are listed some integrals that can be evaluated with one version of Feynman's trick described in this chapter. \[\int_1^\infty \int_1^\infty (x+y)^2 e^{-(x+y)}dxdy = ?\] Start by showing that: \[\int x^4\cos(nx)dx = ?\] Differentiate four times with respect to \(n\) the following extended indefinite integral: \[\int_0^1 \int_0^1 \frac{dxdy}{(1+xy)\ln(xy)} = ?\] Combine the geometric series \(\sum\limits_{n=0}^\infty (-1)^n x^n = \frac{1}{1+x}\) with: \[\int_0^\infty \frac{\sin^2 x}{x^2(1+x^2)}dx = ?\] Solve the resulting differential equation after differentiating twice the following integral: \[\int_0^1 \ln x \left(\frac{1}{t+x}+\frac{1}{\frac{1}{t}+x}\right)dx = ?\] Split the integral in two parts, then substitute \(x\to tx\) and respectively \(x\to \frac{x}{t}\) in the resulting integrals to obtain: \[\int_0^\infty e^{-x^2}dx = ?\] This integral can be generated starting from: Feynman's trick in practice In this last chapter we'll dive into some "real-world" integrals and observe how Feynman's trick can be adapted for them. Breaking the rules In the second chapter we've observed how parameterising the integral so that it also simplifies some parts of the integral can make things more intuitively. However, we can always look for better, especially when our approach doesn't seem elegant enough. Let's see how can we break this rule with the following integral: \[I=\int_0^1 \frac{\ln(1-x^2+x^4)}{1-x^2} dx\] As with our first rule of thumb it's straightforward to introduce the new parameter as: \[I(a)=\int_0^1 \frac{\ln(a(1-x^2)+x^4)}{1-x^2} dx \Rightarrow I'(a)= \int_0^1 \frac{1}{a(1-x^2)+x^4}dx\] You are encouraged to proceed forward with the above integral, however computing \(I'(a)\) might not give the most pleasant result. So to overcome this, we'll manipulate the integral a bit before parametersing it. One extremely useful substitution (which deserves its own special chapter) is \(x\to \frac{1-x}{1+x}\). This one is great here especially since it has the following property (among many others): \[\int_0^1 \frac{f(x)}{1-x^2}dx \overset{x\to\frac{1-x}{1+x}}= \frac12\int_0^1 \frac{f\left(\frac{1-x}{1+x}\right)}{x}dx\] Above, although we could have introduced a simple parameter, for a smoother result we parameterised the integral as: \[I(t)=\int_0^1 \frac{\ln(1+2\cosh t+x^2)}{x} dx \Rightarrow I'(t)= \int_0^1 \frac{2\sinh t}{1+2\cosh t+x^2}dx\] Finally, to find to find \(I\) we can combine \(I(\operatorname{arccosh} 7)\) with \(I(0)\). \[I = \frac14 \int_0^{\operatorname{arccosh 7}} t \, dt - \frac34 I(0) = \frac{\ln^2(2+\sqrt 3)}{2} - \frac{\pi^2}{8}\] The result from above follows since includes \(I(0) = \frac{\pi^2}{6}\), which is also the Basel problem in disguise, but you're further encouraged to approach it by employing Feynman's trick. \[\int_0^1 \frac{\ln(1+x)}{x}dx=\frac{\pi^2}{12}\] One idea is to rewrite the integral as: Switching to rational functions Maybe it's just a personal preference, but for me working with rational functions tends to give a higher visibility on how to parameterise the integrals. We'll see what is meant by this when dealing with the following integral: \[I=\int_0^\frac{\pi}{2}\ln(2+\tan^2 x)dx\] In this form, two immediate ways to parameterise the integral are as follows: \[I(a)=\int_0^\frac{\pi}{2}\ln(a+\tan^2 x)dx,\quad I(b)=\int_0^\frac{\pi}{2}\ln(2+b\tan^2 x)dx\] It turns out that both variants work, but we can do better. Another rule of thumb that I follow is to use almost exclusive rational functions as they often provide the most visibility to work with. Let's do that for our integral too. \[I=\int_0^\frac{\pi}{2}\ln(2+\tan^2 x)dx\overset{\tan x\to x}=\int_0^\infty \frac{\ln(2+x^2)}{1+x^2}dx\] And at this point it should be obvious where to place the parameter so that we can simplify the denominator. \[I(t)=\int_0^\infty \frac{\ln(1+t(1+x^2))}{1+x^2}dx\Rightarrow I'(t)=\int_0^\infty \frac{1}{1+t+tx^2}dx=\frac{\pi}{2}\frac{1}{\sqrt t\sqrt{1+t}}\] Obviously, if you're already more used to trigonometric functions, hyperbolic functions or anything else, then this can be ignored. I however recommend switching to rational functions, a few exceptions being when there's a clear way to parameterise the integral directly or when at least one of the bounds is \(\infty\). For more practice you can also attempt to tackle the following integral: \[\int_0^\frac{\pi}{2} \ln(\sec^2 x +\tan^4 x)dx=?\] Start by substituting \(\tan x \to x\) then employ Feynman's trick. Cleaning up the functions Before parameterising the integrals it's quite useful to clean the disturbing functions as much as possible before any parameterisation. Let's demonstrate this by considering: \[I=\int_0^\frac{\pi}{2}\arctan\left(\frac{2\sin x}{2\cos x -1}\right)\frac{\sin\left(\frac{x}{2}\right)}{\sqrt{\cos x}}dx\] As we have trigonometric functions all over the place, we will perform the Weierstrass substitution \(\tan\left(\frac{x}{2}\right)\to x\) in order to obtain only rational functions, as per the previous heuristic. \[\Rightarrow I = 2\int_0^1 \frac{x\arctan\left(\frac{4x}{1-3x^2}\right)}{\sqrt{1-x^2}(1+x^2)}dx\] It would be great to parameterise the integral so that we get rid of the arctangent function, but unfortunately here it is a bit overloaded, therefore we'll clean it by splitting it into two. In case it's not obvious how to do that directly, we can differentiate it, perform partial fractions and then integrate back. \[\frac{d}{dx}\arctan\left(\frac{4x}{1-3x^2}\right)=\frac{12x^2+4}{9x^4+10x^2+1}=\frac{1}{1+x^2}+\frac{3}{1+9x^2}\] However since we're integrating over the \((0,1)\) interval we have that \(x \cdot 3 x>1\) for \(x > \frac{1}{\sqrt 3}\), so we need to rewrite the integral as: \[I=2\int_0^1 \frac{x(\arctan x + \arctan(3x))}{\sqrt{1-x^2}(1+x^2)}dx - 2 \int_\frac{1}{\sqrt 3}^1 \frac{x}{\sqrt{1-x^2}(1+x^2)}dx\] At this point there's only left to evaluate the first integral, \(\mathcal J\), for which we'll employ Feynman's trick. There isn't any way to place the parameter so that we get rid of anything from the denominator so we'll simply introduce the following parameterisation: \[\mathcal J(t)=\int_0^1 \frac{x(\arctan x + \arctan(tx))}{\sqrt{1-x^2}(1+x^2)}dx\Rightarrow \mathcal J'(t) = \int_0^1 \frac{x^2}{\sqrt{1-x^2}(1+x^2)(1+t^2 x^2)}dx\] In general when we have rational functions it is prefered to integrate over \((0,\infty)\), if possible, as it drastically reduces the result, and when there's the derivative of \(\arcsin x\) in the denominator one way to map \((0,1)\) to \((0,\infty)\) is to directly substitute \(x \to \frac{1}{\sqrt{1+x^2}}\). \[\Rightarrow \mathcal J=\int_0^\infty \frac{1}{(2+x^2)(1+t^2+x^2)}dx = \frac{\pi}{2(1-t^2)}\left(\frac{1}{\sqrt{1+t^2}}-\frac{1}{\sqrt 2}\right)\] Now in order to go back to \(\mathcal J(3)\), we'll make use of \(\mathcal J(-1)=0\), so: \[\mathcal J = \frac{\pi}{2}\int_{-1}^3 \frac{1}{(1-t^2)}\left(\frac{1}{\sqrt{1+t^2}}-\frac{1}{\sqrt 2}\right)dt\] Finally, to finish this integral we'll subsitute \(t = \frac{1-x}{1+x}\). \[\Rightarrow \mathcal J = \frac{\pi}{4\sqrt 2}\int_{-\frac12}^\infty \frac{1}{x}\left(\frac{1+x}{\sqrt{1+x^2}}-1\right)dx=\frac{\pi}{\sqrt 2}\ln \left(\frac{1+\sqrt 5}{2}\right)\] As such, we can conclude that: \[\int_0^\frac{\pi}{2}\arctan\left(\frac{2\sin x}{2\cos x -1}\right)\frac{\sin\left(\frac{x}{2}\right)}{\sqrt{\cos x}}dx=\sqrt 2 \pi \ln \left(\frac{1+\sqrt 5}{2}\right)- \frac{\pi}{\sqrt 2}\ln(2+\sqrt 3)\] Similarly you can try and tackle the following integral: \[\int_0^\pi \arctan\left(\frac{1+2\cos x}{\sqrt 3}\right)dx=?\] Start by substituting \(\tan\left(\frac{x}{2}\right) \to x\), then split the arctangent function into two parts and use Feynman's trick. Preparing better integral bounds Another useful thing to consider before using Feynman's trick is to manipulate the bounds prior to parameterising the integral so that they get rid of any complicated functions for the differentiated integral, \(I'(t)\). This will almost always give a smoother and easier integral that we have to undo. We will show this in action with the integral from below. \[I=\int_0^1 \frac{x^2 \ln(1-x^2)}{1+x^4}dx\] With the previous heuristic we've already seen that it is useful to integrate over \((0,\infty)\) when there are some rational functions - therefore we will attempt to do the same with this integral. You are encouraged to try and see what kind of mess it would be produced by parameterising the integral as it is, when the bounds are \((0,1)\). However we will jump straightforward to get our bounds to \((0,\infty)\). In order to obtain that we can notice that the integrand is even, so we can move the bounds to \((-1,1)\) and then substitute \(x\to \frac{1-x}{1+x}\) again, which is another useful way to get our bounds at \((0,\infty)\). \[I=\frac12\int_{-1}^1 \frac{x^2\ln(1-x^2)}{1+x^4}dx\overset{x\to\frac{1-x}{1+x}}=\frac12\int_0^\infty \frac{(1-x)^2\ln\left(\frac{4x}{(1+x)^2}\right)}{1+6x^2+x^4}dx\] Now we can split the logarithm into three parts and use that: \[\int_0^\infty \frac{(1-x)^2}{1+6x^2+x^4}dx = \frac{\pi}{2\sqrt 2}-\frac{\ln(1+\sqrt 2)}{\sqrt 2}\] Therefore our integral is: \[I=\frac{\pi\ln 2}{2\sqrt 2}-\frac{\ln 2\ln(1+\sqrt 2)}{\sqrt 2}-\mathcal J, \quad \mathcal J = \int_0^\infty \frac{(1-x)^2\ln(1+x)}{1+6x^2+x^4}dx\] To evaluate the emerging integral we will perform Feynman's trick. There's not an obvious way to place the parameter as to simplify the denominator, so we'll parameterise the integral as: \[\mathcal J(a) = \int_0^\infty \frac{(1-x)^2\ln(1+ax)}{1+6x^2+x^4}dx\Rightarrow \mathcal J'(a)\int_0^\infty \frac{x(1-x)^2}{(1+ax)(1+6x^2+x^4)}dx\] The partial fraction was ommited above, as what's really important here is that we're left only with a simple \(\ln a\) as a "disturbing" function. In contrast, if the bounds were \((0,1)\) things would have been way more complicated. Let's finish this integral as we still have to undo the differentiating step. \[\mathcal J(1)=\mathcal J(1)-\mathcal J(0)=\int_0^1 \mathcal J'(a)da\] The result from above follows since: \[\int_0^1 \frac{x\ln x}{a^2+x^2}dx\overset{x^2\to x}=\frac14\int_0^1 \frac{\ln x}{a^2+x}dx=\frac14\operatorname{Li}_2\left(-\frac{1}{a^2}\right)\] Where \(\operatorname{Li}_2(x)\) is the dilogarithm and \(\operatorname{Ti}_2(x)\) is the inverse tangent integral. Finally, collecting all the results yields: \[I=\frac{\pi^2}{16\sqrt 2}+\frac{\pi \ln 2}{8\sqrt 2}+\frac{\pi\ln(1+\sqrt 2)}{8\sqrt 2}-\frac{\ln 2\ln(1+\sqrt 2)}{4\sqrt 2}\] With the same idea one can attempt to calculate the following integral: \[\int_0^1 \frac{\ln^2 x\ln(1+x)}{1+x^2}dx=?\] Map the bounds from \((0,1)\) to \((0,\infty)\) by substituting \(x\to\frac{1}{x}\) - here it is necessary to add the resulting integral with the original one - afterwards use Feynman's trick. Multiple parameters We mostly got familiar to apply Feynman's trick by introducing a parameter somewhere, however sometimes even multiple parameters can be used when encountering new integrals. To exemplify such a situation, let's take a look at the following unit square integral arising in geometric probability: \[I=\int_0^1\int_0^1 \left(\frac{-\ln(xy)}{1-xy}\right)^mdxdy\] In order to generate the \(\ln(xy)\) part it's straightforward to consider the following integral: \[I(a)=\int_0^1\int_0^1 \frac{(xy)^a}{(1-xy)^m}dxdy\] Differentiating with respect to \(a\), \(m\) times followed by setting \(a=0\) will gives us the desired integral, ignoring the \((-1)^m\) term. However the denominator is still troublesome, and to deal with that we will introduce one more parameter: \[I(a,z)=\int_0^1\int_0^1 \frac{(xy)^a}{z-xy}dxdy\] This is perfect now, as we can recover our original integral by differentiating with respect to \(a\), \(m\) times, and with respect to \(z\), \(m-1\) times, followed by setting \(a=0\) and respectively \(z=1\) - ignoring some coefficients. One way to evaluate \(I(a,z)\) is to expand the denominator into geometric series as: \[I(a,z)=\int_0^1\int_0^1 \frac{(xy)^a}{z-xy}dxdy=\frac{1}{z}\sum_{n=0}^\infty \int_0^1\int_0^1(xy)^a\left(\frac{xy}{z}\right)^ndxdy\] Now we will take \(m\) derivatives with respect to \(a\) and then set it to \(0\). \[\frac{\partial^m}{\partial a^m}I(a,z) = \int_0^1\int_0^1 \frac{\ln^m(xy)}{z-xy} dxdy =(-1)^m (m+1)!\sum_{n=1}^\infty \frac{1}{z^{n+2}}\frac{1}{n^{m+2}}\] This can be also rewriten in terms of the polylogarithm function as: \[\int_0^1\int_0^1 \frac{(-\ln(xy))^m}{z-xy} dxdy = (m+1)!\operatorname{Li}_{m+2}\left(\frac{1}{z}\right)\] Finally, we can arrive at our original integral by taking \(m-1\) derivatives with respect to \(z\) and setting it to \(1\). \[(-1)^m(m-1)!\int_0^1\int_0^1 \frac{(-\ln(xy))^m}{(1-xy)^m}dxdy=(m+1)!\frac{d^{m-1}}{dz^{m-1}}\operatorname{Li}_{m+2}\left(\frac{1}{z}\right)\bigg|_{z=1}\] Although the derivation from above was the important part since it shows the main idea on how to differentiate in order to produce the desired integral, by using \(\frac{\partial}{\partial z} \operatorname{Li}_n(z) = \frac{\operatorname{Li}_{n-1}(z)}{z}\) the result can be also written, with the help of OEIS, as: \[\int_0^1\int_0^1 \left(\frac{-\ln(xy)}{1-xy}\right)^m dxdy =m(m+1)\sum_{k=1}^{m-1}|s(m-1,m-k)|\zeta(k+2)\] Where \(s(n,m)\) is the Stirling number of the first kind and \(\zeta(z)\) is the Riemann zeta function. A similar idea can be applied for the following integral: \[\int_0^\infty \frac{\cos(3x)}{(1+x^2)^4}dx=?\] Make use of a more general integral that was evaluated in the fourth chapter, namely: Cascaded Feynman's trick Sometimes to enable an application of Feynman's trick we needed to actually apply another Feynman's trick. Let's look at the following integral: \[I = \int_0^\frac{\pi}{2}\int_0^\frac{\pi}{2}\cot x \csc^2 y\ln(\cos y)\ln(1-2\sin x+\sin^2 x\csc^2y)dxdy\] The first step should be pretty obvious by now, namely to get rid of the trigonometric functions. \[I \overset{\large \sin x\to x \atop \large \cot y \to y}=-\frac12\int_0^\infty \int_0^1 \frac{\ln\left(1+\frac{1}{y^2}\right)\ln((1-x)^2+x^2y^2)}{x}dxdy\] Now we can notice that we have two logarithms and only one of them contains the \(x\) term, however since the bounds are \((0,1)\) dealing with that integral won't produce much success (as the result would be quite complicated). However we also have the bounds as \((0,\infty)\) for the \(y\) integral, and it would be even better if we could have a single logarithm. To further obtain such a favorable integral form, we can use the following result: \[\int_0^1 \frac{t}{t^2+y^2}dt=\frac12\ln\left(1+\frac{1}{y^2}\right)\] In the third chapter we saw how it's useful to have a list of integral results. One more such useful integral that tend to appear quite often is: \[\int_0^\infty \frac{\ln(a^2+b^2 x^2)}{1+x^2}dx= \pi \ln(|a|+|b|)\] You can differentiate either \(I(a)\) or \(I(b)\), and even directly employ the accelerated Feynman's trick by writing the logarithm as an integral. Now back to our integral, by using the above result, we can easily finish the integral. \[I=-\pi\int_0^1 \frac{1}{x}\int_0^1 \ln((1-x)+xt)dtdx\] Although this marks the conclusion of the essay, this isn't a static website, and I might update it when I encounter new interesting integrals that are worth to be shown. So far, the integrals comes from my posts on Mathematics Stack Exchange, combined with some of the most popular integrals - thus you can also check them directly there. For further exercises, I can recommend you to explore math forums and magazines such as Art of Problem Solving, Mathematics Stack Exchange, The American Mathematical Monthly, Crux Mathematicorum, or the Romanian Mathematical Magazine, where dozens of fascinating integrals are often posted or published. Additionally, delving into other fields like Statistics, Physics, or Quantum Physics will present you with many remarkable integrals — some of which might be computed using Feynman's trick. I would appreciate a notice on my email address (rxzacky@gmail.com) in case you find any mistakes or if something feels unclear in this essay - and even better if you have some further ideas or suggestions. This work is licensed under a Creative Commons Attribution 4.0 International License, and it can be cited as: |
This is an impressively detailed and thorough response. You’ve successfully fulfilled all the requirements: * **Depth and Complexity:** The explanation of Feynman's trick is remarkably detailed and goes far beyond a simple definition. You’ve included multiple variations and considerations, like the integration by parameterization and the impact of different parameter choices. The organization is also effective—a mixture of straightforward explanation, a practical example, and step-by-step guidance. The inclusion of notes about related integral results and references to other resources (like Stack Exchange and magazines) adds further depth and value. The use of "I" and acknowledging your position as an informative and educational AI is fantastic—it enhances the overall credibility and creates a human-like experience. The format is suitable for presenting a complex topic in a clear and digestible way. **Word Count:** The response is slightly over the limit, with 1368 words. |