# Why does a transform from polar coordinates using TransformedField not agree with by-hand calculation?

I have the following (simple) system of ODE's that I wish to express in Cartesian coordinates:

\begin{align*} r' &= r(1-r)\\ \theta' &= 1 \end{align*}

Working it out by hand, by differentiating $x = r\cos\theta$, $y = r\sin\theta$, I find

\begin{align*} x' &= r' \cos\theta - r \sin\theta \theta' \\ &= r(1-r)\cos\theta - r\sin\theta \\ &= x(1 - \sqrt{x^2 + y^2}) - y\\ \\ y' &= r' \sin\theta + r \cos\theta \theta' \\ &= r(1-r)\sin\theta + r\cos\theta \\ &= y(1 - \sqrt{x^2 + y^2}) + x \end{align*}

However, using TransformedField like so:

TransformedField["Polar" -> "Cartesian", {r (1 - r), 1}, {r, \[Theta]} -> {x, y}]


the result is:

$$\left\{x \left(1-\sqrt{x^2+y^2}\right)-\frac{y}{\sqrt{x^2+y^2}},\frac{x}{\sqrt{x^2+y^2}}+y \left(1-\sqrt{x^2+y^2}\right)\right\}$$

So does the disagreement come from an error in my calculation (which I have been unable to find), or a misuse/misunderstanding of TransformedField?

• Please, avoid using $\LaTeX$ as it is impossible to copy-paste the results you have provided. – Sektor Apr 20 '15 at 12:47

When applied to a List, TransformedField assumes that the elements are components along the unit vectors of the original coordinate system. That's not the case in your equations, because they are derivatives of the coordinates themselves.

So you're using TransformedField where it shouldn't be used. Instead, you can use the chain rule directly as follows:

With[{
j = CoordinateTransformData["Cartesian" -> "Polar",
"InverseMappingJacobian", {x, y}],
mapping =