# Solve Differential Equation dy/dx=xe^-y

In this tutorial we shall evaluate the simple differential equation of the form $\frac{{dy}}{{dx}} = x{e^{ – y}}$, and we shall use the method of separating the variables.

The differential equation of the form is given as
$\frac{{dy}}{{dx}} = x{e^{ – y}}$

Separating the variables, the given differential equation can be written as
$\begin{gathered} \frac{1}{{{e^{ – y}}}}dy = xdx \\ \Rightarrow {e^y}dy = xdx\,\,\,\,{\text{ – – – }}\left( {\text{i}} \right) \\ \end{gathered}$

With the separating the variable technique we must keep the terms $dy$ and $dx$ in the numerators with their respective functions.

Now integrating both sides of the equation (i), we have
$\int {{e^y}dy = \int {xdx} }$

Using the formulas of integration $\int {{e^x}dx = {e^x}}$ and $\int {{x^n}dx = \frac{{{x^{n + 1}}}}{{n + 1}}}$, we get
$\begin{gathered} {e^y} = \frac{1}{2}{x^2} + c \\ \Rightarrow y = \ln \left( {\frac{1}{2}{x^2} + c} \right) \\ \end{gathered}$

This is the required solution of the given differential equation.