# building transformation matrix from spherical to cartesian coordinate system

How to arrive at the following from given $x = r\sin \theta \cos \phi, y = r\sin \theta \sin \phi, z=r\cos\theta$

$$\begin{bmatrix} A_x\\ A_y\\ A_z \end{bmatrix} = \begin{bmatrix} \sin \theta \cos \phi & \cos \theta \cos \phi & -\sin\phi\\ \sin \theta \sin \phi & \cos \theta \sin \phi & \cos\phi\\ \cos\theta & -\sin\theta & 0 \end{bmatrix} \begin{bmatrix} A_r\\ A_\theta\\ A_\phi \end{bmatrix}$$

Also how show that $$\begin{bmatrix} \hat i\\ \hat j\\ \hat k \end{bmatrix} = \begin{bmatrix} \sin \theta \cos \phi & \cos \theta \cos \phi & -\sin\phi\\ \sin \theta \sin \phi & \cos \theta \sin \phi & \cos\phi\\ \cos\theta & -\sin\theta & 0 \end{bmatrix} \begin{bmatrix} \hat e_r\\ \hat e_\theta\\ \hat e_\phi \end{bmatrix}$$ How to change $(a,b,c)$ into spherical polar coordinates and $(r ,\theta, \phi)$ into cartesian coordinates using this matrix? Thank you!!

-
Find a transformation from Cartesian to cylindrical coordinates. Find a transformation from cylindrical to spherical coordinates. Compose them. – Potato Jun 24 '12 at 0:36

I can partially answer this. I believe your first matrix is not the correct general transformation matrix for cartesian to spherical coordinates because you are missing factors of $\rho$ (the radial coordinate), as well as some other incorrect pieces. So it is not clear what you are trying to show.
If you are trying to derive the general transformation matrix from spherical to cartesian, it is: $$\begin{bmatrix} A_x\\ A_y\\ A_z \end{bmatrix} = \begin{bmatrix} \sin \theta \cos \phi & \rho \cos \theta \cos \phi & -\rho \sin \theta \sin\phi\\ \sin \theta \sin \phi & \rho \cos \theta \sin \phi & \rho \sin\theta \cos\phi\\ \cos\theta & -\rho \sin\theta & 0 \end{bmatrix} \begin{bmatrix} A_r\\ A_\theta\\ A_\phi \end{bmatrix}$$ This matrix is formed from the derivative matrix in the following way: $\sum_{(i,j)} \frac {\partial x^i} {\partial u^j}$ where $$x^1 = \rho\sin \theta \cos \phi, x^2 = \rho\sin \theta \sin \phi, x^3=\rho\cos\theta$$ and $u^1 = \rho, u^2 = \theta, u^3 = \phi$ (Note: the superscripts are indices, not exponents). If you write out all the derivatives, you get this matrix:
$$\begin{bmatrix} A_x\\ A_y\\ A_z \end{bmatrix} = \begin{bmatrix} \frac {\partial (\rho \sin \theta \cos \phi)} {\partial \rho} & \frac {\partial (\rho \sin \theta \cos \phi)} {\partial \theta} & \frac {\partial (\rho \sin \theta \cos \phi)} {\partial \phi}\\ \frac {\partial (\rho \sin \theta \sin \phi)} {\partial \rho} & \frac {\partial (\rho \sin \theta \sin \phi)} {\partial \theta} & \frac {\partial (\rho \sin \theta \sin \phi)} {\partial \phi}\\ \frac {\partial (\rho \cos \theta)} {\partial \rho} & \frac {\partial (\rho \cos \theta)} {\partial \theta} & \frac {\partial (\rho \cos \theta)} {\partial \phi} \end{bmatrix} \begin{bmatrix} A_r\\ A_\theta\\ A_\phi \end{bmatrix}$$ ...which evaluates to the correct general transformation matrix I listed above.