# Restate Feynman’s “Great Identity”

In a letter dated July 7, 1948, Richard Feynman, a Nobel laureate in physics (1965) made a claim:

I am the possessor of a swanky new scheme to do each problem in terms of one with one less energy denominator. It is based on the great identity $\frac{1}{ab} = \int \limits_{0}^{1} \frac{1}{(ax+b(1-x))^2}\;dx$.

(The Beat of a Different Drum: The Life and Science of Richard Feynman, by Jagdish Mehra, page 262)

Assuming non-zero constants $a, b$ are both real but otherwise arbitrary, let’s check the validity of Feynman’s “great identity”.

If $a \ne b$,

$\int \frac{1}{(ax+b(1-x))^2}\;dx$

$= \int \frac{1}{((a-b)x+b)^2}\;dx$

$= \int \frac{1}{a-b}\cdot \frac{a-b}{((a-b)x+b)^2}\;dx$

$= \frac{1}{a-b}\int \frac{((a-b)x+b)'}{((a-b)x+b)^2}\;dx$

$= \frac{1}{a-b}\cdot \frac{-1}{(a-b)x+b}$.

Using Leibniz’s rule,

$\int\limits_{0}^{1}\frac{1}{(ax+b(1-x))^2}\;dx = \frac{1}{a-b}\cdot\frac{-1}{(a-b)x+b}\bigg| _{0}^{1} =\frac{1}{a-b}(\frac{-1}{a}-\frac{-1}{b})=\frac{1}{ab}$.

When $a=b$,

$\int \frac{1}{(ax+b(1-x))^2}\;dx = \int \frac{1}{b^2}\;dx =\frac{1}{b^2}x$

and,

$\int \limits_{0}^{1}\frac{1}{(ax+b(1-x))^2}\;dx = \frac{1}{b^2}x\bigg|_{0}^{1} = \frac{1}{b^2}=\frac{1}{ab}$.

All is as Feynman claimed:

$\int\limits_{0}^{1}\frac{1}{(ax+b(1-x))^2}\;dx = \frac{1}{ab}\quad\quad\quad(\star)$

There is something amiss:

If $a$ and $b$ have opposite signs i.e., $ab<0$ then the right hand side of ($\star$) is negative. But the integrand is squared so the integral on the left hand side of ($\star$) is never negative, no matter what $a$ and $b$ may be.

Let’s figure it out !

In its full glory, Leibniz’s rule we used to obtain $(\star)$ is

If the real-valued function $F$ on an open interval $I$ in $R$ has the continuous derivative $f$ and $a, b \in I$ then $\int\limits_{a}^{b} f(x)\; dx = F(b)-F(a)$.

Essentially, the rule requires the integrand $f$ to be a continuous function on an open interval that contains $a$ and $b$.

Solving $ax+b(1-x)=0$ for $x$ yields

$x = \frac{b}{b-a}$,

the singularity of integrand $\frac{1}{(ax+(1-x))^2}$ in $(\star)$.

For $ab<0$, we consider the following two cases:

Case (1-1) $(a>0, b<0) \implies (a>0, b<0, b-a<0)\implies (\frac{b}{b-a}>0$,

$\frac{b}{b-a} = \frac{b-a+a}{b-a} = 1+\frac{a}{b-a}<1)\implies 0<\frac{b}{b-a}<1$

Case (1-2) $(a<0, b>0) \implies (a<0, b>0, b-a>0) \implies (\frac{b}{b-a}>0$,

$\frac{b}{b-a} = \frac{b-a+a}{b-a} = 1+\frac{a}{b-a}<1) \implies 0<\frac{b}{b-a}<1$

From both cases, we see that

when $ab<0, \frac{1}{(ax+b(1-x))^2}$ has a singularity in $(0, 1) \implies \frac{1}{(ax+b(1-x))^2}$ is not continuous in $(0, 1)$.

Applying Leibniz’s rule to $\int\limits_{0}^{1} \frac{1}{(ax+b(1-x))^2}\;dx$ regardless of integrand’s singularity thus ensured an outcome of absurdity.

However, $ab>0$ paints a different picture.

We have

Case (2-0) $a=b \implies \frac{1}{(ax+b(1-x))^2}=\frac{1}{b^2} \implies$ no singularity

Case (2-1) $(a>b, a>0, b>0) \implies (b-a<0, a>0, b>0) \implies \frac{b}{b-a}<0$

Case (2-2) $(a0, b>0) \implies (b-a>0, a>0, b>0)$

$\implies \frac{b}{b-a} = \frac{b-a+a}{b-a}=1+\frac{a}{b-a}>1$

Case (2-3) $(a>b, a<0, b<0) \implies (b-a<0, a<0, b<0) \implies \frac{b}{b-a}=1+\frac{a}{b-a}>1$

Case (2-4) $(a0, a<0, b<0) \implies \frac{b}{b-a} <0$

All cases show that when $ab>0$, the integrand has no singularity in $(0,1)$.

It means that $\frac{1}{(ax+b(1-x))^2}$ is continuous in $(0, 1)$ and therefore, Leibniz’s rule applies.

So let’s restate Feynman’s “great identity”:

$a\cdot b > 0 \iff \frac{1}{ab} = \int\limits_{0}^{1}\frac{1}{(ax+b(1-x))^2}\;dx$

Exercise-1 Evaluate $\int\limits_{0}^{1}\frac{1}{(ax+b(1-x))^2}\;dx$ using Omega CAS Explorer. For example,

(hint : for $ab>0$, specify $a > b$ or $b>a$)

# Oh! Matryoshka!

Given polynomial $f(x) = a_0 + a_1 x+a_2 x^2 + ... + a_{n-1}x^{n-1}+a_n x^n$, we wish to evaluate integral

$\int \frac{f(x)}{(x-a)^p}\;dx, \quad p \in N^+\quad\quad\quad(1)$

When $p = 1$,

$\int \frac{f(x)}{x-a} \;dx= \int \frac{f(x)-f(a)+f(a)}{x-a}\;dx$

$= \int \frac{f(x)-f(a)}{x-a}\;dx + \int \frac{f(a)}{x-a}\;dx$

$=\int \frac{f(x)-f(a)}{x-a}\;dx + f(a)\cdot \log(x-a)$.

Since

$f(x) = a_0 + a_1x + a_2x^2 + ... + a_{n-1}x^{n-1} + a_n x^n$

and

$f(a) = a_0 + a_1 a + a_2 a^2 + ... + a_{n-1}a^{n-1} + a_n a^n$

It follows that

$f(x)-f(a) = a_1(x-a) + a_2(x^2-a^2) + ... + a_{n-1}(x^{n-1}-a^{n-1}) + a_n (x^n-a^n)$.

That is

$f(x)-f(a) = \sum\limits_{k=1}^{n}a_k(x^k-a^k)$

By the fact (see “Every dog has its day“) that

$x^k-a^k =(x-a)\sum\limits_{i=1}^{k}x^{k-i}a^{i-1}$,

we have

$f(x)-f(a) = \sum\limits_{k=1}^{n}a_k(x-a)\sum\limits_{i=1}^{k}x^{k-i}a^{i-1}=(x-a)\sum\limits_{k=1}^{n}(a_k\sum\limits_{i=1}^{k}x^{k-i}a^{i-1})$

or,

$\frac{f(x)-f(a)}{x-a}= \sum\limits_{k=1}^{n}(a_k\sum\limits_{i=1}^{k}x^{k-i}a^{i-1})\quad\quad\quad(2)$

Hence,

$\int\frac{f(x)}{x-a}\;dx = \int \sum\limits_{k=1}^{n}(a_k \sum\limits_{i=1}^{k}x^{k-i}a^{i-1})\;dx + f(a)\log(x-a)$

$=\sum\limits_{k=1}^{n}(a_k \sum\limits_{i=1}^{k}\int x^{k-i}a^{i-1}\; dx)+ f(a)\log(x-a)$

i.e.,

$\int \frac{f(x)}{x-a} = \sum\limits_{k=1}^{n}(a_k\sum\limits_{i=1}^{k}\frac{x^{k-i+1}}{k-i+1}a^{i-1})+ f(a)\log(x-a)$

Let us now consider the case when $p>1$:

$\int \frac{f(x)}{(x-a)^p}\; dx$

$=\int \frac{f(x)-f(a)+f(a)}{(x-a)^p}\;dx$

$=\int \frac{f(x)-f(a)}{(x-a)^p} + \frac{f(a)}{(x-a)^p}\;dx$

$=\int \frac{f(x)-f(a)}{(x-a)}\cdot\frac{1}{(x-a)^{p-1}} + \frac{f(a)}{(x-a)^p}\;dx$

$= \int \frac{f(x)-f(a)}{x-a}\cdot\frac{1}{(x-a)^{p-1}}\;dx + \int\frac{f(a)}{(x-a)^p}\; dx$

$\overset{(2)}{=}\int \frac{g(x)}{(x-a)^{p-1}}\;dx + \frac{f(a)(x-a)^{1-p}}{1-p}$

where

$g(x) = \frac{f(x)-f(a)}{x-a}=\sum\limits_{k=1}^{n}(a_k\sum\limits_{i=1}^{k}x^{k-i}a^{i-1})$, a polynomial of order $n-1$.

What emerges from the two cases of $p$ is a recursive algorithm for evaluating (1):

Given polynomial $f(x) = \sum\limits_{k=0}^{n} a_k x^k$,

$\int \frac{f(x)}{(x-a)^p} \;dx, \; p \in N^+= \begin{cases}p=1: \sum\limits_{k=1}^{n}(a_k\sum\limits_{i=1}^{k}\frac{x^{k-i+1}}{k-i+1}a^{i-1})+ f(a)\log(x-a) \\p>1: \int \frac{g(x)}{(x-a)^{p-1}}\;dx + \frac{f(a)(x-a)^{1-p}}{1-p}, \\ \quad\quad\quad g(x) = \frac{f(x)-f(a)}{x-a}=\sum\limits_{k=1}^{n}(a_k\sum\limits_{i=1}^{k}x^{k-i}a^{i-1}). \end{cases}$

Exercise-1 Optimize the above recursive algorithm (hint: examine how it handles the case when $f(x)=0$)

# Integration of Trigonometric Expressions

We will introduce an algorithm for obtaining indefinite integrals such as

$\int \frac{(1+\sin(x))}{\sin(x)(1+\cos(x))}\;dx$

or, in general, integral of the form

$\int R(\sin(x), \cos(x))\;dx\quad\quad\quad(1)$

where $R$ is any rational function $R(p, q)$, with $p=\sin(x), q=\cos(x)$.

Let

$t = \tan(\frac{x}{2})\quad\quad(2)$

Solving (2) for $x$, we have

$x = 2\cdot\arctan(t)\quad\quad\quad(3)$

which provides

$\frac{dx}{dt} = \frac{2}{1+t^2}\quad\quad\quad(4)$

and,

$\sin(x) =2\sin(\frac{x}{2})\cos(\frac{x}{2})\overset{\cos^(\frac{x}{2})+\sin^2(\frac{x}{2})=1}{=}\frac{2\sin(\frac{x}{2})\cos(\frac{x}{2})}{\cos^2(\frac{x}{2})+\sin^2(\frac{x}{2})}=\frac{2\frac{\sin(\frac{x}{2})}{\cos(\frac{x}{2})}}{1+\frac{\sin^2(\frac{x}{2})}{\cos^2(\frac{x}{2})}}=\frac{2\tan(\frac{x}{2})}{1+\tan^2(\frac{x}{2})}$

yields

$\sin(x) = \frac{2 t}{1+t^2}\quad\quad\quad(5)$

Similarly,

$\cos(x) = \cos^2(\frac{x}{2})-\sin^2(\frac{x}{2})=\frac{\cos^2(\frac{x}{2})-\sin^2(\frac{x}{2})}{\cos^2(\frac{x}{2})+\sin^2(\frac{x}{2})}=\frac{1+\frac{\sin^2(\frac{x}{2})}{\cos^2(\frac{x}{2})}}{1+\frac{\sin^2(\frac{x}{2})}{\cos^2(\frac{x}{2})}}=\frac{1-\tan^2(\frac{x}{2})}{1+\tan^2(\frac{x}{2})}$

gives

$\cos(x)=\frac{1-t^2}{1+t^2}\quad\quad\quad(6)$

We also have (see “Finding Indefinite Integrals” )

$\int f(x)\;dx \overset{x=\phi(t)}{=} \int f(\phi(t))\cdot\frac{d\phi(t)}{dt}\;dt$.

Hence

$\int R(\cos(x), \sin(x))\;dx \overset{(2), (4), (5), (6)}{=} \int R(\frac{1-t^2}{1+t^2}, \frac{2t}{1+t^2})\cdot\frac{2}{1+t^2}\;dt$,

and (1) is reduced to an integral of rational functions in $t$.

Example-1 Evaluate $\int \csc(x)\;dx$.

Solution: $\csc(x) = \frac{1}{\sin(x)}\implies \int \csc(x)\;dx = \int \frac{1}{\sin(x)}\;dx$

$= \int \frac{1}{\frac{2t}{1+t^2}}\cdot\frac{2}{1+t^2}\;dt=\int\frac{1}{t}\;dt = \log(t) = \log(\tan(\frac{x}{2}))$.

Example-2 Evaluate $\int \sec(x)\;dx$.

Solution: $\sec(x) = \frac{1}{\cos(x)}\implies \int \sec(x)\; dx =\int \frac{1}{\cos(x)}\;dx$

$= \int \frac{1}{\frac{1-t^2}{1+t^2}}\cdot \frac{2}{1+t^2}\; dt=\int \frac{2}{1-t^2}\;dt=\int \frac{2}{(1+t)(1-t)}\;dt=\int \frac{1}{1+t} + \frac{1}{1-t}\;dt$

$=\int \frac{1}{1+t}\;dt - \int \frac{-1}{1-t}\;dt$

$=\log(1+t) -\log(1-t) =\log\frac{1+t}{1-t}=\log(\frac{1+\tan(\frac{x}{2})}{1-\tan(\frac{x}{2})})$.

According to CAS (see Fig. 1),

Fig. 1

However, the two results are equivalent as a CAS-aided verification (see Fig. 2) confirms their difference is a constant (see Corollary 2 in “Sprint to FTC“).

Fig. 2

Exercise-1 According to CAS,

Show that it is equivalent to the result obtained in Example-1

Exercise-2 Try

$\int \frac{1}{\sin(x)+1}\;dx$

$\int \frac{1}{\sin(x)+\cos(x)}\;dx$

$\int \frac{1}{(2+\cos(x))\sin(x)}\;dx$

$\int \frac{1}{5+4\sin(x)}\;dx$

$\int \frac{1}{2\sin(x)-\cos(x)+5}\;dx$

and of course,

$\int \frac{1+\sin(x)}{\sin(x)(1+\cos(x))}\;dx$