# What is the general solution of the differential equation  (d^2y)/(dx^2) + 3dy/dx + 2y = 2sinx?

Jul 21, 2017

$y \left(x\right) = A {e}^{- x} + B {e}^{- 2 x} - \frac{3}{5} \cos x + \frac{1}{5} \sin x$

#### Explanation:

We have:

$\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} + 3 \frac{\mathrm{dy}}{\mathrm{dx}} + 2 y = 2 \sin x$ ..... [A]

This is a second order linear non-Homogeneous Differentiation Equation. The standard approach is to find a solution, ${y}_{c}$ of the homogeneous equation by looking at the Auxiliary Equation, which is the quadratic equation with the coefficients of the derivatives, and then finding an independent particular solution, ${y}_{p}$ of the non-homogeneous equation.

Complementary Function

The homogeneous equation associated with [A] is

$y ' ' + 3 y ' + 2 y = 0$

And it's associated Auxiliary equation is:

${m}^{2} + 3 m + 2 = 0$
$\left(m + 1\right) \left(m + 2\right) = 0$

Which has two real and distinct solutions $m = - 1 , - 2$

Thus the solution of the homogeneous equation is:

${y}_{c} = A {e}^{- 1 x} + B {e}^{- 2 x}$
$\setminus \setminus \setminus = A {e}^{- x} + B {e}^{- 2 x}$

Particular Solution

With this particular equation [A], a probably solution is of the form:

$y = a \cos \left(x\right) + b \sin \left(x\right)$

Where $a$ and $b$ are constants to be determined by substitution

Let us assume the above solution works, in which case be differentiating wrt $x$ we have:

$y ' \setminus \setminus = - a \sin \left(x\right) + b \cos \left(x\right)$
$y ' ' = - a \cos \left(x\right) - b \sin \left(x\right)$

Substituting into the initial Differential Equation $\left[A\right]$ we get:

$- a \cos \left(x\right) - b \sin \left(x\right) + 3 \left\{- a \sin \left(x\right) + b \cos \left(x\right)\right\} + 2 \left\{a \cos \left(x\right) + b \sin \left(x\right)\right\} = 2 \sin \left(x\right)$

$- a \cos \left(x\right) - b \sin \left(x\right) - 3 a \sin \left(x\right) + 3 b \cos \left(x\right) + 2 a \cos \left(x\right) + 2 b \sin \left(x\right) = 2 \sin \left(x\right)$

Equating coefficients of $\cos \left(x\right)$ and $\sin \left(x\right)$ we get:

$\cos \left(x\right) : - a + 3 b + 2 a = 0 \implies a + 3 b = 0$
$\sin \left(x\right) : - b - 3 a + 2 b = 2 \setminus \implies b - 3 a = 2$

Solving simultaneously we get:

$a = - \frac{3}{5}$ and $b = \frac{1}{5}$

And so we form the Particular solution:

${y}_{p} = - \frac{3}{5} \cos x + \frac{1}{5} \sin x$

General Solution

Which then leads to the GS of [A}

$y \left(x\right) = {y}_{c} + {y}_{p}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus = A {e}^{- x} + B {e}^{- 2 x} - \frac{3}{5} \cos x + \frac{1}{5} \sin x$