Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It can be shown by simple induction that $\dfrac{\mathrm d^n}{\mathrm dx^n}\left(\dfrac1{x}\right) = \dfrac{(-1)^n n!}{x^{n+1}}$.

But what about the nth integral of $\dfrac1{x}$? Finding the first few primitives, I can't discern a pattern.

share|cite|improve this question
The nth integral appears to be $\frac{x^{n-1}}{(n-1)!}\log x-(\text{something})\cdot x^{n-1}$, but I can't quite discern the (something) yet. – Isaac Dec 9 '10 at 1:46
The specific sequence of powers you get by repeatedly antidifferentiating in the way that I expect Isaac is doing is interesting. When written in lowest terms, the numerator of the coefficient of $x^{n-1}$ is the numerator of the $(n-1)$th Harmonic number (the $k$th Harmonic number is $H_k = \sum_{j=1}^k 1/j$). The sequence of denominators you get is not in the OEIS. – anon Dec 9 '10 at 1:56
You need to pick a lower bound or else "the integral" is only well-defined up to a constant, so the nth integral will only be well-defined up to a polynomial of degree n-1. – Qiaochu Yuan Dec 9 '10 at 2:16
up vote 29 down vote accepted

As Isaac noted, repeated integration seems to give the following pattern

$$ \frac{x^{n-1} \log x}{(n-1)!} - C_n x^{n-1}$$

Note that the value of $\displaystyle C_n$ does not really matter, as differentiating $n$ times nukes it. Also, note that, we can add any arbitrary $\displaystyle (n-1)^{th}$ degree polynomial to this, without changing the $\displaystyle n^{th}$ derivative.

In order to prove that the $\displaystyle n^{th}$ derivative of $\displaystyle \frac{x^{n-1} \log x}{(n-1)!}$ is $\displaystyle \frac{1}{x}$, we can use induction.

$$ \frac{1}{(n-1)!} \frac{d (x^{n-1} \log x)}{dx} = \frac{x^{n-2}}{(n-1)!} + \frac{x^{n-2} \log x}{(n-2)!}$$

Since adding an arbitrary $\displaystyle (n-2)^{th}$ degree polynomial does not change the $\displaystyle (n-1)^{th}$ derivative of $\displaystyle \frac{x^{n-2} \log x}{(n-2)!}$ we are done using induction.

Note that if $\displaystyle f(x)$ is another function such that $\displaystyle \frac{d^n f}{dx} = \frac{1}{x}$, then we have that $\displaystyle \phi(x) = f(x) - \frac{x^{n-1} \log x}{(n-1)!}$ has it's $\displaystyle n^{th}$ derivative to be zero, and hence it is a polynomial of degree $\displaystyle n-1$ or lower (can be proved using induction, again).

Thus all the functions you are looking for are of the form

$$\frac{x^{n-1} \log x}{(n-1)!} + \sum_{j=0}^{n-1} c_j x^j$$

where $\displaystyle c_j$ are arbitrary constants.

share|cite|improve this answer
That means the nth integral of $1/x$ is $\frac{x^{n-1}\log x}{(n-1)!}+$ an arbitrary polynomial of degree $n-1$ or less. – TCL Dec 9 '10 at 3:42
@TCL: Yes, although the answer does not explicitly claim that these are the only functions, it can be modified to do that, I suppose. – Aryabhata Dec 9 '10 at 3:43
@TCL: I have modified the answer with a proof sketch of that being all possible functions. – Aryabhata Dec 9 '10 at 3:49
Very nice, thank you. – TCM Dec 9 '10 at 21:30

If we use the repeated integral formula on the reciprocal function, with $1$ as the lower limit, we get

$$\begin{align*} \underbrace{\int_1^x\int_1^{t_{n-1}}\cdots\int_1^{t_1}}_{n} \frac1{t}\;\mathrm dt\cdots\mathrm dt_{n-2}\mathrm dt_{n-1}&=\frac1{(n-1)!}\int_1^x\frac{(x-t)^{n-1}}{t}\mathrm dt\\ &=(-1)^n \frac{x^{n-1}}{(n-1)!}B_{1-x}(n,1-n) \end{align*}$$

