TITLE: What's the nth integral of $\frac1{x}$?
QUESTION [29 upvotes]: 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.

REPLY [4 votes]: 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}
$$
Then 
$$\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)