how to calculate derivative of $f_n(x)=f \circ f ... \circ f(x)$? Derivative on $f \circ f_{n-1}$ or $f_{n-1} \circ f$? Denote $f_n(x)=f \circ f ... \circ f(x)$, the $n$th power of composition multiplication of $f(x)$. Assume $f(x)$ is differentiable for any order. $f(1)=1$, $f^{'}(1)=p$, $f^{''}(1)=q$ Question: Get the expression of $f_n^{''}(1)$. 
My solution is write $f_n(x)=f \circ f_{n-1}(x)$ and then do the first derivative: use chain rule we can get $$f_n(x)=f^{'}[f_{n-1}(x)]f_{n-1}^{'}(x)$$ Note that $f_n(1)=1$ for all $n$, plug in $1$ we have $f_n(1)=f^{'}(1)f_{n-1}^{'}(1)=pf_{n-1}^{'}(1)$. Use induction we have $f_n(1)=p^n$. Then we take second derivative of $f \circ f_{n-1}(x)$, we have
$$f_n^{''}(x)=f^{''}[f_{n-1}(x)][f_{n-1}^{'}(x)]^2+f^{'}(f_{n-1}(x))f^{''}_{n-1}(x)$$plug in 1 we have $f_n^{''}(1)=qp^{2n-2}+pf_{n-1}^{''}(1)$. We can use this recursive formula to get $f_n^{''}(1)$. 
$$$$
However, if I write  $f_n(x)=f_{n-1} \circ f(x)$ and do the same thing. The final recursive formula is $$f_n^{''}(x)=f_{n-1}^{''}[f(x)][f^{'}(x)]^2+f_{n-1}^{'}(f(x))f^{''}(x)$$ Then the answer is $f_n^{''}(1)=f_{n-1}^{''}(1)p^2+p^{n-1}q$. Different answer...
I know it's a bit stupid but I really can not find where goes wrong? Thank you!
 A: Both answers are correct.  The recurrences are different but if you solve them by standard methods you will find that they both give
$$f''_n(1)=\frac{q}{p-1}(p^{2n-1}-p^{n-1})\ .$$
A: Define $x_{n+1} = f(x_n)$ with $x_0 = x$. Then
$$D f^{(n)} (x) = f'(x_{n-1}) f'(x_{n-2}) \cdots f'(x_0).$$
Take logs so that
$$D \log( D f^{(n)}(x) ) = \frac{D f'(x_{n-1}) }{f'(x_{n-1})} + \frac{D f'(x_{n-2}) }{f'(x_{n-2})} + \cdots + \frac{D f'(x_0)}{f'(x_0)}.$$
Here we need to remember that $x_k$ is really a function of $k$. So we now compute
$$D f'(x_k) = f''(x_{k-1}) f'(x_{k-2}) f'(x_{k-3}) \cdots f'(x_0).$$
Since $f(1)=1$ and we set $x_0=1$, we have $x_k=1$ for all $k$. This means $[Df'(x_k)](1)=f''(1) f'(1)^{k-1}$ and since $f'(x_k)=f'(1)$ we get
$$D \log( D f^{(n)}(1)) = f''(1) f'(1)^{n-2}+\cdots+f''(1) f'(1)^{0}+ f''(1) f'(1)^{-1}$$
or 
$$D \log( D f^{(n)}(1)) = q/p ( p^{n-1} + \cdots + 1) = \frac{q}{p} \frac{p^n-1}{p-1}.$$
Now $D^2 f^{(n)}(1) = D \log( D f^{(n)}(1)) \cdot  [Df^{(n)}](1)$ and $[Df^{(n)}](1) = f'(1) \cdots f'(1) =  p^{n}$.
From this we get
$$[D^2 f^{(n)}](1) = \frac{q}{p-1}\left(p^{2n-1}-p^{n-1}\right).$$
A: The Taylor series of $f$ at $1$ starts
$$f(x) = f(1) + f'(1) (x - 1) + \dfrac{f''(1)}{2} (x-1)^2 = 1 + p (x-1) + \dfrac{q}{2} (x-1)^2 $$
Prove by induction that
$$ f_n(x) = 1 + p^n (x-1) + \dfrac{p^{n-1} q}{2} (1 + p + \ldots + p^{n-1}) (x-1)^2$$
