# What is the general solution of the differential equation  dy/dx - 2y + a = 0 ?

Mar 16, 2017

Use the separation of variables method.

#### Explanation:

Given: $\frac{\mathrm{dy}}{\mathrm{dx}} - 2 y + a = 0$

Add $2 y - a$ to both sides:

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 y - a$

Multiply both sides by $\frac{\mathrm{dx}}{2 y - a}$:

$\frac{\mathrm{dy}}{2 y - a} = \mathrm{dx}$

$\frac{1}{2} \frac{\mathrm{dy}}{y - \frac{a}{2}} = \mathrm{dx}$

Integrate both sides:

$\frac{1}{2} \int \frac{\mathrm{dy}}{y - \frac{a}{2}} = \int \mathrm{dx}$

$\frac{1}{2} \ln \left(y - \frac{a}{2}\right) = x + C$

Multiply both sides by 2:

$\ln \left(y - \frac{a}{2}\right) = 2 x + C$

Use the exponential function on both sides:

${e}^{\ln \left(y - \frac{a}{2}\right)} = {e}^{2 x + C}$

The inverses on the left disappear:

$y - \frac{a}{2} = {e}^{2 x + C}$

Adding an arbitrary constant in the exponent is the same a multiplying by an arbitrary constant:

$y - \frac{a}{2} = C {e}^{2 x}$

Add $\frac{a}{2}$ to both sides:

$y = C {e}^{2 x} + \frac{a}{2}$

Mar 16, 2017

$y = \frac{1}{2} a + C {e}^{2 x}$

#### Explanation:

First write the DE in standard form:

$\frac{\mathrm{dy}}{\mathrm{dx}} - 2 y + a = 0$
$\therefore \frac{\mathrm{dy}}{\mathrm{dx}} - 2 y = - a$ ... [1]

This is a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

$\frac{\mathrm{dy}}{\mathrm{dx}} + P \left(x\right) y = Q \left(x\right)$

This is a standard form of a Differential Equation that can be solved by using an Integrating Factor:

$I = {e}^{\int P \left(x\right) \mathrm{dx}}$
$\setminus \setminus = {e}^{\int \setminus - 2 \setminus \mathrm{dx}}$
$\setminus \setminus = {e}^{- 2 x}$

And if we multiply the DE [1] by this Integrating Factor we will have a perfect product differential;

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

This has converted our DE into a First Order separable DE which we can now just separate the variables to get;

$y {e}^{- 2 x} = \int \setminus - a {e}^{- 2 x} \setminus \mathrm{dx}$

Which we can easily integrate to get:

$y {e}^{- 2 x} = \frac{1}{2} a {e}^{- 2 x} + C$
$\therefore y = \frac{1}{2} a + C {e}^{2 x}$