11

So I'm computing the following integral: \begin{align} \int_0^1 \frac{\tan^{-1}(x)\ln(x)}{x}dx \end{align} I started out with a simple integration by parts which yielded: \begin{align} -\int_0^1 \frac{\ln^2(x)}{x^2 + 1}dx \end{align} A nifty substitution $x \to \frac{1}{x}$ and adding the new integral to the original gives: \begin{align} -\frac 12 \int_0^{\infty} \frac{\ln^2(x)}{x^2 + 1}dx \end{align} The integral now warrants a fairly obvious substitution $x \to \tan x$: \begin{align} -\frac 12 \int_0^{\frac{\pi}{2}}\ln^2(\tan x) dx \end{align} Which may be written as: \begin{align} -\frac 12 \frac{d^2}{ds^2} \left ( \int_0^{\frac{\pi}{2}} \tan^s (x)dx \right )_{s = 0} \end{align} Using the beta function yields: \begin{align} -\frac{\pi}{4} \frac{d^2}{ds^2} \left [ \sec \left ( \frac{\pi s}{2} \right ) \right ]_{s=0} = -\frac{\pi^3}{16} \end{align} However, Wolfram Alpha notes the answer to be $-\frac{\pi^3}{32}$, if the descrepancy has been noticed, I'd be grateful!

NEON
  • 526
  • For $0\le s<1$, could you explain a bit as to how we have $$ \int_0^{\frac{\pi}{2}} \ln^2(\tan{x})dx = \left. \frac{d^2}{ds^2}\left( \int_0^{\frac{\pi}{2}} (\tan{x})^sdx \right)\right|_{s=0}$$ There is nothing wrong here, I am just curious. @NEON – Sam May 20 '24 at 19:17
  • @Sam I'm sorry if it comes off as a move that lacks rigour, but I utilized the Liebnitz rule for integration: \begin{align} \frac{d}{dx}\int_{a(x)}^{b(x)} f(x, t) dt = b'(x)f(x, b(x)) - a'(x)f(x, a(x)) + \int_{a(x)}^{b(x)} \frac{\partial}{\partial x} f(x, t) dt \end{align} Since the bounds are constants, you're only left with the partial derivative of the integrand. – NEON May 20 '24 at 19:23
  • 1
    Mistake on $\int \frac{\ln x}{x} d x=\int \ln x d(\ln x)=\frac{\ln ^2 x}{2}+c$ – Lai May 21 '24 at 01:54

1 Answers1

15

Your integration by parts already yields an integral with value $\pi^3/16$, so we know that this step contains an error.

Indeed, the integration by parts should be $$u = \arctan x, \quad du = \frac{1}{x^2 + 1} \, dx, \\ dv = \frac{\log x}{x} \, dx, \quad v = \color{red}{\frac{1}{2}} \log^2 x.$$

You are simply missing the factor of $1/2$.

heropup
  • 143,828
  • Oh god, couldn't have been any stupider, thanks for this! – NEON May 20 '24 at 19:09
  • 6
    @NEON I myself have made this type of mistake many times, so I wouldn't feel too bad about it. In addition, the technique you used in the very next step introduced another factor of $1/2$, so it is entirely understandable that such an error would be difficult to spot. – heropup May 20 '24 at 19:14
  • 1
    It's good to emphaize the bug-finding strategy hinted at in this answer: numerically evaluate each expression along the way and see where the numbers don't match up—that narrows down the search for mistakes considerably! – Greg Martin May 21 '24 at 20:37