# Elementary Differential Equations 2.3 Problem 1: Separation of Variables

#### Find the complete solution of the differential equation $\frac{dy}{dx}=\frac{2x+2xy^2}{y+2x^2y}$.

##### SOLUTION: $\frac{dy}{dx}=\frac{2x+2xy^2}{y+2x^2y}$

By cross-multiplication, $\left(y+2x^2y\right)dy=\left(2x+2xy^2\right)dx$

Factor out common monomial factors $y\left(1+2x^2\right)dy=2x\left(1+y^2\right)dx$

Simplify $2x\left(1+y^2\right)dx-y\left(1+2x^2\right)dy=0$

Combine all terms with x, and combine all terms with y $\frac{2xdx}{\left(1+2x^2\right)}-\frac{ydy}{\left(1+y^2\right)}=0$

Since the variables are already separated, we can already apply integration. That is, $\int \frac{2dx}{1+2x^2\:}-\int \:\frac{ydy}{1+y^2}=\int \:0$

For $\int \frac{2dx}{1+2x^2\:}$

Let u= $1+2x^2$. $=\int \:\frac{\frac{1}{2}du}{u}$ $=\frac{1}{2}lnu$ $=\frac{1}{2}ln\:\left(1+2x^2\right)$

For $\int \:\frac{ydy}{1+y^2}$.

Let u= $1+y^2$ $=\int \:\frac{\frac{1}{2}du}{u}$ $=\frac{1}{2}lnu$ $=\frac{1}{2}\ln \left|1+y^2\right|$

Combining the solutions, we come up with $\frac{1}{2}ln \left(1+2x^2\right)-\frac{1}{2}\ln \left(1+y^2\right)=C$

We can simplify the solution further by applying the law of logarithms. That is $\frac{1}{2}ln \left(1+2x^2\right)-\frac{1}{2}\ln \left(1+y^2\right)=C$ $\frac{1}{2}ln\left(\frac{1+2x^2}{1+y^2}\right)=C$ $ln\sqrt{\frac{1+2x^2}{1+y^2}}=C$

That is already an acceptable answer, but we can still simplify it further by eliminating the natural logarithm. $e^{ln\:\sqrt{\frac{1+2x^2}{1+y^2}}}=e^C$ $\sqrt{\frac{1+2x^2}{1+y^2}}=e^C$

However, $e^C$ is also a constant so we can name it to another constant, say $C_1$. So, $\sqrt{\frac{1+2x^2}{1+y^2}}=C_1$

That is also an acceptable answer but we can still simplify the equation by eliminating the square root sign. That is $\left(\sqrt{\frac{1+2x^2}{1+y^2}}\right)^2=\left(C_1\right)^2$ $\frac{1+2x^2}{1+y^2}=\left(C_1\right)^2$

However, $\left(C_1\right)^2$ is another constant and we can rename it to $C_2$. That is, $\frac{1+2x^2}{1+y^2}=C_2$

Simplifying, $1+2x^2=C_2\left(1+y^2\right)$