# How can I solve this differential equation?

## $\left({e}^{x}\right) y \frac{\mathrm{dy}}{\mathrm{dx}} = {e}^{- y} + {e}^{- 2 x} \cdot {e}^{- y}$

Feb 18, 2018

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

#### Explanation:

This is a separable differential equation , which simply means that it's possible to group the $x$ terms & $y$ terms on opposite sides of the equation. So, this is what we'll be doing first:

$\left({e}^{x}\right) y \frac{\mathrm{dy}}{\mathrm{dx}} = {e}^{- y} + {e}^{- 2 x} \cdot {e}^{- y}$

$\implies \left({e}^{x}\right) \frac{\mathrm{dy}}{\mathrm{dx}} = {e}^{- y} / y \left(1 + {e}^{- 2 x}\right)$

$\implies {e}^{x} / \left(1 + {e}^{- 2 x}\right) \frac{\mathrm{dy}}{\mathrm{dx}} = {e}^{- y} / y$

Now, we want to get dy on the side with the y's, and dx on the side with the x's. We'll need to do a bit of re-arranging:

$\frac{1 + {e}^{- 2 x}}{e} ^ x \mathrm{dx} = \frac{y}{e} ^ \left(- y\right) \mathrm{dy}$

Now, we integrate both sides:

$\int \left(\frac{1 + {e}^{- 2 x}}{e} ^ x\right) \mathrm{dx} = \int \frac{y}{e} ^ \left(- y\right) \mathrm{dy}$

Let's do each integral in in turn:

1. $\int \left(\frac{1 + {e}^{- 2 x}}{e} ^ x\right) \mathrm{dx}$

First, let's split this into 2 separate integrals by the addition/subtraction rule:

$\implies \int \left(\frac{1}{e} ^ x\right) \mathrm{dx} + \int \frac{{e}^{- 2 x}}{e} ^ x \mathrm{dx}$

These look kind of annoying. However, we can give them a bit of a makeover to make them look nicer (and much easier to solve):

$\implies \int \left({e}^{- x}\right) \mathrm{dx} + \int \left({e}^{- 3 x}\right) \mathrm{dx}$

Both of these are now simple $u$-substitution integrals. If you set $u = - x$ and $- 3 x$ respectively, you'll get the answer as:

$\implies - {e}^{- x} - {e}^{- 3 x} / 3 + C$

1. $\int \frac{y}{e} ^ \left(- y\right) \mathrm{dy}$

#If we make the negative exponent positive, we get:

$\int \left(y {e}^{y}\right) \mathrm{dy}$

We'll need to use integration by parts for this. The formula is:

$\int \left(u v\right) \mathrm{dy} = u v - \int \left(v \cdot \mathrm{du}\right)$

We're going to set $u = y$, and $\mathrm{dv} = {e}^{y} \mathrm{dy}$. The reason is that we want an easy $\mathrm{du}$ for that final integration, and also because ${e}^{y}$ is very easy to integrate.

So:
$u = y$
$\implies \mathrm{du} = \mathrm{dy}$

$\mathrm{dv} = {e}^{y} \mathrm{dy}$
$v = {e}^{y}$

Now, we just plug and chug:

$\implies \int \left(y {e}^{y}\right) \mathrm{dy} = y {e}^{y} - \int \left({e}^{y}\right) \mathrm{dy}$

$= y {e}^{y} - {e}^{y}$

Putting everything back in:

$y {e}^{y} - {e}^{y} = - {e}^{- x} - {e}^{- 3 x} / 3 + C$

Getting rid of negative exponents:

$y {e}^{y} - {e}^{y} = - \frac{1}{e} ^ \left(x\right) - \frac{1}{3 {e}^{- 3 x}} + C$

And that's a pretty decent final answer. If you wanted to solve for $y$, you could, and you'd end up with

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

Notice that we don't have a $+ C$ on the LHS of this equation. The reason for this is that even if we did put it, we would ultimately subtract it from the RHS, and an arbitrary constant minus an arbitrary constant is still (wait for it) an arbitrary constant. Hence, for these problems as long as you have your $+ C$ on any one side of the equation, you'll be fine.

Hope that helped :)