# An Involved Integral Series Calculation, Part 2

From the first post we know that the integral series for log(x) is f(x) = s1(x) + s2(x). And:

$s1(x) = log(x) * e^x$
$s2 = \sum_{k} H_n * \frac{x^n}{n!}$

s2 has the pattern of an exponential generating function because $\frac{x^n}{n!}$ part. The harmonic series is then the series that is generating our result. If we expand s2 by each power of x we can see what the harmonic series looks like in a generating function.

$s2 = 0 * \frac{x^0}{0!} + \frac{1}{1} * \frac{x^1}{1!} + (\frac{1}{1}+\frac{1}{2}) * \frac{x^2}{2!}$

A nice part of exponential generating functions is that taking the gf’s derivative just slides down the coefficient to one lower power.

$s2' = \frac{1}{1} * \frac{x^0}{0!} + (\frac{1}{1} + \frac{1}{2}) \frac{x^1}{1!}$

Each term of s2′ has one more reciprocal being summed than the same term in s2 itself. s2 for x^1 has 1/1, but s2′ has 1/1 + 1/2. For each term, the difference between s2′ – s2 is $[x^n] \frac{1}{n+1}$

So, replacing s2 with f to make differential equations easier, we have:

$f'(x) - f(x) = \sum_k \frac{1}{k+1} \frac{x^k}{k!}$

This is a pretty interesting and not immediately obvious sum. But:

$e^x = \sum_k \frac{x^k}{k!}$
$\frac{e^x - 1}{x} = \sum_k \frac{x^(k-1)}{k!}$
$\frac{e^x - 1}{x} = \sum_k \frac{1}{k} \frac{x^(k-1)}{(k-1)!}$

Which is just f’ – f with k shifted forward. Since we can’t use k = 0 anyway, we can make this shift to make the sum actually valid starting from 0. Which means:

$\sum_k \frac{1}{k+1} \frac{x^k}{k!} = \frac{e^x - 1}{x}$
$f'(x) - f(x) = \frac{e^x - 1}{x}$

$y'(x) + f(x) * y(x) = g(x)$
$g(x) = \frac{e^x - 1}{x}$

$f(x) = -1$
$\int 1 dx = x$
$y(x) = \frac{\int \frac{e^(2x) - e^x}{x}}{e^x}$

This integral does not have an elementary solution, but according to Wolfram Alpha it is Ei(2x) – Ei(x) where Ei is the Exponential Integral special function.

$s2 = \frac{Ei(2x) - Ei(x)}{e^x}$
$s1 = log(x) * e^x$

So the final answer is not clean or neat but there it is.

# An Involved Integral Series Calculation, pt. 1

I think a better name for the M and P summations I’ve been talking about would be integral series and differential series, in the same sense as geometric series, or any other kind.

