action of a derivation on smooth function

Suppose we have a smooth manifold $M$, and one point $p\in M$. Let $U$ be an open set around $p$ that admits two parametrizations, namely $x:V_1\to U$ and $y:V_2\to U$. Now in these two parametrizations we can write vector field $X$ on $M$ as

$$X=\sum_{i=1}^n{a_i(p)\frac{\partial}{\partial x_i}}=\sum_{i=1}^n{b_i(p)\frac{\partial}{\partial y_i}}.$$

Suppose now that we have a smooth function $f:M\to R$. Then value $Xf$ should not depend on the parametrization. So, I am trying to prove that.

Denote by $A(p)=(a_1(p),...,a_n(p))$, similarly for $B(p)$ and let $M=D(y^{-1}\circ x)(x^{-1}(p))$. Then we have $B(p)=M\cdot A(p)$. Denote by $\nabla_Xf$ and $\nabla_Yf$ gradients of $f$ with respect to two parametrizations. Then we get:

$Xf=A(p)\cdot \nabla_Xf$ for the first parametrization and

$Xf=B(p)\cdot \nabla_Yf=M\cdot A(p) \cdot \nabla_Xf\cdot M^{-1}$, for the second parametrization.

However these two are not equal. Could you please point out the mistake?

-
You use $M$ for both the smooth manifold and for some other function. It's true that $Xf$ is some function which doesn't depend on the parameterization, but it looks like you're expressing that function in local coordinates, and of course a function's expression in local coordinates depends on the choice of local coordinates... – Qiaochu Yuan Sep 27 '12 at 5:33
$Xf=(\sum_{i=1}^n{a_i(p)\frac{\partial}{\partial x_i}})(f\circ x)$ – user8268 Sep 27 '12 at 6:57
I agree that $Xf$ should be independent on the parametrization. That means that whatever local coordinates I use for it, I will get the same number, right? My question is I don't get the same number. – dmm Sep 27 '12 at 12:49
So, $M=D(y^{-1}\circ x)(x^{-1}(p))$, is this the problem? – dmm Sep 27 '12 at 12:55

You're not consistent in your use of row and column matrices. Your first expression for $Xf$ is a $1 \times 1$ matrix, but the second one is not even defined! (The matrix product $M \cdot A(p)$ is undefined if $A(p)$ is a row vector. Similarly for $\nabla_X f \cdot M^{-1}$.)
Try adding a few transposes in the right places; then it will work better, because of the rule $(AB)^t = B^t A^t$.