Transform ODE $(u-x)u_x + u + x = 0$ to polar coordinates According to Peter Olver in his book “Applications of Lie Groups to Differential Equations”, p. 104, Example 2.32, the ODE:
$$(u-x)u_x + u + x = 0 \tag{1}$$
is transformed in polar coordinates with $x = r\cos \theta$ and $u = r\sin\theta$ to:
$$\frac{dr}{d\theta} = r.$$
How do I transform $u_x=\partial_x(r\sin\theta)$ to the new coordinates? I tried the following, but the equation I got is very far from $\frac{dr}{d\theta} = r$. I rewrote $\partial_x$ in terms of $\partial_r$ and $\partial_\theta$ using the chain rule. Supposing $f = f(r,\theta)$ is a function of $r$ and $\theta$, we should have:
$$\begin{aligned} \partial_x f(r,\theta) &= (\partial_x r)\partial_r f + (\partial_x \theta)\partial_\theta f\\
&=\cos\theta\partial_r f + \left(\partial_x \arctan\frac ux\right) \partial_\theta f\\
&=\cos\theta\partial_r f + \left(\frac {1}{1+\theta^2}2\theta\frac{xu_x - u}{x^2}\right) \partial_\theta f.\end{aligned}$$
Thus:
$$\begin{aligned} u_x &=\cos\theta\partial_r (r\sin\theta) + \left(\frac {1}{1+\theta^2}2\theta\frac{xu_x - u}{x^2}\right) \partial_\theta (r\sin\theta)\\
&=\cos\theta\sin\theta + \left(\frac {2\theta}{1+\theta^2}\frac{xu_x - u}{(r\cos\theta)^2}\right) (-r\cos\theta + r_\theta \sin\theta)\\
&=\cos\theta\sin\theta - \left(\frac {2\theta}{1+\theta^2}\frac{r(u_x\cos\theta - \sin\theta)}{r\cos\theta}\right) + \left(\frac {2\theta}{1+\theta^2}\frac{\cos\theta u_x - \sin\theta}{r\cos^2\theta}\right) r_\theta \sin\theta.\end{aligned}$$
Rearranging:
$$\begin{aligned} u_x\left[1 + \frac{2\theta}{1+\theta^2}\left(1+\frac{r_\theta}{r}\tan\theta \right)\right] &= \cos\theta\sin\theta + \frac {2\theta}{1+\theta^2}\left(\tan\theta - \frac{r_\theta}{r}\tan^2\theta\right).\end{aligned}$$
So:
$$ u_x = \frac{\cos\theta\sin\theta + \frac {2\theta}{1+\theta^2}\left(\tan\theta - \frac{r_\theta}{r}\tan^2\theta\right)}{1 + \frac{2\theta}{1+\theta^2}\left(1+\frac{r_\theta}{r}\tan\theta \right)}$$
Then, rewriting (1) as $u_x = \frac{x+u}{x-u}$, I obtained:
$$\frac{\cos\theta\sin\theta + \frac {2\theta}{1+\theta^2}\left(\tan\theta - \frac{r_\theta}{r}\tan^2\theta\right)}{1 + \frac{2\theta}{1+\theta^2}\left(1+\frac{r_\theta}{r}\tan\theta \right)}=\frac{\cos\theta+\sin\theta}{\cos\theta-\sin\theta}.$$

$$(u-x)u_x + u + x = 0 \tag{1}$$
$$-xu_x + u =- x -uu_x$$
$$\left(\dfrac  u x \right)'  =\dfrac 1 {x^2}(x+uu_x)$$
$$\left(\dfrac  u x\right)'  =\dfrac 1 {2x^2}(x^2+u^2)'$$
Multiply both sides by  $ \dfrac {dx}{d\theta}$:
$$\dfrac {d}{d \theta}(\tan \theta )=\dfrac 1 {2r^2 \cos^2 \theta}\dfrac {dr^2}{d\theta }$$
$$\dfrac {dr}{d \theta}=r$$