where $B_x(a,b)$ is the incomplete beta function.


$$g_n(x)=(-1)^n \frac{x^{n-1}}{(n-1)!}B_{1-x}(n,1-n)$$

the following more "elementary" representation can be derived:

$$g_n(x)=\frac{x^{n-1}}{(n-1)!}(\ln\,x-H_{n-1})-\sum_{j=1}^{n-1}\frac{(-1)^j}{j\cdot j!}\frac{x^{n-j-1}}{(n-j-1)!}$$

where $H_n=\sum\limits_{j=1}^n\frac1{j}$ is a harmonic number.

As Aryabhata mentions in his answer,

$$\frac{\mathrm d^n}{\mathrm dx^n}\left(\frac{x^{n-1}}{(n-1)!}\ln\;x+p_{n-1}(x)\right)=\frac1{x}$$

where $p_{n-1}(x)$ is any polynomial of degree $n-1$; $g_n(x)$, however, has the special property (by virtue of how it was constructed) that

$$\left.\frac{\mathrm d^k}{\mathrm dx^k}g_n(x)\right|_{x=1}=0\quad \text{if}\quad k < n$$

share|cite|improve this answer
Actually, it does not really matter what the coefficient of $x^{n-1}$ is , as adding an arbitrary $(n-1)^{th}$ degree polynomial won't change the derivative. – Aryabhata Dec 9 '10 at 3:33
@Mo: True, that. – J. M. Dec 9 '10 at 3:35
...and indulge me a little sidebar: the "repeated integral" formula generalizes to arbitrary complex values of $n$ (i.e. it's the Riemann-Liouville differintegral), but I had already done some simplification under the assumption that $n$ is an integer. – J. M. Dec 9 '10 at 3:38
Thank you... makes me want to smack myself for not being familiar with special functions. – TCM Dec 9 '10 at 21:28

We can solve this problem by the use of fractional derivatives.

$\forall q < 0$, using the Riemann Liouville formula and substituting $v = \frac{x-y}{x}$:

$$ \frac{d^q}{dx^q}\log x = \\ \frac{1}{\Gamma(-q)} \int_0^x \frac{\log (y)}{(x-y)^{q+1}}\, dy=\\ \frac{x^{-q} \log x}{\Gamma(-q)}\int_0^1 \frac{dv}{v^{q+1}} + \frac{x^{-q}}{\Gamma(-q)}\int_0^1 \frac{\log(1-v)}{v^{q+1}}\, dv $$

The first integral equals $-\frac{1}{q}$, while the second one is evaluated by parts:

$$\int_0^1 \frac{\log(1-v)}{v^{q+1}}\, dv = \\ \frac{1}{q} \int_0^1 \log(1-v)\,d(1-v^{-q}) = \\ \frac{\log(1-v^{-q}) \log(1-v)}{q}\big|_0^1 - \frac{1}{q} \int_0^1 \frac{1-v^{-q}}{1-v}\, dv = \\ \frac{\psi(1-q)+\gamma}{q} $$


$$\frac{d^q}{dx^q}\log x = \frac{x^{-q}}{\Gamma(1-q)}(\log x - \gamma - \psi(1-q))$$

Letting $q \mapsto -q$ and letting $q$ be an integer, and differentiating once we obtain:

$$\boxed{I^q \frac{1}{x} = \frac{x^{q-1}}{q!}\left(q\log x + q\sum_{n=1}^q \frac{1}{n}+1\right)+P_{n-1}(x)}$$

where $I^q$ represents the $q^{th}$ integral and $P_{n-1} (x)$ represents a polynomial of degree $n-1$. Note that the sum above is for the $n^{th}$ harmonic number.

Reference: The Fractional Calculus (Oldham & Spanier)

share|cite|improve this answer

Remembre that

$$\int \frac{1}{x} dx= \ln (x) + C $$ Now integrate again

Hint :
$\displaystyle\int \ln(x) dx = x \ln(x)-x +C$

share|cite|improve this answer
Well, I did. I've found that $I_{1} = \ln{x}+k, ~ I_{2} = x\left(\ln{x}-1\right), ~ I_{3} = 4x^2\left(2\ln(x)-3\right)$, etc. – TCM Dec 9 '10 at 1:47
@user4558 I have done the same, it would be nice to find a recurrence, I believe that exist – Bryan Yocks Dec 9 '10 at 1:52
@user4558 $I_{3}=\frac{x^2}{4}(2 \ln(x)-3)$ :) – Bryan Yocks Dec 9 '10 at 2:00
You are right, of course. That's what I meant to write. Thanks. :) – TCM Dec 9 '10 at 2:06

