# Solve differential equation dy/dx+xy=xy^2

Question
Solve differential equation $$dy/dx+xy=xy^2$$

2021-01-14

$$\frac{dy}{dx}+xy=xy^2$$
$$\Rightarrow \frac{dy}{dx}= xy^2-xy$$
$$\Rightarrow \frac{dy}{dx}= xy(y-1)$$
$$\Rightarrow \frac{dy}{y(y-1)}= xdx$$
$$\frac{1}{y(y-1)}= \frac{A}{y}+\frac{B}{y-1}$$
$$\Rightarrow1= A(y-1)+By$$
$$\Rightarrow1= (A+B)y-A$$
Comparing the coefficient of y and constant term on both side, we get
$$A+B=0,\ -A=1\Rightarrow A= -1,\ B=1$$
So, we write
$$\frac{1}{y(y−1)}= -\frac{1}{y}+\frac{1}{(y−1)}$$
So, we have
$$(-\frac{1}{y}+\frac{1}{(y−1)}) dy= xdx$$
Now, we will integrate this equation on both the side
$$\int (-\frac{1}{y}+\frac{1}{(y-1)})dy= \int xdx$$ $$\Rightarrow -\ln(y)+\ln(y-1)= x^{\frac{2}{2}+C}$$
$$\Rightarrow \frac{y-1}{y}= x^{\frac{2}{2}+C}$$
$$\Rightarrow \frac{y-1}{y}= e^{x^{\frac{2}{2}+C}}$$
$$\Rightarrow \frac{y-1}{y}= e^{x^{\frac{2}{2}}}e^{C}$$
$$\Rightarrow \frac{y-1}{y}= C_{1} e^{x^{\frac{2}{2}}}$$, $$C_1=e^C$$
where C and $$C_1$$ are arbitrary constant
$$\Rightarrow y-1= C_{1} e^{\frac{x^{\frac{2}{2}}}{y}}$$
$$\Rightarrow y= C_{1} e^{x^{\frac{2}{2}}y}+1$$
$$\Rightarrow y-C e^{x^{\frac{2}{2}}}y= 1$$
$$\Rightarrow y(1-C_{1} e ^{x^{\frac{2}{2}}})=1$$
$$\Rightarrow y= \frac{1}{1-C_{1} e^{x^{\frac{2}{2}}}}$$

### Relevant Questions

Solve differential equation $$xy'+2y= -x^3+x, \ y(1)=2$$

Solve differential equation $$\frac{\cos^2y}{4x+2}dy= \frac{(\cos y+\sin y)^2}{\sqrt{x^2+x+3}}dx$$

Solve differential equation $$\displaystyle{y}{\left({2}{x}-{2}+{x}{y}+{1}\right)}{\left.{d}{x}\right.}+{\left({x}-{y}\right)}{\left.{d}{y}\right.}={0}$$
Solve differential equation $$1+y^2+xy^2)dx+(x^2y+y+2xy)dy=0$$
Solve differential equation $$\displaystyle{x}{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}-{2}{y}={x}^{{3}}{{\sin}^{{2}}{\left({x}\right)}}$$
Solve differential equation $$\displaystyle{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}={\left({x}+{y}+{1}\right)}^{{2}}-{\left({x}+{y}-{1}\right)}^{{2}}$$
Solve differential equation $$\displaystyle{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}+{\frac{{{y}}}{{{4}{x}}}}={3}{x},\ {y}{\left({2}\right)}={3}$$
Solve differential equation $$\displaystyle{2}{x}{y}-{9}{x}^{{2}}+{\left({2}{y}+{x}^{{2}}+{1}\right)}{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}={0},\ {y}{\left({0}\right)}=-{3}$$
Solve differential equation $$dy/dx= x/(ye^(x+y^2))$$
Solve differential equation $$((3y^2-t^2)/y^5)dy/dx+t/(2y^4)=0$$, y(1)=1