9

Let $n_k$ be integers. Is there a general formula for the Taylor expansion of $\log(1+\sum_{k=1}^N n_kx^k)$ at $x=0$? This boils down to find an expression for the $m$th derivative of $\log(1+\sum_{k=1}^N n_kx^k)$ evaluated $x=0$: $$ \frac{d^m}{dx^m}\log(1+\sum_{k=1}^N n_kx^k)\Biggr|_{x=0}? $$

Expanding a (work-in-progress) example like $-\log(n_3x^3+n_2x^2+n_1x+1)$ gives: $$ \begin{array}{cl} x& (- n_1)\\ + \frac{x^2}2& (+ n_1^2 - 2n_2 ) \\ + \frac{x^3}3& (- n_1^3 + 3n_2 n_1 - 3n_3) \\ + \frac{x^4}4& (+ n_1^4 - 4n_2 n_1^2 + 4n_3 n_1 + 2n_2^2 ) \\ + \frac{x^5}5& (- n_1^5 + 5n_2 n_1^3 - 5n_3n_1^2 - 5n_2^2 n_1 + 5n_3n_2 ) \\ + \frac{x^6}6& (+ n_1^6 - 6n_2 n_1^4 + 6n_3n_1^3 + 9n_2^2n_1^2 - 12n_3n_2n_1 - 2n_2^3 +3 n_3^2 ) \\ &\dots \end{array} $$

Some findings:

  • For each $\frac{x^k}k$ the factor in brackets relates to partitions of $k$, which is not very surprising.

  • Fixing $k$ then the sign is a term inside a bracket can be determined by the sum of powers of $n_j$: Even sums are negative (e.g. $-n_1^4$) and odd sums positive (e.g. $+5n_2^2n_1$), which reminds me on Möbius' function...

  • From one line to the other you can see that multiplying a $n_1$ to the second term adds $1$ to the prefactor (and changes sign)

This looks like a combinatorial thing...

Tom Copeland
  • 2,416
draks ...
  • 18,449
  • Naturally, the first derivative is $P'(x)/P(x)$ where $P(x)=1+\sum\limits_kn_kx^k$ hence, if the roots $x_j$ of $P$ are distinct, $$\frac1{P(x)}=\sum_j\frac1{P'(x_j)(x-x_j)}=-\sum_j\sum_k\frac{x^k}{P'(x_j)x_j^{k+1}}=-\sum_k\left(\sum_j\frac{1}{P'(x_j)x_j^{k+1}}\right)x^k$$ Since $$P'(x)=\sum_k(k+1)n_{k+1}x^k$$ the expansion of $P'(x)/P(x)$ follows. – Did Apr 11 '17 at 06:48
  • @Did I see, thanks, but doesn't this get pretty messy? A general formula for the individual prefactors seems out of range when I multiply the two infinite expressions... – draks ... Apr 11 '17 at 20:06
  • @Did isn't your second expansion in the first line an infinite one? The usage of $k$ as index is then confusing because I used a finite $k$ before. If I am right this is a convolution of a infinite and a finite polynomial, right? – draks ... Apr 14 '17 at 13:18
  • I am sure you will overcome what you say is a cause of possible confusion... – Did Apr 14 '17 at 15:54
  • The general terms seem related to the Complete Bell Polynomials – Paul LeVan Apr 21 '17 at 12:55
  • They actually should be sums of the Incomplete Bell Polynomials due to their generating function. – Paul LeVan Apr 21 '17 at 13:05
  • @Did a more compact version using incomplete Bell polynomials: $$\frac{d^m}{dx^m}\log(1+\sum_{k=1}^N n_kx^k)\Biggr|{x=0}= m!\sum{k=1}^m \frac{1}{k}\sum_{j=1}^k(-1)^{j-1}\binom{k}{j} B_{m,j}(n_1,n_2,...)$$ – draks ... Apr 24 '17 at 10:57
  • @PaulLeVan did you see Markus' answer? You were right with Bell... – draks ... Apr 29 '17 at 19:16
  • @draks... Yes, I just didn't have the time at the moment to eke out an answer, and Markus' work was very good. Thank you. – Paul LeVan Apr 29 '17 at 22:47

5 Answers5

3

