# What is the general solution of the differential equation? : y''+4y=2sin2x

May 27, 2018

The general solution is $y = {c}_{1} \cos \left(2 x\right) + {c}_{2} \sin \left(2 x\right) - \frac{1}{2} x \cos 2 x$

#### Explanation:

$y ' ' + 4 y = 2 \sin \left(2 x\right)$

This is a second order linear, non-homogenous ODE.

The general solution can be written as

$y = {y}_{h} + {y}_{p}$

Find ${y}_{h}$ by solving

$y ' ' + 4 y = 0$

Solve the caracteristic equation

${r}^{2} + 4 = 0$

$r = \pm 2 i$ where ${i}^{2} = - 1$

The solution is

${y}_{h} = {c}_{1} \cos \left(2 x\right) + {c}_{2} \sin \left(2 x\right)$

Find a particular solution of the form

${y}_{p} = {a}_{0} x \sin 2 x + {a}_{1} x \cos 2 x$

${y}_{p} ' = 2 {a}_{0} x \cos 2 x + {a}_{0} \sin 2 x - 2 {a}_{1} x \sin 2 x + {a}_{1} \cos 2 x$

${y}_{p} ' ' = - 4 {a}_{0} x \sin 2 x + 2 {a}_{0} \cos 2 x + 2 {a}_{0} \cos 2 x - 4 {a}_{1} x \cos 2 x - 2 {a}_{1} \sin 2 x - 2 {a}_{1} \sin 2 x$

$= - 4 {a}_{0} x \sin 2 x + 4 {a}_{0} \cos 2 x - 4 {a}_{1} x \cos 2 x - 4 {a}_{1} \sin 2 x$

Plugging those values in the ODE

$y ' ' + 4 y = 2 \sin \left(2 x\right)$

$- 4 {a}_{0} x \sin 2 x + 4 {a}_{0} \cos 2 x - 4 {a}_{1} x \cos 2 x - 4 {a}_{1} \sin 2 x + 4 \left({a}_{0} x \sin 2 x + {a}_{1} x \cos 2 x\right) = 2 \sin 2 x$

$- 4 {a}_{0} x \sin 2 x + 4 {a}_{0} \cos 2 x - 4 {a}_{1} x \cos 2 x - 4 {a}_{1} \sin 2 x + 4 {a}_{0} x \sin 2 x + 4 {a}_{1} x \cos 2 x = 2 \sin 2 x$

$4 {a}_{0} \cos 2 x - 4 {a}_{1} \sin 2 x = 2 \sin 2 x$

$\iff$, $\left\{\begin{matrix}{a}_{0} = 0 \\ {a}_{1} = - \frac{1}{2}\end{matrix}\right.$

${y}_{p} = - \frac{1}{2} x \cos 2 x$

The general solution is $y = {c}_{1} \cos \left(2 x\right) + {c}_{2} \sin \left(2 x\right) - \frac{1}{2} x \cos 2 x$

May 27, 2018

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

#### Explanation:

We have:

$y ' ' + 4 y = 2 \sin 2 x$ ..... [A]

This is a second order 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 ' ' + 4 y = 0$

And it's associated Auxiliary equation is:

${m}^{2} + 4 = 0$

Which has two pure imaginary solutions $m = \pm 2 i$

Thus the solution of the homogeneous equation is:

${y}_{c} = {e}^{0 x} \left\{A \cos \left(2 x\right) + B \sin \left(2 x\right)\right\}$
$\setminus \setminus \setminus = A \cos \left(2 x\right) + B \sin \left(2 x\right)$

Particular Solution

With this particular equation [A], a probable 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. However, this solution is part of ${y}_{c}$, thus we seek an alternate independant solution of the form:

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

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

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

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

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

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

$\cos \left(2 x\right) : 4 b = 0 \implies b = 0$
$\sin \left(2 x\right) : - 4 a = 2 \implies a = - \frac{1}{2}$

And so we form the Particular solution:

${y}_{p} = - \frac{1}{2} x \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 \cos \left(2 x\right) + B \sin \left(2 x\right) - \frac{1}{2} x \cos \left(2 x\right)$