Asymptotic expansion of $(1+\frac{t}{n})^{-n-1}$ at $n \to \infty$ I'm reading through a proof in Analytic Combinatorics by Flajolet/Sedgewick and I have come across this:
We have the asymptotic expansion:
$(1+\frac{t}{n})^{-n-1}=e^{-(n+1)\log(1+\frac{t}{n})}=e^{-t}[1+\frac{t^2-2t}{2n}+\frac{3t^4-20t^3+24t^2}{24n^2}+...]$
How do I go from second expression to the third?
 A: Using the Taylor expansion of the logarithm, we obtain
$$\begin{align}
(n+1)\log \left(1 + \frac{t}{n}\right) &= (n+1)\left(\frac{t}{n} - \frac{t^2}{2n^2} + \frac{t^3}{3n^3} + O\left(\frac{1}{n^4}\right)\right)\\
&= t + \frac{t}{n} - \frac{t^2}{2n} - \frac{t^2}{2n^2} + \frac{t^3}{3n^2} + \frac{t^3}{3n^3} - \frac{t^4}{4n^3} + O\left(\frac{1}{n^4}\right)\\
&= t - \frac{t^2-2t}{2n} - \frac{3t^2-2t^3}{6n^2} + O\left(\frac{1}{n^3}\right),
\end{align}$$
and hence, using $e^{x+y} = e^x\cdot e^y$ and the Taylor expansion of the exponential function:
$$\begin{align}
e^{-(n+1)\log \left(1+\frac{t}{n}\right)} &= \exp \left(-t + \frac{t^2-2t}{2n} + \frac{3t^2-2t^3}{6n^2} + O(n^{-3})\right)\\
&= e^{-t}\exp\left(\frac{t^2-2t}{2n} + \frac{3t^2-2t^3}{6n^2} + O(n^{-3})\right)\\
&= e^{-t}\left(1 + \frac{t^2-2t}{2n} + \frac{3t^2-2t^3}{6n^2} + \frac12\left(\frac{t^2-2t}{2n}\right)^2 + O(n^{-3})\right)\\
&= e^{-t}\left(1 + \frac{t^2-2t}{2n} + \frac{12t^2 - 8t^3 + 3(t^4 - 4t^3 + 4t^2)}{24n^2} + O(n^{-3})\right)\\
&= e^{-t}\left(1 + \frac{t^2-2t}{2n} + \frac{3t^4 - 20t^3 + 24t^2)}{24n^2} + O(n^{-3})\right).
\end{align}$$