Slightly different from Peter's answer. From $$f(x)=\log{\left(1+\sum_{k=1}^Nn_kx^k\right)}=\log{g(x)} \Rightarrow f'(x)=\frac{g'(x)}{g(x)} \Rightarrow f'g=g'$$ With the latter, applying General Leibniz rule and considering $g(0)=1$, a pattern emerges and binomial coefficients. For example:

Case $m=1$ $$f'(x)=\frac{g'(x)}{g(x)} \Rightarrow f'(0)=\frac{g'(0)}{g(0)}=n_1$$ Case $m=2$ $$f'g=g' \Rightarrow f''g+f'g'=g'' \Rightarrow f''(0)+n_1^2=2n_2$$ $$f''(0)=2n_2-n_1^2$$ Case $m=3$ $$f''g+f'g'=g'' \Rightarrow f^{(3)}g+2f''g'+f'g''=g^{(3)} \Rightarrow f^{(3)}(0)+2(2n_2-n_1^2)n_1+2n_1n_2=3\cdot2n_3$$ $$f^{(3)}(0)=2n_1^3-6n_1n_2+6n_3$$ Case $m=4$ $$f^{(3)}g+2f''g'+f'g''=g^{(3)} \Rightarrow f^{(4)}g+3f^{(3)}g'+3f''g''+f'g^{(3)}=g^{(4)}$$ and so on. Now we can define two sequences $$g_n=g^{(n)}(0),g_0=g(0)=1,g_1=g'(0)=n_1$$ $$f_n=f^{(n)}(0),f_0=f(0)=0,f_1=f'(0)=n_1$$ $$g_{n+1}=\sum_{k=0}^n\left(\binom{n}{k} f_{n-k+1}g_{k}\right)=f_{n+1}g_{0}+\sum_{k=1}^n\left(\binom{n}{k} f_{n-k+1}g_{k}\right)$$ or $$f_{n+1}=g_{n+1}-\sum_{k=1}^n\left(\binom{n}{k} f_{n-k+1}g_{k}\right)=g_{n+1}-n\cdot n_1\cdot f_n-n_1\cdot g_n-\sum_{k=2}^{n-1}\left(\binom{n}{k} f_{n-k+1}g_{k}\right)$$ Result is, there is no need to compute derivatives of $f(x)$ at $x=0$ directly and $g(x)$ is a polynomial whose derivatives are easier to calculate.

rtybase
  • 16,907
  • thanks for your answer. Is there an easy way to see how it relates to Markus' answer? – draks ... Apr 23 '17 at 19:24
  • I am not sure, because approaches are different. Both Markus and Peter started by exploiting the composition with quite generic tools (unbound to any particular case) to end up with a relation which contains only powers and derivatives of $t(x)$ polynomial (or $g(x)$ in my notation). I tried to reduce the problem to a recurrence exploiting the particular result of $f'g=g'$. – rtybase Apr 23 '17 at 21:34
3

Another variation of the generalized chain rule besides Faa di Brunos formula is stated as identity (3.56) in H.W. Gould's Tables of Combinatorial Identities, Vol. I and is called:

Hoppe Form of Generalized Chain Rule

Let $D_x$ represent differentiation with respect to $x$ and $t=t(x)$. Hence $D^m_x g(t)$ is the $m$-th derivative of $g$ with respect to $x$. The following holds true \begin{align*} D_x^m g(t)=\sum_{k=0}^mD_t^kg(t)\frac{(-1)^k}{k!}\sum_{j=0}^k(-1)^j\binom{k}{j}t^{k-j}D_x^mt^j\tag{1} \end{align*}

In the current situation with $g(t)=\log(t)$ and $t=t(x)=1+\sum_{k=1}^Nn_kx^k$ we have \begin{align*} D_t^kg(t)=D_t^k \log(t)= \begin{cases} \log(t)&k=0\\ (-1)^{k-1}\frac{(k-1)!}{t^k}&k>0\tag{2} \end{cases} \end{align*} as well as \begin{align*} t(0)=1\qquad\text{and}\qquad g(0)=\log(t(0))=0\tag{3} \end{align*}