After replacing the variable x with t, the first step is to start the iterative integration at the log(t) rather than 1/t. The nth antiderivative of the natural logarithm is given by the following.

If $ n\geq 0\in \mathbb{Z}\land t>0\in \mathbb{R} $ then, $$ \displaystyle \log ^{(-n)}(t)=\frac{t^n}{(n!)^2}(n! \log (t)+\cos (n \pi ) S_{n+1}^{(2)}) $$

Proof, by induction on n.

Proposition at n:

$ \displaystyle \log ^{(-n)}(t)=\frac{\cos (n \pi ) S_{n+1}^{(2)} t^n}{(n!)^2}+\frac{t^n \log (t)}{n!} $

Proposition at n=0:

The Stirling number of the first kind term evaluates to zero, $ S_1^{(2)}=0 $ .

Substitute and simplify.

$ \displaystyle \log ^{(0)}(t)=0+\frac{t^0 \log (t)}{0!}=\log (t) $

Proposition at n+1: Integrate the proposition at n with suitable antiderivative limits.

$$ \displaystyle \int_0^t \log ^{(-n)}(u) \, du=\frac{\cos (n \pi ) S_{n+1}^{(2)}}{(n!)^2}\int_0^t u^n \, du+\frac{1}{n!}\int _0^tu^n \log (u)du $$

Evaluate the first integral.

$ \int_0^t \log ^{(-n)}(u) \, du=\log ^{(-(n+1))}(t)-\log ^{(-(n+1))}(0) $

If n>0, then the following is true.

$ \displaystyle \lim_{t\to 0} \, \log ^{(-n)}(t)=\log ^{(-n)}(0) $

$ \displaystyle \log ^{(-n)}(0)=\lim_{t\to 0} \, \left(\frac{\cos (n \pi ) S_{n+1}^{(2)} t^n}{(n!)^2}+\frac{t^n \log (t)}{n!}\right) $

$ \displaystyle \log ^{(-n)}(0)=\lim_{t\to 0} \, \frac{\cos (n \pi ) S_{n+1}^{(2)} t^n}{(n!)^2}+\lim_{t\to 0} \, \frac{t^n \log (t)}{n!} $

$ \displaystyle \log ^{(-n)}(0)=0+0 $

$ \displaystyle \log ^{(-(n+1))}(0)=0 $


$ \displaystyle \int_0^t \log ^{(-n)}(u) \, du=\log ^{(-(n+1))}(t) $

Evaluate the second integral.

$ \displaystyle \frac{\cos (n \pi ) S_{n+1}^{(2)}}{(n!)^2}\int_0^t u^n \, du=\frac{\cos (n \pi ) S_{n+1}^{(2)}}{(n!)^2} \frac{t^{n+1}}{(n+1)} $

Evaluate the third integral.

$ \displaystyle \frac{1}{n!}\int _0^tu^n \log (u)du=-\frac{t^{n+1}}{(n+1)^2 n!}+\frac{t^{n+1} \log (t)}{(n+1)!} $

