What is the $m$th derivative of $\log\left(1+\sum\limits_{k=1}^N n_kx^k\right)$ at $x=0$?
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.
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).
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)