We obtain for $m>0$ \begin{align*} \color{blue}{D_x^m}&\color{blue}{g(t)\Big|_{x=0}}\\ &=\left.\sum_{k=0}^m D_t^k\left(\log(t)\right)\frac{(-1)^k}{k!}\sum_{j=0}^k(-1)^j\binom{k}{j} \left(t(x)\right)^{k-j}D_x^m\left(t(x)\right)^j\right|_{x=0}\tag{4}\\ &=\left.\sum_{k=1}^m (-1)^{k-1}\frac{(k-1)!}{(t(x))^k}\cdot\frac{(-1)^k}{k!}\sum_{j=1}^k(-1)^j\binom{k}{j} \left(t(x)\right)^{k-j}D_x^m\left(t(x)\right)^j\right|_{x=0}\tag{5}\\ &\color{blue}{=\left.\sum_{k=1}^m \frac{1}{k}\sum_{j=1}^k(-1)^{j-1}\binom{k}{j} D_x^m\left(t(x)\right)^j\right|_{x=0}}\tag{6}\\ \end{align*}

Comment:

  • In (4) we apply Hoppe's formula with $g(t)=\log(t)$.

  • In (5) we start with $k=1$, since when $k=0$ there is a factor $\log(t(0))=0$ according to (3). Consequently we can also start with $j=1$. We also use the $k$-th derivative of $\log$ according to (2).

  • In (6) we do some simplifications and use $t(0)=1$ according to (3).

Let's look at a small example in order to see formula (6) in action:

Example: $m=3, t(x)=1+n_1x+n_2x^2+n_3x^3$

Some preparatory work:

\begin{align*} D_x^3t(x)\big|_{x=0}&=6n_3\\ D_x^3(t(x))^2\big|_{x=0}&=12(n_1n_2+n_3)\tag{7}\\ D_x^3(t(x))^3\big|_{x=0}&=6(n_1^3+6n_1n_2+3n_3)\\ \end{align*}

We obtain \begin{align*} \color{blue}{D_x^3\log(t(x))}&=\left.\sum_{k=1}^3 \frac{1}{k}\sum_{j=1}^k(-1)^{j-1}\binom{k}{j}D_x^3\left(t(x)\right)^j\right|_{x=0}\\ &=\left.1\left(\binom{1}{1}D_x^3\left(t(x)\right)\right)\right|_{x=0}\\ &\qquad+\frac{1}{2}\left.\left(\binom{2}{1}D_x^3\left(t(x)\right)-\binom{2}{2}D_x^3\left(t(x)\right)^2\right)\right|_{x=0}\\ &\qquad+\frac{1}{3}\left.\left(\binom{3}{1}D_x^3\left(t(x)\right) -\binom{3}{2}D_x^3\left(t(x)\right)^2+\binom{3}{3}D_x^3\left(t(x)\right)^3\right)\right|_{x=0}\\ &=\left(6n_3\right)+\frac{1}{2}\left(2\cdot 6n_3-12(n_1n_2-n_3)\right)\\ &\qquad+\frac{1}{3}\left(3\cdot 6n_3-3\cdot 12(n_1n_2+n_3)+6(n_1^3+6n_1n_2+3n_3)\right)\\ &\color{blue}{=2n_1^3-6n_1n_2+6n_3} \end{align*} in accordance with OPs expression.

[Add-on 2017-04-23] According to OPs comment we add a formula for $D_x^m(t(x))^j$ to support the preparatory work in the example above.

We apply the multinomial theorem to \begin{align*} (t(x))^j=\left(1+\sum_{k=1}^Nn_kx^k\right)^j \end{align*} and obtain with $n_0:= 1$

\begin{align*} \color{blue}{D_x^m(t(x))^j}& =D_x^m{\left.\left(\sum_{k=0}^Nn_kx^k\right)^j\right|_{x=0}}\\ &=\left.D_x^m\left(\sum_{k_0+k_1+\cdots+k_N=j}\binom{j}{k_0,k_1,\ldots,k_N} \prod_{l=1}^N\left(n_lx^l\right)^{k_l}\right)\right|_{x=0}\\ &=\left.D_x^m\left(\sum_{k_0+k_1+\cdots+k_N=j}\binom{j}{k_0,k_1,\ldots,k_N} \left(\prod_{l=1}^Nn_l^{k_l}\right)x^{\sum_{i=1}^Ni\cdot k_i}\right)\right|_{x=0}\\ &=\left.\sum_{k_0+k_1+\cdots+k_N=j}\binom{j}{k_0,k_1,\ldots,k_N} \prod_{l=1}^Nn_l^{k_l}\left(\sum_{l=1}^Nl k_l\right)^{\underline{m}}x^{\left(\sum_{i=1}^Ni\cdot k_i\right)-m}\right|_{x=0}\tag{8}\\ &\color{blue}{=m!\sum_{{k_0+k_1+\cdots+k_N=j}\atop{k_1+2k_2+\cdots+Nk_N=m}}\binom{j}{k_0,k_1,\ldots,k_N} \prod_{i=1}^Nn_i^{k_i}}\tag{9}\\ \end{align*}

