  ## Separable Differential Equations

We have seen how one can start with an equation that relates two variables, and implicitly differentiate with respect to one of them to reveal an equation that relates the corresponding derivatives.

Now, consider this process in reverse!

Suppose we have some equation that involves the derivative of some variable. Can we get back to an equation that implicitly defines the variable whose derivative we see?

An example will make this question more concrete. Suppose we know the following:

$$\cos x + 3y^2 \frac{dy}{dx} = 0$$

We ask is it possible to find some $y$ as a (possibly implicitly-defined) function of $x$, that makes the above true?

Given the presence of the derivative, we call equations like the one above a differential equation, and finding the function $y$ (i.e., the variable/function whose derivative appears) -- even if we only define it implicitly -- is referred to as solving the differential equation in question.

Practical applications of differential equations abound, so we are frequently interested in finding their solutions. Some types of differential equations are solved in very straight-forward ways; others require more sophisticated techniques. In this first exposure to differential equations, we focus on the former.

In a separable differential equation the equation can be rewritten in terms of differentials where the expressions involving $x$ and $y$ are separated on opposite sides of the equation, respectively.

Specifically, we require a product of $dx$ and a function of $x$ on one side and a product of $dy$ and a function of $y$ on the other. From there, one simply finds antiderivatives of both sides to recover the equation that implicitly defines the variable sought.

The following provides two specific examples of solving separable differential equations. Let us start with the example differential equations we saw above:

#### Example

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

#### Solution:

First, we multiply everything by the differential $dx$ and then subtract $\cos x \, dx$ from both sides to obtain $3y^2 \, dy = -\cos x \, dx$. From there, we simply integrate both sides

$$\int 3y^2 \, dy = -\int \cos x \, dx$$

to obtain the following equation (where $C$ is an arbitrary constant) which implicitly defines $y$ in terms of $x$.

$$y^3 = -\sin x + C$$

Are you wondering why there is only one arbitrary constant $C$ written on the right, when integrating each side directly tells us $y^3 + C_1 = -\sin x + C_2$ for any constants $C_1$ and $C_2$?

Note that, in the interests of simplification and after integrating both sides of an equation, we can always move both constants to one side -- say the right side. Here, that gives us $y^3 = -\sin x + (C_2 - C_1)$. Then, note that if $C_2$ and $C_1$ are allowed to be any constants, than $C_2 - C_1$ is effectively just some arbitrary constant too. With this in mind, we write the arbitrary constant this difference represents as $C$.

Now in this particular case, note that we can easily solve for $y$ to obtain an explicit definition for $y$ as a function of $x$, as seen below. $$y = \sqrt{-\sin x + C}$$

However, solving for $y$ explicitly will often be difficult when dealing with differential equations, and we are frequently content to describe the variable in question ($y$ here) implicitly. Granted, as shown below, we might clean things up a bit by isolating the constant on one side -- although this is not necessary.

$$y^3 + \sin x = C$$

#### Example

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

#### Solution:

Here, separating the $x$ and $y$ variables requires we first factor things.

$$\frac{dy}{dx} = \frac{y^2 (1+x^2)}{x^4 (3+y^2)} = \left(\frac{y^2}{3+y^2}\right) \left(\frac{1+x^2}{x^4} \right)$$

Now, we can get write things in terms of differentials where the $x$ and $dx$ appear on one side of the equation and $y$ and $dy$ appear on the other, so that we can integrate both sides, as shown below.

$$\int \frac{3+y^2}{y^2} dy = \int \frac{1+x^2}{x^4} dx$$

We should realize that splitting each fraction allows us to easily integrate via the power rule.

$$\int (3y^{-2} + 1) \, dy = \int (x^{-4} + x^{-2}) \, dx$$

Then, upon integrating, we arrive at an implicit definition for $y$.

$$-3y^{-1} + y = -\frac{1}{3} x^{-3} - x^{-1} + C$$

Cleaning this equation up by writing things with positive exponents and isolating the $C$ on one side, we arrive at our solution.

$$-\frac{3}{y} + y + \frac{1}{3x^3} + \frac{1}{x} = C$$

The above two examples demonstrate how to find the general solution to a separable differential equation. However, with additional information we can also find a particular solution to this type of differential equation.

That is to say, we can find the solution with a particular value of $C$ that makes the additional information also true.

Consider the following example.

#### Example

Find the particular solution to $\displaystyle{x^2 \cos y \cdot \frac{dy}{dx} = (\sin^2 y)(x^4 + 1)}$ satisfying $\displaystyle{y(1) = \frac{\pi}{4}}$.

#### Solution:

First, we separate the factors relating to $x$ and $y$ to opposite sides,

$$\frac{\cos y}{\sin^2 y} dy = \frac{x^4+1}{x^2} dx$$

Then, we integrate both sides.

$$\int \frac{\cos y}{\sin^2 y} dy = \int \frac{x^4+1}{x^2} dx$$

Note a $u$-substitution is required on the left. A good choice for this substitution is $u = \sin y$, allow us to write

$$\int \frac{\cos y}{\sin^2 y} dy = \frac{1}{u^2} du = -\frac{1}{u} + C_1 = -\frac{1}{\sin y} + C_1 \quad \textrm{ for some constant } C_1$$

As for the right integral, note that splitting the fraction let's us integrate easily with the power rule.

$$\int \frac{x^4+1}{x^2} dx = \int (x^2 + x^{-2}) \, dx = \frac{1}{3}x^3 - \frac{1}{x} + C_2 \quad \textrm{ for some constant } C_2$$

Putting these last two calculations together tells us the general solution for this differential equation -- that $y$ is implicitly defined by an equation that takes the following form for some constant $C$.

$$-\frac{1}{\sin y} = \frac{1}{3}x^3 - \frac{1}{x} + C$$

Finally, we use the given additional information that $\displaystyle{y(1) = \frac{\pi}{4}}$ to find the constant $C$.

$$-\frac{1}{\frac{\sqrt{2}}{2}} = \frac{1}{3} \cdot 1^3 - \frac{1}{1} + C$$ $$-\frac{2}{\sqrt{2}} = -\frac{2}{3} + C$$ $$C = \frac{2}{3} - \frac{2}{\sqrt{2}}$$

Substituting this in our general solution above gives the particular solution we hoped to find:

$$\frac{1}{x} - \frac{1}{3}x^3 - \frac{1}{\sin y} = \frac{2}{3} - \frac{2}{\sqrt{2}}$$