# Cartesian to Polar Transformation Bug?

I was trying to do this problem with Mathematica Equating Coefficients of Cos and Sin

We have

    TransformedField[
"Cartesian" -> "Polar", {x/2 - y - 1/2 (x^3 + y^2 x),
x + y/2 - 1/2 (y^3 + x^2 y)}, {x, y} -> {r, \[Theta]}] // Simplify


The result is

$$\left\{\frac{1}{2} \left(r-r^3\right),r\right\}$$

However, the book (well respected) and one of the answers match, but that is different than the above.

$$\left\{\frac{1}{2} \left(r-r^3\right),1\right\}$$

Notice that $$\theta' = r$$ according to Mathematica, but it is equal to one when this is done by hand. It seems that Mathematica is not dividing by $$r$$ in the last step. Is this a bug in Mathematica? Is there a way to check that?

• Please do not use the bugs tag when posting your own questions. Do add this tag to others' questions once you have independently verified that there is indeed a bug. Please see the tag description. – Szabolcs Nov 12 '18 at 18:20
• @Szabolcs: Thanks for that clarification. – Moo Nov 12 '18 at 18:21
• @Szabolcs: Doesn't that vector plot confirm that this is a radially inward spiral? In other words, the result should be $1$? It is worth noting that I have used this approach on dozens of problems and have not had this issue before until now.. – Moo Nov 12 '18 at 18:36
• What I said above was indeed wrong, but the result still checks out. If we put y -> 0, we get {x/2 - x^3/2, x}. This is the case when $\theta=0$ and $x=r$, and the basis vectors are identical, so Mathematica's result seems correct. – Szabolcs Nov 12 '18 at 18:43
• If you look the answer (this agrees with hand calculations) by JJacquelin at math.stackexchange.com/questions/2995287/…, this shows the discrepancy - so I am confused by Mathematica's result. – Moo Nov 12 '18 at 18:55