# A specific homogeneous polar differential equation

In an assignment of our school, we are asked to solve $$\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{x + y - 3}{x - y - 1}$$ by turning it into a homogeneous polar differential equation (equation of the form $$\displaystyle \frac{\mathrm{d}y}{\mathrm{d}x} = F\left(\frac{y}{x}\right)$$) using substitutions $$x = X + a$$, $$y = Y + b$$. My solution was:

Firstly, I determined substitutions $$x = X + 2$$, $$y = Y + 1$$, such that $$\frac{\mathrm{d}Y}{\mathrm{d}X} = \frac{X + Y}{X - Y}$$

Then, let $$Y = Xv$$, thus \begin{aligned} v + X\frac{\mathrm{d}v}{\mathrm{d}X} &= \frac{X + Xv}{X - Xv} \\ \int \frac{1 - v}{1 + v^2}\ \mathrm{d}v &= \int \frac{\mathrm{d}X}{X} \end{aligned}

The left-hand side, specifically, gives $$\int \frac{\mathrm{d}v}{1 + v^2} - \int \frac{v}{1 + v^2}\ \mathrm{d}v = \tan^{-1} v - \frac{\ln \left(1 + v^2\right)}{2} + \mathrm{constant}$$

Therefore, $$\tan^{-1} v - \frac{\ln \left(1 + v^2\right)}{2} = \ln \left|X\right| + \mathrm{constant}$$ i.e. $$2\tan^{-1} \frac{y - 1}{x - 2} = \ln \left[1 + \frac{\left(y - 1\right)^2}{\left(x - 2\right)^2}\right] + \ln \left(x - 2\right)^2 + \mathrm{constant}$$

However, our assignment didn't come with a standard solution, so I verified my answer with Wolfram Alpha, which gives $$2 \tan^{-1}\left(\frac{y(x) + x - 3}{-y(x) + x - 1}\right) = c_1 + \ln\left(\frac{x^2 + y(x)^2 - 2 y(x) - 4 x + 5}{2 \left(x - 2\right)^2}\right) + 2 \ln\left(x - 2\right)$$ which is different from my solution in

• the fraction inside function $$\tan^{-1}$$ is vastly different
• the denominator given by Wolfram Alpha inside the first $$\ln$$ is twice the denominator I gave
• the $$x - 2$$ in the last $$\ln$$ has no absolute value sign around it, but this seems a common problem of Wolfram Alpha solutions, so we can overlook it for the second

May I know whether I'm wrong, or that this is a problem of the Wolfram Alpha solution? (or that the two solutions are actually equivalent, though seemingly very unlikely?)

• Why don't you differentiate and check your result. – Mattos Sep 22 '18 at 7:47

We bsubstitute $$x=t+2,y=v+1$$ then we have

$$\frac{dv(t)}{dt}=\frac{gt+v(t))}{t-v(t)}$$ then we Substitute: $$v(t)=tu(t)$$

anhd we get

$$\frac{\frac{du(t)}{dt}(u(t)-1)}{-u(t)^2-1}=\frac{1}{t}$$

Solution with free CAS Maxima is $$\log{\left( {{y}^{2}}-2 y+{{x}^{2}}-4 x+5\right) }+2 \operatorname{atan}\left( \frac{x-2}{y-1}\right) =C$$ or $$\log{((x-2)^2+(y-1)^2 )}+2 \operatorname{atan}\left( \frac{x-2}{y-1}\right) =C$$ All solutions (yours, Wolfram Alpha and Maxima ) are correct.

Wolfram Alpha use substitution $$v=\frac{x + y - 3}{x - y - 1}.$$

Attached a plot showing the solutions

$$S_1\to 2 \tan ^{-1}\left(\frac{x+y-3}{x-y-1}\right)=\log \left(\frac{x^2-4 x+y^2-2 y+5}{2 (x-2)^2}\right)+2 \log (x-2)+C_0\\ S_2\to \tan ^{-1}\left(\frac{y-1}{x-2}\right)-\frac{1}{2} \log \left(\frac{(y-1)^2}{(x-2)^2}+1\right)=\log (x-2)+C_1$$

with $$C_0=0, C_1 = -1.13$$

I hope this helps.

In red $$S_1$$ and in blue $$S_2$$

One way to solve $$\frac{\mathrm{d}y}{\mathrm{d}x}=\frac{x+y-3}{x-y-1}$$ is to let $$u=x-2$$ and $$v=y-1$$. Then we get $$\frac{\mathrm{d}v}{\mathrm{d}u}=\frac{u+v}{u-v}$$ which becomes $$u\,\mathrm{d}v-v\,\mathrm{d}u=\tfrac12\mathrm{d}\!\left(u^2+v^2\right)$$ Dividing by $$u^2+v^2$$ yields $$\frac{u\,\mathrm{d}v-v\,\mathrm{d}u}{u^2+v^2}=\frac12\frac{\mathrm{d}\!\left(u^2+v^2\right)}{u^2+v^2}$$ which is $$\mathrm{d}\arctan\left(\tfrac vu\right)=\mathrm{d}\log\sqrt{u^2+v^2}$$ and thus, $$c\,e^{\arctan\left(\frac{y-1}{x-2}\right)}=\sqrt{(x-2)^2+(y-1)^2}$$ This is the Logarithmic Spiral $$r=ce^{\theta}$$ centered at $$(2,1)$$.

A More General Approach

If $$\frac{\mathrm{d}y}{\mathrm{d}x}=f\!\left(\frac yx\right)$$ then \begin{align} \frac{\mathrm{d}\frac yx}{\mathrm{d}x} &=\frac{x\frac{\mathrm{d}y}{\mathrm{d}x}-y}{x^2}\\ &=\frac{f\!\left(\frac yx\right)-\frac yx}{x} \end{align} Therefore, $$\int\frac{\mathrm{d}\frac yx}{f\!\left(\frac yx\right)-\frac yx} =\log(x)$$ Applying this to the question, after $$u=x-2$$ and $$v=y-1$$, \begin{align} \log(u) &=\int\frac{\mathrm{d}\frac vu}{\frac{1+\frac vu}{1-\frac vu}-\frac vu}\\ &=\int\frac{\left(1-\frac vu\right)\mathrm{d}\frac vu}{1+\left(\frac vu\right)^2}\\[9pt] &=\arctan\left(\frac vu\right)-\frac12\log\left(1+\left(\frac vu\right)^2\right)+C \end{align} Therefore, $$\sqrt{u^2+v^2}=c\,e^{\arctan\left(\frac vu\right)}$$