Comment:

  • In (8) we differentiate $m$ times. We use the notation $z^{\underline{m}}=z(z-1)\cdots(z-m+1)$ and observe when evaluating the expression at $x=0$ we have terms unequal to zero only when the following holds \begin{align*} k_1+2k_2+\cdots+Nk_N=m \end{align*} In this case the product $\left(\sum_{l=1}^Nl k_l\right)^{\underline{m}}$ simplifies to $m!$.

Example: We can now explicitly do the preparatory work (7) using formula (9).

We obtain with $m=3$ and $t(x)=1+n_1x+n_2x^2+n_3x^3$:

\begin{align*} \color{blue}{D_x^3(t(x))}&=3!\sum_{{k_0+k_1+k_2+k_3=1}\atop{k_1+2k_2+3k_3=3}}\binom{1}{k_0,k_1,k_2,k_3} \left(\prod_{i=1}^3n_i^{k_i}\right)\\ &=6\binom{1}{0,0,0,1}n_3\\ &\color{blue}{=6n_3}\\ \color{blue}{D_x^3(t(x))^2}&=3!\sum_{{k_0+k_1+k_2+k_3=2}\atop{k_1+2k_2+3k_3=3}}\binom{2}{k_0,k_1,k_2,k_3} \left(\prod_{i=1}^3n_i^{k_i}\right)\\ &=6\left(\binom{2}{0,1,1,0}n_1n_2+\binom{2}{0,0,0,1}n_3\right)\\ &\color{blue}{=12(n_1n_2+n_3)}\\ \color{blue}{D_x^3(t(x))^3}&=3!\sum_{{k_0+k_1+k_2+k_3=3}\atop{k_1+2k_2+3k_3=3}}\binom{3}{k_0,k_1,k_2,k_3} \left(\prod_{i=1}^3n_i^{k_i}\right)\\ &=6\left(\binom{3}{1,1,1,0}n_1n_2+\binom{3}{2,0,0,1}n_3+\binom{3}{0,3,0,0}n_1^3\right)\\ &\color{blue}{=6\left(6n_1n_2+3n_3+n_1^3\right)}\\ \end{align*} in accordance with the results in (7).

Markus Scheuer
  • 108,315
  • Hi thanks for your answer. It is pretty along what I thought it should be. The only thing that's missing is a general expression for the prepatory work. Maybe the powers of $t(x)$ in terms of multinomials...? – draks ... Apr 23 '17 at 08:09
  • @PeterSheldrick: Many thanks Peter for this really big bounty! :-) – Markus Scheuer Apr 23 '17 at 11:13
  • perfect thanks. Any idea how the mentioned Bell polynomials fit in here? And what a great reference. Thanks for that as well... – draks ... Apr 23 '17 at 19:36
  • 1
    @draks: Check and compare formula 3.74 in the cited reference. I've played in this post rather extensively with Bell polynomials which might be interesting. – Markus Scheuer Apr 23 '17 at 19:55
  • 1
    wow, looks like you had fun back then. I'll have a look... – draks ... Apr 23 '17 at 20:13
  • Not sure if you're interested, but the motivation for the question was a graph theoretical one. Will Orrick gave a nice relation between two forms of Ihara's $\zeta$ function (on a specific example graph) here (last equation). Your answer could be used to generalize this for other graphs and to understand how closed nonbacktracking tailless paths are counted... – draks ... Apr 23 '17 at 20:28
  • @draks...: Thanks for the hint. It looks quite interesting. But at the time my focus is on other problems. – Markus Scheuer Apr 23 '17 at 20:45
  • 1
    No problem, thanks for your help... – draks ... Apr 23 '17 at 20:57
  • One last thing, because I think I see that Eq. $(9)$ is a Bell polynomial: $\displaystyle m!B_{m,j}(n_1,n_2,...)=m!\sum_{{k_0+k_1+\cdots+k_N=j}\atop{k_1+2k_2+\cdots+Nk_N=m}}\binom{j}{k_0,k_1,\ldots,k_N} \prod_{i=1}^Nn_i^{k_i}$, right? – draks ... Apr 24 '17 at 05:03
  • @draks...: Good observation! :-) It's a partial ordinary Bell polynomial. – Markus Scheuer Apr 24 '17 at 06:22