Assemble the proposition at n+1 equation.

$ \displaystyle \log ^{(-(n+1))}(t)=\frac{\cos (n \pi ) S_{n+1}^{(2)}}{(n!)^2} \frac{t^{n+1}}{(n+1)}-\frac{t^{n+1}}{(n+1)^2 n!}+\frac{t^{n+1} \log (t)}{(n+1)!} $

Now the strategy is to show that the following is true.

$ \displaystyle \frac{\cos ((n+1)\pi ) S_{n+2}^{(2)} t^{n+1}}{((n+1)!)^2}=\frac{\cos (n \pi ) S_{n+1}^{(2)}}{(n!)^2} \frac{t^{n+1}}{(n+1)}-\frac{t^{n+1}}{(n+1)^2 n!} $

Simplify the preceding equation.

$ \displaystyle \frac{\cos ((n+1)\pi ) S_{n+2}^{(2)} t^{n+1}}{((n+1)!)^2}=\frac{\cos (n \pi ) S_{n+1}^{(2)}}{(n!)^2} \frac{(n+1) t^{n+1}}{(n+1)^2}-\frac{n! t^{n+1}}{(n+1)^2 (n!)^2} $

$ \displaystyle -\cos (n \pi ) S_{n+2}^{(2)}=\cos (n \pi ) S_{n+1}^{(2)} (n+1)-n! $

$ \displaystyle n! \cos (n \pi )= (n+1) S_{n+1}^{(2)}+S_{n+2}^{(2)} $

Utilize the following identities from the Digital Library of Mathematical Functions.

  • (1) $ \displaystyle \quad S_n^{(1)}=(-1)^{n-1} (n-1)!$
  • (2) $ \displaystyle \quad S_n^{(k)}=S_{n-1}^{(k-1)}-(n-1) S_{n-1}^{(k)}$

Shift and apply the first identity.

$ \displaystyle n=n+1 $

$ \displaystyle S_{n+1}^{(1)}=n! \cos (n \pi ) $

$ \displaystyle S_{n+1}^{(1)}=(n+1) S_{n+1}^{(2)}+S_{n+2}^{(2)} $

Shift, rearrange, and compare the second identity..

$ \displaystyle n=n+2 $

$ \displaystyle S_{n+2}^{(k)}=S_{n+1}^{(k-1)}-(n+1) S_{n+1}^{(k)} $

$ \displaystyle S_{n+1}^{(k-1)}=(n+1) S_{n+1}^{(k)}+S_{n+2}^{(k)} $

The proposition at n+1 is equivalent to the preceding identity with the variable k=2. Therefore, the proposition at n+1 is true. $ \displaystyle \Box $

Quite possibly for the first time in human history, we are now able to gaze upon the googolplexth antiderivative of the natural logarithm:)

$$ \displaystyle \frac{t^{10^{10^{100}}}}{\left(10^{10^{100}}!\right)^2} \left(10^{10^{100}}! \log (t)+S_{10^{10^{100}}+1}^{(2)} \cos \left(\pi 10^{10^{100}}\right)\right)+C $$

History: It's odd! I must have looked at this problem a zillion times before and never saw it. But this time the solution just fell out. I generated the following repeated integration table.

