# Solve th second order linear equations: y''+4y=\cos2x

Solve th second order linear equations:
$$\displaystyle{y}{''}+{4}{y}={\cos{{2}}}{x}$$

• Questions are typically answered in as fast as 30 minutes

### Plainmath recommends

• Get a detailed answer even on the hardest topics.
• Ask an expert for a step-by-step guidance to learn to do it yourself.

Margaret Plemons
We need to use method of variation of parameters to solve
$$\displaystyle{y}{''}+{4}{y}={\cos{{\left({2}{x}\right)}}}$$
General form of second order differential equation is $$\displaystyle{y}{''}+{P}{\left({x}\right)}{y}'+{Q}{\left({x}\right)}{y}={R}{\left({x}\right)}$$
Here,
$$\displaystyle{P}{\left({x}\right)}={0}$$
$$\displaystyle{Q}{\left({x}\right)}={4}$$
$$\displaystyle{R}{\left({x}\right)}={\cos{{\left({2}{x}\right)}}}$$
Complementary function: $$\displaystyle{\left({y}_{{c}}{\left({x}\right)}\right)}$$
For finding $$\displaystyle{y}_{{c}}{\left({x}\right)}$$ we consider the homogenous equation , $$\displaystyle{y}{''}+{4}{y}={0}$$
This is of the form , $$\displaystyle{\left({D}^{{2}}+{4}\right)}{y}={0},\ {D}={\frac{{{d}}}{{{\left.{d}{x}\right.}}}}$$
Now, let $$\displaystyle{D}={m}$$ , and finding the eigen values , we get , $$\displaystyle{m}^{{2}}+{4}={0}$$
$$\displaystyle\Rightarrow{m}^{{2}}+{4}={0}$$
$$\displaystyle\Rightarrow{m}^{{2}}=-{4}$$
$$\displaystyle\Rightarrow{m}=\pm\sqrt{{-{4}}}=\pm{2}{i}$$
We get the eigen values $$\displaystyle\pm{2}{i}$$
If the eigen values are of the form $$\displaystyle{a}\pm{i}{b}$$ then the complementary function is of the form ,
$$\displaystyle{y}_{{c}}{\left({x}\right)}={e}^{{{a}{x}}}{\left({C}_{{1}}{\cos{{\left({b}{x}\right)}}}+{C}_{{2}}{\sin{{\left({b}{x}\right)}}}\right)}$$
Here, the eigen values are $$\displaystyle\pm{2}{i}$$, therefore,
$$\displaystyle{y}_{{c}}={e}^{{{0}{x}}}{\left({C}_{{1}}{\cos{{\left({2}{x}\right)}}}+{C}_{{2}}{\sin{{\left({2}{x}\right)}}}\right)}$$
$$\displaystyle={C}_{{1}}{\cos{{\left({2}{x}\right)}}}+{C}_{{2}}{\sin{{\left({2}{x}\right)}}}$$
Hence, the complementary function is $$\displaystyle{y}_{{c}}{\left({x}\right)}={C}_{{1}}{\cos{{\left({2}{x}\right)}}}+{C}_{{2}}{\sin{{\left({2}{x}\right)}}}$$
Now, we find the particular integral.
For that we consider the complementary function $$\displaystyle{y}_{{c}}{\left({x}\right)}={C}_{{1}}{u}{\left({x}\right)}+{C}_{{2}}{v}{\left({x}\right)}$$
Since, the complementary function is $$\displaystyle{y}_{{c}}{\left({x}\right)}={C}_{{1}}{\cos{{\left({2}{x}\right)}}}+{C}_{{2}}{\sin{{\left({2}{x}\right)}}}$$ therefore,
$$\displaystyle{u}{\left({x}\right)}={\cos{{\left({2}{x}\right)}}},\ {v}{\left({x}\right)}={\sin{{\left({2}{x}\right)}}}$$
And get the particular integral as $$\displaystyle{y}_{{p}}{\left({x}\right)}={A}{u}{\left({x}\right)}+{B}{v}{\left({x}\right)}$$
Where $$\displaystyle{A}=-\int{\frac{{{v}{\left({x}\right)}{R}{\left({x}\right)}}}{{{W}{\left({x}\right)}}}}{\left.{d}{x}\right.}$$ and $$\displaystyle{B}=\int{\frac{{{u}{\left({x}\right)}{R}{\left({x}\right)}}}{{{W}{\left({x}\right)}}}}{\left.{d}{x}\right.}$$
$$\displaystyle{R}{\left({x}\right)}={\cos{{\left({2}{x}\right)}}}$$ from (1)
W is the wronskian is u and v, that is, $W(x)=\begin{vmatrix}u(x) & v(x) \\u'(x) &v'(x) \end{vmatrix}$
$\Rightarrow W=\begin{vmatrix}\cos(2x) &\sin(2x) \\-2\sin(2x) &2\cos(2x) \end{vmatrix}$
$$\displaystyle={2}{{\cos}^{{2}}{\left({2}{x}\right)}}+{2}{{\sin}^{{2}}{\left({2}{x}\right)}}={2}{\left({{\cos}^{{2}}{\left({2}{x}\right)}}+{{\sin}^{{2}}{\left({2}{x}\right)}}\right)}={2}$$
(Since, $$\displaystyle{{\cos}^{{2}}{x}}+{{\sin}^{{2}}{x}}={1}$$)
Now, we evaluate A and B.
$$\displaystyle{A}=-\int{\frac{{{v}{\left({x}\right)}{R}{\left({x}\right)}}}{{{W}{\left({x}\right)}}}}{\left.{d}{x}\right.}$$
$$\displaystyle=-\int{\frac{{{\sin{{\left({2}{x}\right)}}}{\cos{{\left({2}{x}\right)}}}}}{{{2}}}}{\left.{d}{x}\right.}$$
$$\displaystyle={\frac{{-{1}}}{{{4}}}}\int{2}{\sin{{\left({2}{x}\right)}}}{\cos{{\left({2}{x}\right)}}}{\left.{d}{x}\right.}$$
$$\displaystyle={\frac{{-{1}}}{{{4}}}}\int{\sin{{\left({4}{x}\right)}}}{\left.{d}{x}\right.}$$
$$\displaystyle={\frac{{{1}}}{{{4}}}}{\frac{{{\cos{{\left({4}{x}\right)}}}}}{{{4}}}}={\frac{{{\cos{{\left({4}{x}\right)}}}}}{{{16}}}}$$
Now we find B,
$$\displaystyle{B}=\int{\frac{{{u}{\left({x}\right)}{R}{\left({x}\right)}}}{{{W}{\left({x}\right)}}}}{\left.{d}{x}\right.}$$
$$\displaystyle=\int{\frac{{{\cos{{\left({2}{x}\right)}}}{\cos{{\left({2}{x}\right)}}}}}{{{2}}}}{\left.{d}{x}\right.}$$
$$\displaystyle={\frac{{{1}}}{{{2}}}}\int{{\cos}^{{2}}{\left({2}{x}\right)}}{\left.{d}{x}\right.}$$
$$\displaystyle={\frac{{{1}}}{{{2}}}}\int{\frac{{{1}+{\cos{{\left({4}{x}\right)}}}}}{{{2}}}}{\left.{d}{x}\right.}$$ using ($$\displaystyle{{\cos}^{{2}}{x}}={\frac{{{1}+{\cos{{2}}}{x}}}{{{2}}}}$$)
$$\displaystyle={\frac{{{1}}}{{{4}}}}\int{\left({1}+{\cos{{\left({4}{x}\right)}}}\right)}{\left.{d}{x}\right.}$$
$$\displaystyle={\frac{{{1}}}{{{4}}}}{\left({x}+{\frac{{{\sin{{\left({4}{x}\right)}}}}}{{{4}}}}\right)}$$
$$\displaystyle={\frac{{{1}}}{{{4}}}}{\left({x}+{\frac{{{\sin{{\left({4}{x}\right)}}}}}{{{4}}}}\right)}$$
Now, we have A and B as,
$$\displaystyle{A}={\frac{{{\cos{{\left({4}{x}\right)}}}}}{{{16}}}},\ {B}={\frac{{{1}}}{{{4}}}}{\left({x}+{\frac{{{\sin{{\left({4}{x}\right)}}}}}{{{4}}}}\right)}$$
Now , we put these values in particular integral $$\displaystyle{y}_{{p}}{\left({x}\right)}={A}{u}{\left({x}\right)}+{B}{v}{\left({x}\right)}$$
$$\displaystyle\Rightarrow{y}_{{p}}{\left({x}\right)}={A}{u}{\left({x}\right)}+{B}{v}{\left({x}\right)}$$
$$\displaystyle={\frac{{{\cos{{\left({4}{x}\right)}}}}}{{{16}}}}{\cos{{\left({2}{x}\right)}}}+{\frac{{{1}}}{{{4}}}}{\left({x}+{\frac{{{\sin{{\left({4}{x}\right)}}}}}{{{4}}}}\right)}{\sin{{\left({2}{x}\right)}}}$$
$$\displaystyle={\frac{{{x}}}{{{4}}}}{\sin{{\left({2}{x}\right)}}}+{\frac{{{\cos{{\left({4}{x}\right)}}}{\cos{{\left({2}{x}\right)}}}}}{{{16}}}}+{\frac{{{\sin{{\left({4}{x}\right)}}}{\sin{{\left({2}{x}\right)}}}}}{{{16}}}}$$
$$\displaystyle={\frac{{{x}}}{{{4}}}}{\sin{{\left({2}{x}\right)}}}+{\frac{{{1}}}{{{16}}}}{\left({\cos{{\left({4}{x}\right)}}}{\cos{{\left({2}{x}\right)}}}+{\sin{{\left({4}{x}\right)}}}{\sin{{\left({2}{x}\right)}}}\right)}$$
We have the identity , $$\displaystyle{\cos{{\left({x}\right)}}}{\cos{{\left({y}\right)}}}+{\sin{{\left({x}\right)}}}{\sin{{\left({y}\right)}}}={\cos{{\left({x}-{y}\right)}}}$$
$$\displaystyle\Rightarrow{y}_{{p}}{\left({x}\right)}={\frac{{{x}}}{{{4}}}}{\sin{{\left({2}{x}\right)}}}+{\frac{{{1}}}{{{16}}}}{\left({\cos{{\left({4}{x}\right)}}}{\cos{{\left({2}{x}\right)}}}+{\sin{{\left({4}{x}\right)}}}{\sin{{\left({2}{x}\right)}}}\right)}$$
$$\displaystyle={\frac{{{x}}}{{{4}}}}{\sin{{\left({2}{x}\right)}}}+{\frac{{{1}}}{{{16}}}}{\cos{{\left({4}{x}-{2}{x}\right)}}}$$
$$\displaystyle={\frac{{{x}}}{{{4}}}}{\sin{{\left({2}{x}\right)}}}+{\frac{{{1}}}{{{16}}}}{\cos{{\left({2}{x}\right)}}}$$
Now ,we have , the solution $$\displaystyle{y}{\left({x}\right)}={y}_{{c}}{\left({x}\right)}+{y}_{{p}}{\left({x}\right)}$$
$$\displaystyle\Rightarrow{y}{\left({x}\right)}={C}_{{1}}{\cos{{\left({2}{x}\right)}}}+{C}_{{2}}{\sin{{\left({2}{x}\right)}}}+{\frac{{{x}}}{{{4}}}}{\sin{{\left({2}{x}\right)}}}+{\frac{{{1}}}{{{16}}}}{\cos{{\left({2}{x}\right)}}}$$
$$\displaystyle={\left({C}_{{1}}+{\frac{{{1}}}{{{16}}}}\right)}{\cos{{\left({2}{x}\right)}}}+{C}_{{2}}{\sin{{\left({2}{x}\right)}}}+{\frac{{{x}}}{{{4}}}}{\sin{{\left({2}{x}\right)}}}$$
$$\displaystyle={C}_{{3}}{\cos{{\left({2}{x}\right)}}}+{C}_{{2}}{\sin{{\left({2}{x}\right)}}}+{\frac{{x}}{{4}}}{\sin{{\left({2}{x}\right)}}}$$
Unpled