# Solve the following differential equation : $$\large \frac{dy}{dx}=\frac{x(2y-x)}{x(2y+x)},$$ if y = 1 when x = 1.

Toolbox:
• A function is said to be homogenous function in degree n if $F(kx,ky) = k^nF(x,y)$ for any non zero constant $k.$
• To solve these type of homogenous functions we make the substitution $y = vx$ hence $\large\frac{dy}{dx}$$= v+x\large\frac{dv}{dx} Step 1: \large\frac{dy}{dx}=\frac{x(2y-x)}{x(2y+x)} \quad\;\;\;=\large\frac{2y-x}{2y+x} Clearly this is a homogeneous differential equation. Put y=vx On differentiating w.r.t x we get, \large\frac{dy}{dx}$$=v+x\large\frac{dv}{dx}$
$v+x\large\frac{dv}{dx}=\frac{2vx-x}{2vx+x}$
$x\large\frac{dv}{dx}=\frac{2v-1}{2v+1}$$-v \quad\quad=\large\frac{2v-1-2v^2-v}{2v+1} x\large\frac{dv}{dx}=\frac{-(2v^2-v+1)}{2v+1} Step 2: Now separating the variables we get, \large\frac{2v+1}{2v^2-v+1}$$dv=-\large\frac{dx}{x}$
Integrate on both sides,
$\int \large\frac{2v+1}{2(v^2-\large\frac{v}{2}+\frac{1}{2})}=-\int \large\frac{dx}{x}$
$\large\frac{1}{2}\int \large\frac{2v+1}{v^2-\large\frac{v}{2}+\frac{1}{2}}=-\int\large\frac{dx}{x}$
$\int \large\frac{2v-\large\frac{1}{2}+\frac{3}{2}}{v^2-\large\frac{v}{2}+\frac{1}{2}}=-\int\large\frac{2dx}{x}$
$\int\large\frac{2v-\large\frac{1}{2}}{v^2-\large\frac{v}{2}+\frac{1}{2}}$$dv+\large\frac{3}{2}\int\large\frac{dv}{(v^2-\large\frac{v}{2}+\frac{1}{2})}=$$-2\int\large\frac{dx}{x}$
$\int\large\frac{2v-\large\frac{1}{2}}{v^2-\large\frac{v}{2}+\frac{1}{2}}$$dv+\large\frac{3}{2}\int\large\frac{dv}{(v-\large\frac{1}{4})^2+(\frac{\sqrt 7}{4})^2}=$$-2\int\large\frac{dx}{x}$
$\log(v^2-\large\frac{v}{2}+\frac{1}{2})+\frac{3}{2}\times \frac{4}{\sqrt 7}$$\tan^{-1}\large\frac{v-\large\frac{1}{4}}{\sqrt/4}=$$-2\log x+c$
Step 3:
Substituting for $v$ we get,
$\log (\large\frac{y^2}{x^2}-\frac{y}{2x}+\frac{1}{2})+\frac{6}{\sqrt 7}$$\tan^{-1}\bigg(\large\frac{y/x-1/4}{\sqrt 7/4}\bigg)$$=-2\log x+c$
$\log (\large\frac{y^2}{x^2}-\frac{y}{2x}+\frac{1}{2})+\frac{6}{\sqrt 7}$$\tan^{-1}\bigg(\large\frac{4y-x}{x\sqrt 7}\bigg)$$=-2\log x+c$
Step 4:
When $x=1$ and $y=1$
$\log\big(\large\frac{1}{1}-\frac{1}{2}+\frac{1}{2})+\frac{6}{\sqrt 7}$$\tan^{-1}\big(\large\frac{4-1}{\sqrt 7}\big)$$=-2\log(1)+c$
But $\log(1)=0$
$\therefore c=\large\frac{6}{\sqrt 7}$$\tan^{-1}\big(\large\frac{3}{\sqrt 7}\big) The required solution is \log\big(\large\frac{y^2}{x^2}-\frac{y}{2x}+\frac{1}{2})+\frac{6}{\sqrt 7}$$\tan^{-1}\big(\large\frac{4y-x}{x\sqrt 7}\big)+\frac{6}{\sqrt 7}$$\tan^{-1}\big(\large\frac{3}{\sqrt 7}\big)$$=-2\log x$