# What is the general solution of the differential equation? :  (d^2y)/(dx^2) + dy/dx - 2y = -6sin2x-18cos2x

Sep 4, 2017

$y \left(x\right) = - {e}^{- 2 x} + 3 \cos \left(2 x\right)$

#### Explanation:

We have:

$\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} + \frac{\mathrm{dy}}{\mathrm{dx}} - 2 y = - 6 \sin 2 x - 18 \cos 2 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 ' ' + y ' - 2 y = 0$

And it's associated Auxiliary equation is:

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

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

Thus the solution of the homogeneous equation is:

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

Particular Solution

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

$y = a \cos \left(2 x\right) + b \sin \left(2 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 = - 2 a \sin \left(2 x\right) + 2 b \cos \left(2 x\right)$
$y ' ' = - 4 a \cos \left(2 x\right) - 4 b \sin \left(2 x\right)$

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

$- 4 a \cos \left(2 x\right) - 4 b \sin \left(2 x\right) - 2 a \sin \left(2 x\right) + 2 b \cos \left(2 x\right) - 2 a \cos \left(2 x\right) - 2 b \sin \left(2 x\right) = - 6 \sin 2 x - 18 \cos 2 x$

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

$\cos \left(2 x\right) : - 4 a + 2 b - 2 a = - 18$
$\sin \left(2 x\right) : - 4 b - 2 a - 2 b = - 6$

Solving simultaneously we get:

$a = 3$ and $b = 0$

And so we form the Particular solution:

${y}_{p} = 3 \cos \left(2 x\right)$

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}^{- 2 x} + B {e}^{x} + 3 \cos \left(2 x\right)$ ..... [B]

Initial Conditions

We are given the initial conditions:

$y \left(0\right) = 2 , y ' \left(0\right) = 2$

Putting $x = 0$ in [B] we get:

$2 = A {e}^{0} + B {e}^{0} + 3 \cos 0 \implies A + B = - 1$

Differentiating [B] wrt $x$ we get:

$y ' \left(x\right) = - 2 A {e}^{- 2 x} + B {e}^{x} - 6 \sin \left(2 x\right)$

Putting $x = 0$ we get:

$2 = - 2 A {e}^{0} + B {e}^{0} - 6 \sin 0 \implies - 2 A + B = 2$

Solving these two new equations simultaneously we get:

$A = - 1$ and $B = 0$

$y \left(x\right) = - {e}^{- 2 x} + 3 \cos \left(2 x\right)$