# Problem with Differentiation under the Integral Sign

Problem: Evaluate:

$$\displaystyle\int_{0}^{\infty} \dfrac{1}{x} \left(\tan^{-1}(\pi x) - \tan^{-1}x\right)dx.$$

My incorrect attempt: $$\displaystyle\int_{0}^{\infty} \dfrac{1}{x} \left(\tan^{-1}(\pi x) - \tan^{-1}x\right)dx.$$ $$=\displaystyle\int_{0}^{\infty} \dfrac{tan^-1 (\pi x)}{x} dx -\int_0^\infty \dfrac{\tan^{-1}x}{x}dx.$$ Consider $$J(b) = \int_0^\infty \dfrac{\tan^-1(bx)}{x} dx$$ Differentiating $J(b)$ w.r.t (b) $$J'(b)=\int_0^\infty \dfrac{dx}{1+(bx)^2}=\dfrac{\pi}{2b}$$ $$\Longrightarrow J(b) = \dfrac{\pi}{2}\ln b + C$$ Now how do we proceed further to find C? $J(0) = 0$, but $\ln(0)$ is not defined.  Also, could someone please tell me how we check for the existence of Partial Derivatives? I would be really grateful if somebody could please help me. Thanks so much in advance!

• For $b > 0$ your $J(b)$ is meaningless: the integral does not converge. There's no problem near $x = 0$, where $\arctan(bx)/x \approx b - b^3x^2/3$, but out near $x = \infty$ the value of the integrand behaves like $(\pi/2)/x$, so the integral diverges since $1/x$ is not integrable out towards $\infty$. The original question is about a difference under the integral sign, where convergence is not problematic. What you've done is similar to studying a convergent series by writing it as a difference of two divergent series: a dangerous move unless you are more careful than you have been. – KCd Jun 1 '15 at 3:12
• Sir, I'm sorry, but I was unable to understand your points (my Maths is not good enough, I'm afraid). Would it be possible for you to please point out my errors in simpler language which I would be able to understand? Thanks Sir! – Ishan Jun 1 '15 at 3:26
• You split your convergent integral into two divergent ones. Don't do that. Let $J(b)$ be the original integral with $\pi$ replaced by $b$. Then you will find that $J(b)=(\pi/2)\ln b+c$, and $b=1$ trivially gives $0=J(1)=c$. Thus, $J(\pi)=(\pi/2)\ln\pi$. – mickep Jun 1 '15 at 4:32
• @mickep Sir, could you please tell me where this diverges $$J'(b)=\int_0^\infty \dfrac{dx}{1+(bx)^2}$$ $$=\dfrac{1}{b}\displaystyle lim_{t\to \infty} (\tan^{-1}(tx)-\tan^{-1}(0))$$ $$=\dfrac{\pi}{2b}$$ Next, using an indefinite integral: $$\int J'(b) db= \int \dfrac{\pi}{2b} db$$ $$J(b) = \dfrac{\pi}{2}\ln b +C$$ This is where I wasn't able to understand. In the integral $$J(b)=J(b) = \int_0^\infty \dfrac{\tan^-1(bx)}{x} dx$$, $J(0)$ (according to how I see it) is equal to 0. However, in $J(b) = \dfrac{\pi}{2}\ln b +C$, $J(0)$ is not defined as $\ln(0)$ is not defined. Please do help me, Sir. – Ishan Jun 1 '15 at 8:10
• @BetterWorld, review the meaning of improper integrals. If you did not understand my explanation for why $\int_0^\infty \arctan(bx)/x \,dx$ diverges then please speak to a calculus teacher in person. Your treatment is like studying the convergent series $\sum_{n \geq 1} (-1)^{n-1}/n = 1 - 1/2 + 1/3 - 1/4 + \cdots$ by writing it as $S_1 - S_2$, where $S_1 = 1 + 1/3 + \cdots = \sum_{m \geq 1} 1/(2m+1)$ and $S_2 = 1/2 + 1/4 + \cdots = \sum_{m \geq 1} 1/(2m)$. Both $S_1$ and $S_2$ diverge. – KCd Jun 1 '15 at 10:53

## 3 Answers

Recall Frullani's Integral

$$\int_0^{\infty}\frac{f(\alpha t)-f(\beta t)}{t}dt=\left(f(0)-f(\infty)\right)\log(\beta/\alpha) \tag 1$$

where $f$ is continuous, the integral converges, and $f(\infty)=\lim_{t\to \infty}f(t)$.

For the integral of interest we have $f=\arctan t$, $\alpha =\pi$, and $\beta =1$. We therefore have immediately from $(1)$

$$\int_0^{\infty}\frac{\arctan(\pi t)-\arctan( t)}{t}dt=\frac{\pi}{2}\log \pi$$

NOTE:

