In his book An Introduction to Manifolds (Second Edition) on page no. 13, Loring Tu proves the following theorem.
Theorem 2.2 The linear map $\phi: T_P(\mathbb{R}^n) \rightarrow \mathscr{D}_p(\mathbb{R}^n)$ defined by $v \mapsto D_v = \sum_{i} v^i \left.\frac{\partial}{\partial x^i}\right|_p$ is an isomorphism of vector spaces.
Here $\mathscr{D}_p(\mathbb{R}^n)$ is the set of all derivations at $p$ which is, of course, a vector space.
In the proof of surjectivity, he uses Taylor's theorem with remainder to expand a smooth function $f: V \rightarrow \mathbb{R}$ defined on a star-convex neighborhood $V$ of the point $p$:
$$ f(x) = f(p) + \sum_{i} (x^i - p^i) g_i(x), \quad g_i(p) = \frac{\partial f}{ \partial x^i}(p). $$
Then he applies $D$ on both sides and uses $D(f(p)) = 0$ and $D(p^i) = 0$ to arrive at the following equaiton:
$$ Df(x) = \sum (Dx^i) g_i(p) + \sum (p^i - p^i) Dg_i(x) = \sum (Dx^i) \frac{\partial f}{ \partial x^i}(p), $$ where $D$ is a derivation at point $p$.
My Confusion
I can't arrive at this equation.
My Attempts
\begin{eqnarray} f(x) &=& f(p) + \sum_{i} (x^i - p^i) \, g_i(x) \\ \Rightarrow Df(x) &=& D(f(p)) + D\left(\sum_{i} (x^i - p^i) \, g_i(x)\right) \\ \Rightarrow Df(x) &=& \sum_{i} (x^i - p^i)D\left(g_i(x)\right) + \sum_{i} D\left((x^i - p^i)\right) g_i(x) \\ \Rightarrow \left[Df(x)\right]_p &=& \sum_{i} \left[(x^i - p^i)\right]_p \,\,\left[D\left(g_i(x)\right)\right]_p + \sum_{i} \left[D\left((x^i - p^i)\right)\right]_p \,\,\left[g_i(x)\right]_p \\ \Rightarrow Df(p) &=& 0 + \sum_{i} \left[D(x^i)\right]_p \,\,\left[g_i(x)\right]_p \\ \Rightarrow Df(p) &=& \sum_{i} D(p^i) g_i(p) \\ \Rightarrow Df(p) &=& \sum_{i} D(p^i) \frac{\partial f}{\partial x^i}(p). \end{eqnarray}
A change of variables $p \longleftrightarrow x$ yields, $$Df(x) = \sum_{i} D(x^i) \frac{\partial f}{\partial x^i}(\color{red} x)$$ whereas Tu writes, $$Df(x) = \sum_{i} D(x^i) \frac{\partial f}{\partial x^i}(\color{red}p).$$
I don't see where I have made the mistake.