I have been working on the calculations for the Integral Series of f(x)=log(x) over the past few weeks and it has been rather involved, but also interesting. I didn’t think I was going to find an explicit formula for the summation, but eventually I found a connection that I want to talk about here with generating functions.
It makes sense to talk about generating functions because they also have a lot of connections with derivatives and integrals. The Integral Series for log(x) leads to what turns out to be an exponential generating function, which is a sum of the form:
$\sum a_n \frac {x^n}{n!}$
But let me start at the beginning with the iterated integrals of log(x) themselves. Even figuring out what pattern the integrals have in the arbitrary case was pretty tricky.
When trying to figure out the integral of log(x), there is no simple rule to figure it out. You have to reason backwards from the derivative of log(x).
$\frac{D(log(x))}{dx} = \frac{1}{x}$ by definition of the logarithm.
This definition is interesting when you combine it with the product rule:
$\frac{D(x * log(x)}{dx} = x * \frac{1}{x} + 1 * log(x) = 1 + log(x)$
The derivative of x log(x) is very close to log(x), because the 1 / x and the x cancel in the left hand of the product rule, and the x when differentiated becomes 1 on the right side. From this derivative we can get the integral of log(x):
$f'(x * log(x)) = 1 + log(x)$
$f'(x * log(x)) - 1 = log(x)$
Using the fact that the derivative of a sum is the sum of the derivatives, and taking the integral of 1 wrt x, we can turn that into:
$f'(x * log(x) - x) = log(x)$
$x * log(x) - x = \int{log(x) dx}$
Then taking the 2nd integral, we have the first term which we will have to figure out, but the second term is just x, so that part is easy:
$\int \int{log(x) dx} = \int{x log(x) dx} - \frac{x^2}{2}$
The integral of x log(x) is not that different from log(x) itself:
$\frac{D(x^2 * log(x))}{dx} = x^2 * \frac{1}{x} + 2 x * log(x) = x + 2 x * log(x)$
$\int {x * log(x) dx} = \frac{1}{2} x^2 * log(x) - \frac{1}{4} x^2$
The clear pattern is all of the parts of the expression have the same power of x.
Generalizing:
$\int{x^{n} * log(x)} = \frac{1}{n+1} * x^{n+1} * log(x) - \frac{1}{(n+1)^2} x^{n+1}$
Applying this rule we will have an extra polynomial term with each integration of log(x), as well as the integrals of the previous polynomial terms:
Using the notation:  L(n) to denote the nth integral of log(x), here are a few of them.
$L(0) = log(x)$
$L(1) = x * log(x) - x$
$L(2) = \frac{1}{2} x^2 * log(x) - \frac{1}{2*2} x^2 - \frac{1}{2} x^2$
$L(3) = \frac{1}{2*3} x^3 * log(x) - \frac{1}{2*3*3} x^3 - \frac{1}{2*2*3} x^3 - \frac{1}{2*3} x^3$
Grouping the fractions in L(3) hints towards the pattern for L(n):
$L(3) = \frac{1}{1*2*3} x^3 * log(x) - \frac{1}{1*2*3} * (\frac{1}{3} + \frac{1}{2} + \frac{1}{1})$
The more terms you take the more messy it gets but the pattern in L(3) holds:
$L(n) = \frac{1}{n!} x^n * log(x) - x^n \frac{1}{n!} * \sum_{k=1}^{n} \frac{1}{k}$
Or:
$L(n) = \frac{x^n}{n!} (log(x) + H_n)$
The $H_n$ is called the nth harmonic number. It is simply the sum of the reciprocals of the first n integers.
So the Integral Series is:
$\sum_{n} \frac{x^n}{n!} (log(x) + H_n)$
So we have something to work with, but the fact that the sum has these Harmonic numbers in it makes things more complicated. In order simplify things, I broke apart the summation above into s1 and s2. You can’t always break up an infinite sum because the converge could be different, but it seems to have worked out this time.
$H(log(x)) = s1 + s2$
$s1 = \sum_{n} \frac{x^n * log(x)}{n!}$
$s2 = \sum_{n} \frac{H_n * x^n}{n!}$
So I just distributed out log(x) and H and separated the sum that way.
For s1, log(x) doesn’t depend on the summation variable n, so we can separate it as we would in an integral.
$s1 = \sum_{n} \frac{x^n * log(x)}{n!} = log(x) \sum_{n} \frac{x^n}{n!}$
But then the sum itself is simply e^x.
$s1 = log(x) * e^x$
I’ll be discussing the calculations for s2 next time. I went through a lot of deadends when analyzing s2, but the final solution isn’t too bad.

# Sum of Integrals, Derivatives

The M and P functions that I mentioned in “Higher Order Operators and Functions” are a lot more interesting that I expected.

First, a recap on the definition:

M(f(x)) = f(x) + $\int f(x) + \int \int f(x)$ + … (general antiderivatives here)
P(f(x)) = f(x) + f'(x) + f”(x) + f”'(x) +…
Originally I guessed that there is no function such that M(f(x)) and P(f(x)) converge, but I have found out how wrong I was.
For the simple function f(x) = x,
$M(f(x)) = \sum_{k=1}^{\infty} \frac{x^n}{n!}$ which is the Taylor series expansion for $e^x$ except the constant term.
P(x) = x + 0 + 0 … = x
So x is doubly-convergent.
For a general monomial a x^b we multiply the monomial by a term k so that it has the form:
$\frac{1}{b!} x^b$ which matches the taylor series form.$k = \frac{1}{a*b!}$
$M(a x^b) = k (\sum_{i = 0}^{\infty} x^i - \sum_{i = 0}^{b-1} x^i)$
$M(a x^b) = k e^x - k (\sum_{i = 0}^{b-1} x^i)$
Which is convergent. And we showed before that all polynomials are P convergent.
Integration is distributive over addition, so we can add the above expression for each term of a polynomial together to get a combined M(p(x)) for any polynomial. All polynomials are doubly convergent then.
Because integration and differentiation are distributive over addition, the M and P functions are also distributive (modulo some technical difficulties that may occur re: convergence).
An example polynomial:
$M(x + x^3) = M(x) + M(x^3) = e^x + 6 M(\frac{1}{6} x^3)$
$M(x + x^3) = 7 * e^x - 3 x^2 - 6 x - 6$
Rationals:
f(x) = 1 / x is P convergent, but the value and convergence status of  M(1 / x) is unknown.
$P(\frac{1}{x}) = \sum_{k=0}^{\infty} \frac{-1^k}{x^(k+1)}$
$P(\frac{1}{x}) = \frac{e^(- \frac{1}{x})}{x}$