# Separable Differential Equations

This section is an essential method for solving differential equations. Especially about the `initial condition`, it is the critical information for getting the original function.

### Example

![image](https://user-images.githubusercontent.com/14041622/41338107-c03e6402-6f23-11e8-9937-be3a9bbd66b9.png) Solve:

* No we can't. Because:

  ![image](https://user-images.githubusercontent.com/14041622/41338122-cc733806-6f23-11e8-9ac7-2cda32325030.png)

### Example

![image](https://user-images.githubusercontent.com/14041622/41337076-c1600df2-6f20-11e8-9453-aa6e2e90fc4d.png) Solve:

* First to transfer same terms to the same side.
* Then take integral of each side
* Operate to get `y`

  ![image](https://user-images.githubusercontent.com/14041622/41337445-d270bfb4-6f21-11e8-81dd-aa63e137cc14.png)

### Example

![image](https://user-images.githubusercontent.com/14041622/42442167-912ddba6-839c-11e8-810a-72854466bf97.png) Solve:

* We could easily get the derivative of second equation is `y' = -2/3`.
* Let's see if two of the derivatives are equal by substitute back the `y` expression:

  ![image](https://user-images.githubusercontent.com/14041622/42442753-1c180880-839e-11e8-8b95-4badfcf9083c.png)
* Clearly they're equal. So the answer is `YES`.

### Example

![image](https://user-images.githubusercontent.com/14041622/42444282-3cc96da4-83a2-11e8-9991-a3d8c255eeda.png) Solve:

* Move the same terms to each side:

  ![image](https://user-images.githubusercontent.com/14041622/42444745-69d94854-83a3-11e8-9f4f-482aabca23c9.png)
* Take integral of both side:

  ![image](https://user-images.githubusercontent.com/14041622/42444763-761d7446-83a3-11e8-99c0-5219dfafdd63.png)
* Get that:

  ![image](https://user-images.githubusercontent.com/14041622/42444777-7fa6a4b0-83a3-11e8-920a-b58a69579613.png)
* Plug in `y(0) = 3` to get `C=4`, so the equation then be:

  ![image](https://user-images.githubusercontent.com/14041622/42444806-9c69e030-83a3-11e8-9fb6-c21d5c50c4d1.png)
* Set `y=1` and get `t = ln(1/2) = -ln(2)`

## Exponential model equations

[`►Jump to Khan academy for practice`](https://www.khanacademy.org/math/ap-calculus-ab/ab-differential-equations-new/ab-7-8/e/exponential-model-equations)

[►Refer to Khan academy: Worked example: exponential solution to differential equation](https://www.khanacademy.org/math/ap-calculus-ab/ab-differential-equations-new/ab-7-8/v/exponential-solution-to-differential-equation)

### Example

![image](https://user-images.githubusercontent.com/14041622/42394651-7b65fdf0-818d-11e8-9b12-5e6595b10b0d.png) Solve:

* Rewrite the equation, and take integral of both side:

  ![image](https://user-images.githubusercontent.com/14041622/42394806-0d49b310-818e-11e8-9c5c-73ce67fd8fa8.png)
* And we get:

  ![image](https://user-images.githubusercontent.com/14041622/42394852-2f595b90-818e-11e8-8df8-76ee6f286db5.png)
* Let's plug in `g(3)=2` to solve for `C`:

  ![image](https://user-images.githubusercontent.com/14041622/42394904-5daba2d2-818e-11e8-8222-253d51a82196.png)
* Take `C` back and get the equation for `g(x)`:

  ![image](https://user-images.githubusercontent.com/14041622/42394943-83bc49b8-818e-11e8-8306-078dcc0166ce.png)

### Example

![image](https://user-images.githubusercontent.com/14041622/42395147-5ed1d072-818f-11e8-9845-6c952b959803.png) Solve:

* We are told that the rate of change of P is proportional to P, which means in Math is:

  ![image](https://user-images.githubusercontent.com/14041622/42395276-e60d5c28-818f-11e8-9afc-7485136ec0ef.png)
* It's clear that is a `Differential Equation`, and we rewrite them and take integral of both side to get:

  ![image](https://user-images.githubusercontent.com/14041622/42395324-1970ce74-8190-11e8-94be-d834990a58bd.png)
* Solve for `C`:

  ![image](https://user-images.githubusercontent.com/14041622/42395375-44c5f09a-8190-11e8-8259-c20b80902ed7.png)
* Solve for `k`:

  ![image](https://user-images.githubusercontent.com/14041622/42407316-62132d14-81ec-11e8-8677-042e082501ca.png)
* get the `k`:

  ![image](https://user-images.githubusercontent.com/14041622/42407320-720fdcd0-81ec-11e8-8694-927c2cded1c2.png)
* Now we have the full equation, and get the result:

  ![image](https://user-images.githubusercontent.com/14041622/42407323-8407f3b4-81ec-11e8-83c1-92e9fbbc7cb5.png)
