<s>[INST] Solve Differential Equation: $y' = \frac{\sqrt{x^2+y^2}-x}{y}$ Solve Differential Equation: $y' = \frac{\sqrt{x^2+y^2}-x}{y}$
This looks like a problem that would do well with a conversion to polar coordinates ($r^2 = x^2 + y^2$ and $x = r\cos(\theta)$ $y = r\sin(\theta)$). However, I am confused on how to change $y' = \frac{dy}{dx}$ to $\frac{dr}{d\theta}$, in order to do separation of variables. Could someone demonstrate a solution using this approach?
 [/INST] $x = r \cos\theta, y = r \sin\theta$
$dx = \cos\theta \ dr - r \sin\theta \ d\theta$
$dy = \sin\theta \ dr + r \cos\theta \ d\theta$
Given equation is $dy = \frac{\sqrt{x^2+y^2}-x}{y} dx$
So we get,
$r \sin\theta \ (\sin\theta \ dr + r \cos\theta \ d\theta) = r \ (1 - \cos\theta) \ (\cos\theta \ dr - r \sin\theta \ d\theta)$
On simplifying we get,
$\displaystyle \frac{1}{r} \ dr = - \frac{\sin\theta}{1-\cos\theta} \ d\theta$
To integrate, simply observe that $1 - \cos\theta = t \implies \sin\theta \ d\theta = dt$
So both sides are simple integration.
</s>