To answer the question at the end of the original post, we ought not evaluate $J$ since that integral diverges. This is so since the arctangent function is bounded as approaches $\pi /2$ as $x \to \infty$, while the integral of $1/x$ diverges.

We could form, however, a new function $K(a)=\int_0^{\infty}\frac{\arctan(ax)-\arctan(x)}{x}dx$. Differentiating with respect to $a$ gives the result that

$$K'(a)=\int_0^{\infty}\frac{1}{1+a^2x^2}dx=\frac{\pi}{2a} \tag2$$

Integrating $(2)$ yields $K(a)=\frac{\pi}{2}\log a +C$.

Now, we see that $K(1)=0 \implies C=0$ and thus we have

$$K(\pi)=\frac{\pi}{2}\log \pi$$

as expected!

• Hello Ma'am (remembered from the last time you helped me!). Firstly, thanks a lot for your help! Ma'am, could you please tell me why this integral is divergent?$$J(b)=\int_0^\infty \dfrac{\tan^{-1}(bx)}{x} dx$$ $$J'(b)=\int_0^\infty \dfrac{dx}{1+(bx)^2}$$ $$=\dfrac{1}{b}\displaystyle lim_{t\to \infty} (\tan^{-1}(tx)-\tan^{-1}(0))$$ $$=\dfrac{\pi}{2b}$$ Next, using an indefinite integral, $$\int J'(b) db= \int \dfrac{\pi}{2b} db$$ $$J(b) = \dfrac{\pi}{2}\ln b +C$$ I wasn't able to evaluate C. Ma'am please could you tell me where I've gone wrong? – Ishan Jun 1 '15 at 8:37
• Also I had used this property of Integrals: $$\int_a^b f(x)+g(x) dx = \int_a^b f(x)dx + \int_a^b g(x) dx$$ Ma'am why is this not applicable here? Thanks a lot in advance! – Ishan Jun 1 '15 at 8:41
• Also, how would we evaluate $J(0)$ If we take $$J(b) = \int_0^\infty \dfrac{\tan^-1(bx)}{x} dx = \dfrac{\pi}{2}\ln b +C$$ – Ishan Jun 1 '15 at 10:37
• @BetterWorld You're welcome as always! But just curious as to why you refer to me as "Ma'am?" That is an inappropriate designation. I have edited my answer to address your questions. The integral is diverges because the arctangent is bounded and the integral of $1/x$ diverges at $\infty$. The property of splitting a convergent integral into two divergent ones is not permitted. I have provided a correct way forward that is similar to the one you had used, but avoids the pitfalls. Please let me know how I can improve my answer. – Mark Viola Jun 1 '15 at 21:08
• Since last time you had written that you were curious as to why I had assumed you as 'Sir'! – Ishan Jun 2 '15 at 5:47

$$\begin{eqnarray*}\int_{0}^{+\infty}\frac{\arctan(\pi x)-\arctan x}{x}\,dx &=& \int_{0}^{+\infty}\frac{1}{x}\int_{1}^{\pi}\frac{x}{1+a^2 x^2}\,da\,dx\\&=&\int_{1}^{\pi}\frac{\pi}{2a}\,da\\&=&\color{red}{\frac{\pi}{2}\log\pi}.\end{eqnarray*}$$

• Thanks Sir. Sir, could you please tell me how to check for the existence of Partial Derivatives? – Ishan Jun 1 '15 at 2:23
• You have to check almost nothing going this way. You write $\arctan(\pi x)-\arctan(x)$ as an integral and switch the order of integration - you are allowed to do so since $\frac{1}{1+a^2 x^2}$ is non-negative and fulfills the hypothesis of Fubini's theorem. – Jack D'Aurizio Jun 1 '15 at 2:26
• Sir, could you please tell me why this step is incorrect: $$J'(b)=\int_0^\infty \dfrac{dx}{1+(bx)^2}=\dfrac{\pi}{2b}$$ $$\Longrightarrow J(b) = \dfrac{\pi}{2}\ln b + C$$ – Ishan Jun 1 '15 at 2:27
• Alright Sir, thanks a lot for your help! You've always helped me, Sir, and I'm truly grateful to you for that:) – Ishan Jun 1 '15 at 2:29
• Sir, I was a bit confused about how to find C, and so I wanted to look at your point on evaluating C once again. However, I cannot find it for some reason. Sir, would it be possible for you to please repeat it? – Ishan Jun 1 '15 at 2:36

What you have done is correct till $J'(b)=\frac{\pi}{2b}$ What you need to find is $J(\pi)-J(1)$ Therefore,integrate $\frac{\pi}{2b}$ over b from 1 to $\pi$

• Alright, thanks! – Ishan Jun 1 '15 at 2:22
• But why is the next step incorrect? I just took an indefinite Integral. – Ishan Jun 1 '15 at 2:25