# Separation of Variables

Author: John J Weber III, PhD Corresponding Textbook Sections:

• Section 2.2 – Separation of Variables

## Expected Educational Results

• Objective 5–1: I understand when the method of separation of variables is appropriate to solve ordinary differential equations.

• Objective 5–2: I can solve ordinary differential equations using the method of separation of variables.

• Objective 5–3: I can solve initial value problems using the method of separation of variables.

### Definition: Separable DE

If $f\left(x,y\right)$$\displaystyle f(x,y)$ can be written as the product $g\left(x\right)h\left(y\right)$$\displaystyle g(x)h(y)$, then the DE $\frac{dy}{dx}=f\left(x,y\right)$$\displaystyle \frac{dy}{dx}=f(x,y)$ is separable.

#### Method

1. Factor $f\left(x,y\right)$$\displaystyle f(x,y)$ into $g\left(x\right)h\left(y\right)$$\displaystyle g(x)h(y)$;

2. Rewrite $\frac{dy}{dx}=f\left(x,y\right)$$\displaystyle \frac{dy}{dx}=f(x,y)$ into $\frac{dy}{h\left(y\right)}=g\left(x\right)dx$$\displaystyle \frac{dy}{h(y)}={g(x)}dx$;

3. Integrate both sides of equation: $\int \frac{dy}{h\left(y\right)}=\int g\left(x\right)dx$$\displaystyle \int{\frac{dy}{h(y)}}=\int{{g(x)}dx}$;

4. Solve for $y$$y$, i.e., find an explicit solution, if possible. If it is not possible to solve for $y$$y$, leave the answer as an implicit solution;

5. If there is an initial condition, $y\left({x}_{0}\right)={y}_{0}$$\displaystyle y(x_0)=y_0$, use it to find the constant, $C$$C$;

6. Check for any missing solutions.

NOTE: If the solution to an ODE contains an integral that does not have an analytical antiderivative, then write the solution as an integral equation.

#### ODE Solution as Integral Equation

Example: Solve $\frac{dy}{dx}=\frac{{e}^{{x}^{2}}}{y}$$\displaystyle \frac{dy}{dx}=\frac{e^{x^2}}{y}$.

Rewriting, we obtain

$y\phantom{\rule{0.167em}{0ex}}dy={e}^{{x}^{3}}\phantom{\rule{0.167em}{0ex}}dx$$y\,dy = e^{x^3}\,dx$

This implies

$\int y\phantom{\rule{0.167em}{0ex}}dy=\int {e}^{{x}^{3}}\phantom{\rule{0.167em}{0ex}}dx$$\int{y\,dy} = \int{e^{x^3}\,dx}$

which implies

$\frac{1}{2}{y}^{2}=\int {e}^{{x}^{3}}\phantom{\rule{0.167em}{0ex}}dx$$\dfrac{1}{2}y^2 = \int{e^{x^3}\,dx}$

which implies

$\frac{1}{2}{y}^{2}={\int }_{a}^{x}{e}^{{t}^{3}}\phantom{\rule{0.167em}{0ex}}dt$$\dfrac{1}{2}y^2 = \int_a^x{e^{t^3}\,dt}$

NOTE: There is no analytic antiderivative to $\int {e}^{{x}^{3}}\phantom{\rule{0.167em}{0ex}}dx$$\displaystyle\int{e^{x^3}\,dx}$. Thus, the last line above is the solution to the ODE and is written as an integral equation using Fundamental Theorem of Calculus -- Part I.

#### Investigation 01

For each of the following, determine if the first-order ODE can be solved using separation of variables. Explain.

1. $\frac{dy}{dx}=3{x}^{2}{e}^{-y}$$\displaystyle \frac{dy}{dx}=3x^2e^{-y}$

2. $\mathrm{csc}\left(x\right)\frac{dy}{dx}={x}^{2}y$$\displaystyle \csc{(x)}\frac{dy}{dx}=x^2y$

3. $\frac{dy}{dx}=\frac{y}{x}$$\displaystyle \frac{dy}{dx}=\frac{y}{x}$

4. $x{\mathrm{sin}}^{2}\left(y\right)\frac{dy}{dx}={x}^{2}+1$$\displaystyle x\sin^2{(y)}\frac{dy}{dx}=x^2+1$

5. ${y}^{\prime }={e}^{2x+y}$$\displaystyle y^{\prime}=e^{2x+y}$

6. ${y}^{\prime }=\frac{y+1}{x-1}$$\displaystyle y^{\prime}=\frac{y+1}{x-1}$

7. ${y}^{\prime }=\frac{xy}{x+1}$$\displaystyle y^{\prime}=\frac{xy}{x+1}$

8. ${y}^{\prime }=\frac{xy+2y-x-2}{xy-3y+x-3}$$\displaystyle y^{\prime}=\frac{xy+2y-x-2}{xy-3y+x-3}$

9. $\frac{dy}{dx}={x}^{2}+{y}^{3}$$\displaystyle \frac{dy}{dx}=x^2+y^3$

#### Investigation 02

Find the general solution to the following first-order ODEs using separation of variables [do not forget $+C$$+C$], if possible:

1. $\frac{dy}{dx}=3{x}^{2}{e}^{-y}$$\displaystyle \frac{dy}{dx}=3x^2e^{-y}$

2. $\mathrm{csc}\left(x\right)\frac{dy}{dx}={x}^{2}y$$\displaystyle \csc{(x)}\frac{dy}{dx}=x^2y$

3. $\frac{dy}{dx}=\frac{y}{x}$$\displaystyle \frac{dy}{dx}=\frac{y}{x}$

4. $x{\mathrm{sin}}^{2}\left(y\right)\frac{dy}{dx}={x}^{2}+1$$\displaystyle x\sin^2{(y)}\frac{dy}{dx}=x^2+1$

5. ${y}^{\prime }={e}^{2x+y}$$\displaystyle y^{\prime}=e^{2x+y}$

6. ${y}^{\prime }=\frac{y+1}{x-1}$$\displaystyle y^{\prime}=\frac{y+1}{x-1}$

7. ${y}^{\prime }=\frac{xy}{x+1}$$\displaystyle y^{\prime}=\frac{xy}{x+1}$

8. ${y}^{\prime }=\frac{xy+2y-x-2}{xy-3y+x-3}$$\displaystyle y^{\prime}=\frac{xy+2y-x-2}{xy-3y+x-3}$

9. $\frac{dy}{dx}={x}^{2}+{y}^{3}$$\displaystyle \frac{dy}{dx}=x^2+y^3$

#### Investigation 03

Find the particular solution to the following first-order IVPs using separation of variables, if possible

1. $x\frac{dy}{dx}={y}^{2}+1$$\displaystyle x\frac{dy}{dx}=y^2+1$, $y\left(1\right)=1$$y(1)=1$

2. ${y}^{\prime }={y}^{2}-{y}^{2}{e}^{3x}$$\displaystyle y^{\prime}=y^2-y^2e^{3x}$, $y\left(0\right)=1$$y(0)=1$

3. ${y}^{\prime }=5xy-2x$$\displaystyle y^{\prime}=5xy-2x$, $y\left(0\right)=1$$y(0)=1$