$ t^k \log (t)\\ \frac{t^{k+1} \log (t)}{k+1}-\frac{t^{k+1}}{(k+1)^2}\\ \frac{t^{k+2} \log (t)}{k^2+3 k+2}-\frac{(2 k+3) t^{k+2}}{(k+1)^2 (k+2)^2}\\ \frac{t^{k+3} \log (t)}{k^3+6 k^2+11 k+6}-\frac{\left(3 k^2+12 k+11\right) t^{k+3}}{(k+1)^2 (k+2)^2 (k+3)^2}\\ \frac{t^{k+4} \log (t)}{(k+1) (k+2) (k+3) (k+4)}-\frac{2 \left(2 k^3+15 k^2+35 k+25\right) t^{k+4}}{(k+1)^2 (k+2)^2 (k+3)^2 (k+4)^2}\\ \frac{t^{k+5} \log (t)}{(k+1) (k+2) (k+3) (k+4) (k+5)}-\frac{\left(5 k^4+60 k^3+255 k^2+450 k+274\right) t^{k+5}}{(k+1)^2 (k+2)^2 (k+3)^2 (k+4)^2 (k+5)^2}\\ \frac{t^{k+6} \log (t)}{(k+1) (k+2) (k+3) (k+4) (k+5) (k+6)}-\frac{\left(6 k^5+105 k^4+700 k^3+2205 k^2+3248 k+1764\right) t^{k+6}}{(k+1)^2 (k+2)^2 (k+3)^2 (k+4)^2 (k+5)^2 (k+6)^2}\\ \frac{t^{k+7} \log (t)}{(k+1) (k+2) (k+3) (k+4) (k+5) (k+6) (k+7)}-\frac{\left(7 k^6+168 k^5+1610 k^4+7840 k^3+20307 k^2+26264 k+13068\right) t^{k+7}}{(k+1)^2 (k+2)^2 (k+3)^2 (k+4)^2 (k+5)^2 (k+6)^2 (k+7)^2} $

I wondered if the Online Encyclopedia of Integer Sequences had any information on the following. $ \displaystyle \{7,168,1610,7840,20307,26264,13068\} $

At I found a formula for a Stirling Triangle. It was all downhill form there. I figured out a formula for the constant coefficient terms and let k goto zero.

In conclusion, here is a table of the first seven antiderivatives of the natural logarithm. $ \displaystyle \begin{array}{ll} \text{n} & \text{antiderivative} \\ \hline 0 & \log (t) \\ 1 & t (\log (t)-1) \\ 2 & t^2 \left(\frac{\log (t)}{2}-\frac{3}{4}\right) \\ 3 & t^3 \left(\frac{\log (t)}{6}-\frac{11}{36}\right) \\ 4 & t^4 \left(\frac{\log (t)}{24}-\frac{25}{288}\right) \\ 5 & t^5 \left(\frac{\log (t)}{120}-\frac{137}{7200}\right) \\ 6 & t^6 \left(\frac{\log (t)}{720}-\frac{49}{14400}\right) \\ 7 & t^7 \left(\frac{\log (t)}{5040}-\frac{121}{235200}\right) \end{array} $


share|cite|improve this answer
To simplify further, $\cos(n\pi)=(-1)^n$ for integer $n$. – J. M. Aug 26 '12 at 15:15

The $n^{th}$ integration of $ln(x)$ from $x$ to $1$ is equal to $\frac{x^{n}}{n!}(ln(x)-H_n)+\sum_{k=1}^{n}\frac{H_{n+k-1}}{(n+k-1)!}*\frac{x-1}{(k-1)!}.$

Where $H_{n}$ is the $n^{th}$ harmonic number.

The $x-1$ terms suggest that there is a function whose value at $1$ equals $\frac{H_{n}}{n!}$, derivative at $1=\frac{H_{n-1}}{(n-1)!}$, second derivative at $1=\frac{H_{n-2}}{(n-2)!}$,... ect. This is because the sum resembles the Taylor expansion at $a=1.$ Very interesting.

share|cite|improve this answer
(a) I suggest writing your answer in LaTeX, rather than plain text, see (b) It would be helpful if you could give some context (e.g. the definition of $H(n)$, how you derive the formula, etc. – Jonah Sinick Oct 28 '12 at 6:02
I derived the formula by doing the integrations and figuring out what the terms are. No real step 1, step 2,.. to give. – e2theipi2026 May 16 at 23:01
@e2theipi2026 Wow! An edit after almost 4 years! – Irregular User May 16 at 23:40
@Irregular User lol, I know. I haven't used the site since then. Hi I'm back! lol – e2theipi2026 May 16 at 23:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.