# Ordinary Differential Equations/Exact 2

First Order Differential Equations

This page details a method for finding the solutions to equations of the form

${\displaystyle {\frac {dy}{dx}}+P(x)y=Q(x),}$

Using the Integrating Factor: ${\displaystyle I(x)=e^{\int P(x)dx}}$

## Example 1

Consider the following equation:

${\displaystyle {\frac {dy}{dx}}+3y=xe^{-3x}+1}$

Now the ${\displaystyle P(x)=3}$ So the integrating factor is:

${\displaystyle I(x)=e^{\int P(x)dx}}$
${\displaystyle I(x)=e^{\int 3dx}}$
${\displaystyle I(x)=e^{3x}}$

Multiply the original equation by ${\displaystyle I(x)}$

${\displaystyle e^{3x}{\frac {dy}{dx}}+e^{3x}3y=e^{3x}(xe^{-3x}+1)}$
${\displaystyle e^{3x}{\frac {dy}{dx}}+e^{3x}3y=x+e^{3x}}$

Then try: ${\displaystyle {\frac {d}{dx}}(ye^{3x})=e^{3x}{\frac {dy}{dx}}+e^{3x}3y}$

Which is equal to the LHS giving us:

${\displaystyle {\frac {d}{dx}}(ye^{3x})=x+e^{3x}}$

Then integrate with respect to x:

${\displaystyle \int {\frac {d}{dx}}(ye^{3x})dx=\int xdx+\int e^{3x}dx}$

Giving:

${\displaystyle ye^{3x}={\frac {x^{2}}{2}}+{\frac {e^{3x}}{3}}+C}$
${\displaystyle y={\frac {x^{2}}{2e^{3x}}}+{\frac {1}{3}}+Ce^{-3x}}$ (This is the general solution)