How do you solve the separable differential equation dy/dx=(cosx)e^(y-sinx)?

Mar 10, 2017

The answer is $y = - \ln \left({e}^{-} \sin x - C\right)$

Explanation:

We need

${e}^{a - b} = {e}^{a} / {e}^{b}$

Let's rewrite and simplify the equation

$\frac{\mathrm{dy}}{\mathrm{dx}} = \cos x {e}^{y - \sin x}$

$\frac{\mathrm{dy}}{\mathrm{dx}} = \cos x {e}^{y} / {e}^{\sin} x$

$\frac{\mathrm{dy}}{e} ^ y = \cos \frac{x}{e} ^ \sin x \mathrm{dx}$

Integrating both sides

$\int \frac{\mathrm{dy}}{e} ^ y = \int \cos \frac{x}{e} ^ \sin x \mathrm{dx}$

$\int \frac{\mathrm{dy}}{e} ^ y = - {e}^{-} y$

For the $R H S$, we perform a substitution

Let $u = \sin x$, $\implies$, $\mathrm{du} = \cos x \mathrm{dx}$

$\int \cos \frac{x}{e} ^ \sin x \mathrm{dx} = \int \frac{\mathrm{du}}{e} ^ \left(u\right)$

$= - {e}^{- u}$

$= - {e}^{- \sin x}$

Therefore,

$- {e}^{-} y = - {e}^{- \sin x} + C$

${e}^{-} y = {e}^{- \sin x} - C$

$- y = \ln \left({e}^{-} \sin x - C\right)$

$y = - \ln \left({e}^{-} \sin x - C\right)$