# Integrate $\ln (x)$ without integration by parts

I know with integration by parts the answer is $$x\ln(x) - x$$ but I was wondering how to do this without integration by parts.

• What do you mean by 'without integration by parts'? One way would be to differentiate $x\ln(x)-x$ and see that you get $\ln(x)$; you haven't technically used integration by parts, all you've used is the fundamental theorem of calculus and the product rule (but that's all IBP is anyway, just more generally). – Clive Newstead Jul 13 '19 at 12:21
• I think there is no other way. The inspiration of the integration by parts is precisely to be able to integrate this type of functions. – azif00 Jul 13 '19 at 12:23
• Is there any motivation to avoid integration by parts in such cases ? – Peter Jul 13 '19 at 12:40
• $$\int\ln(x)dx = \int\big[\ln x + 1 - 1\big]dx = \int(\ln x +1 )dx - \int dx = \int d(x\ln x ) -\int dx = x\ln x - x+c$$ which is almost the same as my previous comment and @Michael's answer. – Ak19 Jul 13 '19 at 12:46

In order to prove $$\int \log x \, \mathrm{d}x = x \log x - x + \mathsf{C}$$, it suffices to show that

$$\int_{1}^{x} \log t \, \mathrm{d}t = x \log x - x + 1.$$

We establish this with different methods, avoiding integration by parts technique and 'guessing the antiderivative' strategy.

Method 1. Assume $$a \geq 1$$. Then by Fubini's theorem,

\begin{align*} \int_{1}^{a} \log x \, \mathrm{d}x &= \int_{1}^{a} \int_{1}^{x} \frac{1}{t} \, \mathrm{d}t\mathrm{d}x \\ &= \int_{1}^{a} \int_{t}^{a} \frac{1}{t} \, \mathrm{d}x\mathrm{d}t \\ &= \int_{1}^{a} \left( \frac{a}{t} - 1 \right) \, \mathrm{d}t \\ &= a \log a - a + 1 \end{align*}

Similar computation shows that the above result continues to hold for $$0 < a < 1$$.

(In reality, however, this computation still bears the flavor of integration-by-parts technique.)

Method 2. (Regularizing) It can be shown that $$(x^{\epsilon} - 1)/\epsilon$$ converges uniformly to $$\log x$$ as $$\epsilon \to 0^+$$ on any compact subset of $$(0, \infty)$$. Then

$$\int_{1}^{x} \log t \, \mathrm{d}t = \lim_{\epsilon \to 0^+} \int_{1}^{x} \frac{t^{\epsilon} - 1}{\epsilon} \, \mathrm{d}t = \lim_{\epsilon \to 0^+} \left( \frac{x^{\epsilon+1}-1}{\epsilon(\epsilon+1)} - \frac{x-1}{\epsilon} \right) = x\log x - x + 1.$$

Method 3. (Solving functional equation) Define the function $$f : (0, \infty) \to \mathbb{R}$$ by $$f(x) = \int_{1}^{x} \log t \, \mathrm{d}t$$. Then for $$a, b > 0$$,

\begin{align*} f(ab) &= \int_{1}^{a} \log t \, \mathrm{d}t + \int_{a}^{ab} \log t \, \mathrm{d}t \\ &= \int_{1}^{a} \log t \, \mathrm{d}t + \int_{1}^{b} a \log (as) \, \mathrm{d}s \tag{t = as}\\ &= f(a) + a(b-1) \log a + a f(b). \end{align*}

By switching the role of $$a$$ and $$b$$, we also get $$f(ab) = f(b) + b(a-1)\log b + bf(a)$$, and so,

$$f(a) + a(b-1)\log a + af(b) = f(b) + b(a-1)\log b + b f(a).$$

Rearranging the identity, for $$a, b \neq 1$$ we get

$$\frac{f(a) - a\log a}{a-1} = \frac{f(b) - b\log b}{b-1}.$$

The right-hand side can be further simplified, using $$f(1) = 0$$ あand $$\log 1 = 0$$, as

$$= \frac{f(b) - f(1)}{b-1} - \frac{\log b - \log 1}{b-1} - \log b.$$

Together with $$f'(1) = \log 1 = 0$$ and $$(\log x)'|_{x=1} = 1$$, this converges to $$-1$$ as $$b \to 1$$. So it follows that

$$f(a) = a \log a - (a - 1).$$

• The last method contains in the last step the derivative of $b\log(b)$, which amounts to the same application of product rule/IBP that the OP wanted to avoid. – Lutz Lehmann Jul 13 '19 at 13:44
• @LutzL, I fixed Method 3 a bit so that it now bypasses the use of product rule by simple algebraic manipulation. – Sangchul Lee Jul 13 '19 at 14:09
• Could you eliminate the need to differentiate at all if you observe that $h(a)=h(b)$ for all $a,b> 1$ means that $h$ is constant and then insert $f(a)=a\ln(a)+k(a-1)$ back into the first equation for $f$ to determine the constant? – Lutz Lehmann Jul 13 '19 at 14:23
• @LutzL, That was actually my first attempt, but unfortunately we can check that any $f(x)=x\log x+k(x-1)$ solves the original functional equation. So the equation alone cannot uniquely determines $f$, and we need extra conditions that should follow from the original definition of $f$. – Sangchul Lee Jul 13 '19 at 14:28
• @Sangchul Lee I think the best way it's just to calculate $(x\ln{x}-x)'$. If you'll see don-votes it's not main. – Michael Rozenberg Jul 13 '19 at 14:43

Compute it via the Riemann sums over the subdivision $$x_k=aq^k$$ with $$x_N=aq^N=b$$. Then \begin{align} \int_a^b\ln(x)dx=\lim_{N\to\infty}\sum_{n=0}^{N-1}(\ln(a)+n\ln(q))aq^n(q-1) \end{align} and using the sum formulas for geometric sums $$\sum_{n=0}^{N-1}q^n=\frac{q^N-1}{q-1}$$ and $$\sum_{n=0}^{N-1}nq^n=\frac{q-Nq^N+(N-1)q^{N+1}}{(q-1)^2}$$ we get \begin{align} \sum_{n=0}^{N-1}(\ln(a)+n\ln(q))aq^n(q-1) &=a(q^N-1)\ln(a)+a\frac{q-Nq^N+(N-1)q^{N+1}}{q-1}\ln(q) \\ &=(b-a)\ln(a)+\frac{qa-Nb+(N-1)qb}{q-1}\ln(q) \\ &=b(\ln(a)+N\ln(q))-a\ln(a)+\frac{q(a-b)}{q-1}\ln(q) \\ &=b\ln(b)-a\ln(a)-q(b-a)\frac{\ln(q)-\ln(1)}{q-1} \end{align}

Now for $$N\to\infty$$ we get $$q\to 1$$ and thus $$\ln(q)\to0$$, and in the last term the difference quotient converges to the derivative $$1$$ in $$q=1$$, so that $$\int_a^b\ln(x)\,dx=b\ln(b)-a\ln(a)-(b-a)$$ remains.

• I like this method! (+1) – Sangchul Lee Jul 13 '19 at 13:29

Graph $$y=\ln x$$. The area under the curve from $$x=1$$ to $$x=x_0$$ is an anti-derivative of $$\ln x_0$$.

Make the rectangle with base on the $$x$$-axis from $$x=0$$ to $$x=x_0$$ and height equal to $$\ln x_0$$. The area you want is $$x_0 \ln x_0$$ minus the area above the curve and inside the rectangle. That is:

$$\int_1^{x_0} \ln x \; dx = x_0\ln x_0 - \int_0^{\ln x_0} e^y \; dy.$$

Recall that $$\ln x$$ is the inverse of the function $$e^x$$. We have the following identity for the integrals of inverse functions:

$$\int f^{-1}(x)\,dx=xf^{-1}(x)-F\circ f^{-1}(x)+C,$$

where $$F$$ is the antiderivative of $$f$$, not $$f^{-1}$$. Using this, we obtain the integral of $$\ln x$$ very easily:

$$\int\ln x\,dx=x\ln x-e^{\ln x}+C=x\ln x-x+C$$

• This formula to integrate the inverse function is obtained precisely with integration by parts. – azif00 Jul 13 '19 at 12:29
• @Zacky Using (math.stackexchange.com/q/701345) there is a method to show that the identity holds that only uses the product rule for differentiation, not integration by parts – csch2 Jul 13 '19 at 12:30
• Not necessarily with IBP "openly", as you can check here: en.wikipedia.org/wiki/Integral_of_inverse_functions Yet it is true that this is way more involved than simple IBP...This is what I was writing when the answer popped up. +1 – DonAntonio Jul 13 '19 at 12:30
• But the product rule for differentiation is precisely equivalent to IBP. – David C. Ullrich Jul 13 '19 at 12:32
• @DavidC.Ullrich And that's an excellent way to justify its introduction as a very basic technique. Still, it seems to be the OP wants otherwise. – DonAntonio Jul 13 '19 at 12:33

Hint:

Try writing the Taylor series expansion of $$\ln(x)$$ at $$x=1$$ (this involves two cases), integrate it and then compare it with the Taylor series expansion of $$x\ln(x)-x$$.

PS: But to think of this tricky solution, it is very important to know the answer already (which really doesn't makes sense). Therefore, its always better to use a hammer for a nail instead of using an axe.

Integrate the power series:

\begin{align} \int \log x\, dx &= \int \sum_{i=1}^{\infty} (-1)^{i+1} \frac{(x-1)^i}{i} \\ &= \sum_{i=1}^{\infty} (-1)^{i+1} \int \frac{(x-1)^i}{i} \\ &= \sum_{i=1}^{\infty} (-1)^{i+1} \frac{(x-1)^{i+1}}{i(i+1)} \\ &= (x-1)\sum_{i=1}^{\infty} (-1)^{i+1} \frac{(x-1)^i}{i(i+1)} \\ &= (x-1)\sum_{i=1}^{\infty} (-1)^{i+1} \Big(\frac{(x-1)^i}{i} - \frac{(x-1)^i}{i+1} \Big)\\ &= (x-1) \log x - \sum_{i=2}^{\infty} (-1)^{i} \frac{(x-1)^{i}}{i} \\ &= (x-1)\log x + (\log x - x+1) \\ &= x \log x-x + C. \end{align}

$$\dfrac{d(x^m\ln x)}{dx}=x^{m-1}+mx^{m-1}\ln x$$

$$\implies x^m\ln x=\int x^{m-1}\ dx+m\int(x^{m-1}\ln x)dx$$

Set $$m=1$$

• To repeat a comment from another answer: But the product rule for differentiation is precisely equivalent to IBP, just putting it under integral signs. So what you wrote is exactly the method of partial integration. – Lutz Lehmann Jul 13 '19 at 13:39

Just calculate $$\left(x\ln{x}-x\right)'.$$

• So what, and how did he find this result? You can do that only if you already know the result or you assume what should it be. – Aqua Jul 13 '19 at 13:46
• So, this does not answer the question then? – nth Jul 13 '19 at 13:51