# Confusion regarding the transformation law under diffeomorphism

While revisiting the transformation laws - under a diffeomorphism - of the partial derivative of a vector field I got confused by the following result. So, for a vector field $$A$$ the usual transformation law is given by,

$$A^{\alpha'}_{,\beta'}=\partial_{\beta'} A^{\alpha'}= \frac{\partial x^ {\alpha'}}{\partial x^{\alpha}} \frac{\partial x^{\beta}}{\partial x^{\beta'}} A^\alpha_{,\beta} + \frac{\partial^2 x^{\alpha'}}{\partial x^{\alpha}\partial x^{\beta}} \frac{\partial x^{\beta}}{\partial x^{\beta'}} A^\alpha~.$$

However, for the last term on the RHS, using the properties of the partial derivatives:

\begin{aligned} \frac{\partial^2 x^{\alpha'}}{\partial x^{\alpha}\partial x^{\beta}} \frac {\partial x^{\beta}}{\partial x^{\beta'}} A^\alpha & = \frac{\partial}{\partial x^\beta}\left(\frac{\partial x^{\alpha'}}{\partial x^{\alpha}}\right) \frac{\partial x^ {\beta}}{\partial x^{\beta'}} A^\alpha \\ & =\frac{\partial}{\partial x^{\beta'}}\left(\frac{\partial x^{\alpha'}}{\partial x^{\alpha}}\right) A^\alpha \\ & = \frac{\partial}{\partial x^\alpha}\left(\frac{\partial x^{\alpha'}}{\partial x^{\beta'}}\right) A^\alpha \\ & = \frac{\partial \delta^{\alpha'}_{\beta'}}{\partial x^\alpha} A^\alpha =0~, \end{aligned}

where $$\delta^{\alpha'}_{\beta'}$$ is the Kronecker delta and in the last equality it was used the fact that its derivative is zero.

Now, I know that this is wrong but I don't know where, could somebody help me find the error?

Hint: Derivatives $$\frac{\partial}{\partial x^{\alpha}}$$ wrt. the unprimed coordinate system and derivatives $$\frac{\partial}{\partial x^{\prime\beta}}~=~\frac{\partial x^{\gamma}}{\partial x^{\prime \beta}}\frac{\partial}{\partial x^{\gamma}}$$ wrt. the primed coordinate system do not necessarily commute $$\left[\frac{\partial}{\partial x^{\alpha}},\frac{\partial}{\partial x^{\prime\beta}}\right]~=~\left[\frac{\partial}{\partial x^{\alpha}},\frac{\partial x^{\gamma}}{\partial x^{\prime \beta}}\right]\frac{\partial}{\partial x^{\gamma}},$$ since the Jacobian matrix $$\frac{\partial x^{\gamma}}{\partial x^{\prime \beta}}$$ may be non-constant.