# Transforming differential equation to polar coordinates, example.

... For example, if we write $$\dfrac{\operatorname dy}{\operatorname dx} = \dfrac{-x}{y}$$ in polar coordinates, we obtain the equation $$\dfrac{\operatorname dr}{\operatorname d\theta} = 0$$ whose solution is $$r = C$$.

Seems like a straightforward statement, but I don't seem to get there. I guess i'm doing something wrong... Could someone help?

If $$x = r\cos \theta$$, $$y=r \sin \theta$$ with the inverse transformation $$r = \sqrt{x^2+y^2}$$, $$\theta = \arctan \dfrac{y}{x}$$.

Then $$\dfrac{-x}{y} = \dfrac{-\cos \theta}{\sin \theta}$$

Next:

$$\dfrac{\operatorname dy}{\operatorname dx} \stackrel{\color{red}{(1)}}{=} \dfrac{\operatorname dy}{\operatorname dr}\cdot \dfrac{\operatorname dr}{\operatorname d\theta}\cdot \dfrac{\operatorname d\theta}{\operatorname dx} = \sin \theta \cdot \dfrac{\operatorname dr}{\operatorname d\theta}\cdot \dfrac{-r\sin \theta}{r^2}$$

This results in:

$$\sin \theta \cdot \dfrac{\operatorname dr}{\operatorname d\theta}\cdot \dfrac{-r\sin \theta}{r^2} = \dfrac{-\cos\theta}{\sin \theta}$$

or

$$\dfrac{\operatorname dr}{\operatorname d\theta}= \dfrac{r \cos\theta}{\sin^3 \theta}$$

### Fault?

I suspect $$\color{red}{(1)}$$ is not right. Since $$\dfrac{\operatorname dy}{\operatorname d r}$$ doesn't make any sense. I should be using something like $$\partial$$, but how exactly?

• I remember having similar problem,a quick revision of chain rule should make it clear. Please see this question math.stackexchange.com/questions/84736/… Apr 29, 2015 at 21:16
• Indeed, $(1)$ does not make sense because $r$ and $\theta$ are independent variables. Apr 29, 2015 at 21:40

The fault is in: $\frac{dy}{dx}=\frac{dy}{d\theta}\frac{d\theta}{dx} + \frac{dy}{dr}\frac{dr}{dx}$
$$\frac{dy}{dx}=\frac{dy}{d\theta}\times\frac{d\theta}{dx}=\frac{\frac{dy}{d\theta}}{\frac{dx}{d\theta}}\tag{1}$$$$x=r\cos(\theta)$$$$\therefore\frac{dx}{d\theta}=\cos(\theta)\frac{dr}{d\theta}-r\sin(\theta)\tag{2}$$$$y=r\sin(\theta)$$$$\therefore\frac{dy}{d\theta}=\sin(\theta)\frac{dr}{d\theta}+r\cos(\theta)\tag{3}$$Substituting (2) and (3) into (1) then gives:$$\frac{dy}{dx}=\frac{\sin(\theta)\frac{dr}{d\theta}+r\cos(\theta)}{\cos(\theta)\frac{dr}{d\theta}-r\sin(\theta)}$$Hopefully you can proceed from here...
The mistakes you made were in the calculations of $\frac{dy}{dr}$ and $\frac{dx}{d\theta}$:$$\frac{dy}{dr}=\sin(\theta)+r\cos(\theta)\frac{d\theta}{dr}$$$$\frac{dx}{d\theta}=-r\sin(\theta)+\cos(\theta)\frac{dr}{d\theta}$$Using these in your approach would have led to the same result as I got above, i.e.:$$\frac{dy}{dx}=\frac{dy}{dr}\cdot\frac{dr}{d\theta}\cdot\frac{d\theta}{dx}$$$$=\left(\sin(\theta)+r\cos(\theta)\frac{d\theta}{dr}\right)\cdot\frac{dr}{d\theta}\cdot\left(\frac{1}{-r\sin(\theta)+\cos(\theta)\frac{dr}{d\theta}}\right)$$$$=\frac{\sin(\theta)\frac{dr}{d\theta}+r\cos(\theta)}{\cos(\theta)\frac{dr}{d\theta}-r\sin(\theta)}$$
You could also view your problem as an equality of differential forms: $x\mathbb{d}x + y\mathbb{d}y =0$. Since $\mathbb{d}x=\mathbb{d}(r\cos \theta)=\cos \theta \mathbb{d}r-r \sin \theta \mathbb{d}\theta$ and $\mathbb{d}y= \sin \theta \mathbb{d}r+ r \cos \theta \mathbb{d} \theta$, a simple substitution makes this is equivalent to $0= r \cos^2 \theta \mathbb{d} r - r^2 \sin \theta \cos \theta \mathbb{d}\theta + r \sin^2 \theta \mathbb{d}r + r^2 \sin \theta \cos \theta \mathbb{d}\theta = r \mathbb{d}r$, which means $\mathbb{d}r=0$ which gives $r=constant$.