What is the procedure (matrix) for change of basis to go from Cartesian to polar coordinates and vice versa? I'm following along with these notes, and at a certain point it talks about change of basis to go from polar to Cartesian coordinates and vice versa. It gives the following relations:
$$\begin{pmatrix}
A_r \\
A_\theta
\end{pmatrix}
=
\begin{pmatrix}
\cos\theta & \sin\theta \\
-\sin\theta & \cos\theta
\end{pmatrix}
\begin{pmatrix}
A_x \\
A_y
\end{pmatrix}$$
and
$$\begin{pmatrix}
A_x \\
A_y
\end{pmatrix}
=
\begin{pmatrix}
\cos\theta & -\sin\theta \\
\sin\theta & \cos\theta
\end{pmatrix}
\begin{pmatrix}
A_r \\
A_\theta
\end{pmatrix}$$
I was struggling to figure out how these were arrived at, and then I noticed what is possibly a mistake. In (1), shouldn't it read
$$A_r=A_x+A_y$$
Is this a mistake, or am I making a wrong assumption somewhere?
I'm kinda stuck here, and would appreciate some inputs on this. Thanks.
 A: This properly belongs on math.se, but to properly derive these you need to remember that we can write a vector in terms of basis vectors. The vector $\vec{A}$ is unchanged, but it is just expressed as a different linear combination:
$$\vec{A} = A_x \hat {x} + A_y \hat{y} = A_r \hat{r} + A_\theta\hat{\theta} $$.
Because you can write $\hat{r}$ as a linear combination of $\hat x$ and $\hat y$, i.e., $\hat {r} = \frac{x}{r} \hat {x} + \frac{y}{r} \hat y = \cos\theta \hat{x} + \sin\theta \hat{y}$, and similarly for $\hat{\theta} = -\sin\theta \hat{x} + \cos\theta \hat y$, you can solve for the $A_r$ and $A_\theta$ in terms of $A_x$ and $A_y$.
A: What you need to do to derive the transformation matrix is first wrtie out all the relation between both coordinations.
For example, the relation between cartesian coordinates and polar coordinates are:
$$x=r\cos \theta \hspace{1cm} y=r\sin \theta $$
$$r=\sqrt{x^2+y^2} \hspace{1cm} \theta = \tan^{-1} \frac{y}{x}$$
From chain rule of partial differiation, we have
$$dx=\frac{\partial x}{\partial r}dr+\frac{\partial x}{\partial \theta}d\theta$$
$$dy=\frac{\partial y}{\partial r}dr+\frac{\partial y}{\partial \theta}d\theta$$
Therefore, in matrix notation we have
$$
\begin{bmatrix}
dx\\dy
\end{bmatrix}
=
\begin{bmatrix}
\frac{\partial x}{\partial r} & \frac{\partial x}{\partial \theta}\\
\frac{\partial y}{\partial r} & \frac{\partial y}{\partial \theta}
\end{bmatrix}
\begin{bmatrix}
dr\\d\theta
\end{bmatrix}
$$
By definition, an arbitary vector A must transform the same way as the componenets of the displacement do. Because in here we defined the basic vector $e_{\theta}$ to have a magnetude of r
So we have:
$$
\begin{bmatrix}e_x\\e_y\end{bmatrix}
=
\begin{bmatrix}\cos \theta &-\sin \theta \\\sin \theta &\cos \theta \end{bmatrix}
\begin{bmatrix}e_r\\e_{\theta} \end{bmatrix}
$$
Do an inverse on the transfomation matrix and you shall get the inverse transformation relation.
$$
\begin{bmatrix}e_r\\e_{\theta}\end{bmatrix}
=
\begin{bmatrix}\cos \theta &\sin \theta \\-\sin \theta &\cos \theta \end{bmatrix}
\begin{bmatrix}e_x\\e_y \end{bmatrix}
$$
An alternative way of thinking it, is to rotate the coordination system such that $e_x$ coincide with $e_r$. Therefore, The transformation matrix is coincidentally the same as rotation matrix rotating the cartesian system by $\theta$.
A: I just wanted to build on @Hayate's answer here. while the mathematical identities are correct, there are a few steps omitted. Specifically, there is no explicit calculation for $\frac{\partial r}{\partial x}$, $\frac{\partial r}{\partial \theta}$, $\frac{\partial \theta}{\partial x}$, and $\frac{\partial \theta}{\partial y}$.
Using the formula $r = \sqrt{x^2 + y^2}$, we have
$\frac{\partial r}{\partial x} = \frac{2x}{2\sqrt{x^2+y^2}} = \frac{x}{r} = cos(\theta)$
$\frac{\partial r}{\partial y} = \frac{2y}{2\sqrt{x^2+y^2}} = \frac{y}{r} = sin(\theta)$
In addition, we have the formula $\theta = tan^{-1}(\frac{y}{x})$,
from which it follows that
$\frac{\partial \theta}{\partial x} = \frac{1}{1+(\frac{y}{x})^2} \frac{-y}{x^2} = \frac{-y}{x^2+y^2} = \frac{-y}{r} = -sin(\theta)$
$\frac{\partial \theta}{\partial y} = \frac{1}{1+(\frac{y}{x})^2} \frac{1}{x} = \frac{x}{x^2+y^2} = \frac{x}{r} = cos(\theta)$
This agrees with the transformation that was posted by @hayate.
Hopefully that helps.
-Paul