2

Using Faà di Bruno's formula the $n$th derivative is expressible as a sum of bell polynomials. In sympy for your example:

from sympy import *

x,n1,n2,n3=symbols('x,n1,n2,n3')

def f(x):
    return -log(x)
def g(x):
    return n3*x**3+n2*x**2+n1*x+1

n = 3;

print
print diff(f(g(x)),x,n).subs(x,0)

v = map(lambda k: diff(g(x),x,k).subs(x,0), range(1,n+1))
s = 0
for k in range(1,n+1):
    s +=diff(f(x),x,k).subs(x,g(0))*bell(n,k,v)
print s

In this case

diff(g(x),x,k)

evaluates to $n_1 + 2n_2x + 3n_3x^2$ for $k=1$, $2n_2 + 6n_3x$ for $k=2$, $6n_3$ for $k=3$ and $0$ for $k\geq4$. Setting $x=0$ we get $(g'(0),g''(0),\dots,g^{(n-k+1)}(0))=(n_1,2n_2,6n_3,0,\dots,0)$. Replace the code for $v$ with

 v=n*[0];
 v[0]=n1;v[1]=2*n2;v[2]=6*n3;

Furthermore since $f'(x)=-1/x$, $f''(x)=+1/x^2$, $f'''(x)=-2/x^3\dots$ and $g(0)=1$ the line

 s +=diff(f(x),x,k).subs(x,g(0))*bell(n,k,v)

is equivalent to

 s +=(-1)^k*factorial(k-1)*bell(n,k,v)
1

The following is in terms of formal power series. I don't bother about convergence radii.

Assume that the functions $f(x)=\sum_{l\geq 0} f_l x^l$ and $q(x)=\sum_{k\geq0}q_kx^k$, $q_0=1$, are related by $$f(x)=\log q(x)\ .\tag{1}$$ Then $f_0=0$, and $(1)$ implies $$q(x)f(x)=q'(x)\ ,$$ or unpacked: $$\sum_{k\geq0}q_kx^k\cdot\sum_{l\geq 1}l f_l x^{l-1}=\sum_{r\geq1}r q_r x^{r-1}\ .$$ This can be written as $$\sum_{r\geq0}\left(\sum_{k+l=r} q_k(l+1)f_{l+1}\right)x^r=\sum_{r\geq0}(r+1)q_{r+1} x^r\ ,$$ and comparing coefficients leads to $$\sum_{k+l=r}q_k(l+1)f_{l+1}=(r+1)q_{r+1}\qquad(r\geq0)\ .$$We now take the summand $k=0$, $l=r$ out of the sum on the left hand side and so obtain the following recursion for the $f_l$: $$f_{r+1}=q_{r+1}-\sum_{l=1}^r{l\over r+1} q_{r+1-l}\>f_l\qquad(r\geq0)\ .\tag{2}$$

1

You've rediscovered the classical Faber polynomials, presented in OEIS A263916.

Tom Copeland
  • 2,416
  • +1 Interesting, does this information helps to tackle the follow-up question: https://math.stackexchange.com/q/2249648/19341 – draks ... May 16 '17 at 14:32
  • In fact you say that $\frac{d^m}{dx^m}\log(1+\sum_{k=1}^N n_kx^k)\Biggr|{x=0}= m!\sum{k=1}^m \frac{1}{k}\sum_{j=1}^k(-1)^{j-1}\binom{k}{j} B_{m,j}(n_1,n_2,...)=F_m(n_1,n_2,...n_k)$ right? – draks ... May 16 '17 at 20:07
  • @draks, I don't have the time to check everything right now. Maybe later. Certainly you can do a sanity check yourself for the first few orders of the partitions, and there is much info in the relevant OEIS entries and links. – Tom Copeland May 16 '17 at 20:17