# Solving a second order inhomogeneous differential equation with constant coeffcients

I a seeking to solve the equation: $$u'' + 2vu' + u = cos(\sigma t), \ u(0) = 1, \ u'(0) =0$$ where $0 < v < 1$. Then I have to show that the solutio is purely oscillatory (which I don't know how is defined) and find the amplitude of the solution as a function of $\sigma$.

Trying to find a particular integral ended up being horribly messy. If anyone could help it will be deeply appreciated.

-
Do you mean $2vu'$? – nbubis Feb 5 '13 at 14:32

The solution is split into a homogeneous $u^{(H)}$ solution and inhomogeneous $u^{(I)}$ solution. $u^{(H)}$ satisfies

$$u^{(H)''}+ 2 v u^{(H)'} + u^{(H)}= 0$$

Assume $u^{(H)} = A e^{r t}$. Then $r$ satisfies $r^2 + 2 v r + 1=0 \implies r = -v \pm i \sqrt{1-v^2}$ since $0<v<1$. We may then write

$$u^{(H)}(t) = e^{-v t}[ A e^{i \sqrt{1-v^2} t} + B e^{-i \sqrt{1-v^2} t}]$$

For $u^{(I)}$, guess that $u^{(I)}(t) = P \cos{(\sigma t)} + Q \sin{(\sigma t)}$. Then

$$\cos{(\sigma t)} [(1-\sigma^2) P + \sigma Q] + \sin{(\sigma t)} [(1-\sigma^2) Q - \sigma P] = \cos{(\sigma t)}$$

Equating coefficients, we get

\begin{align}(1-\sigma^2) P + \sigma Q &=1 \\ - \sigma P+ (1-\sigma^2) Q &=0\\ \end{align}

which means that

$$P = \frac{1-\sigma^2}{(1-\sigma^2)^2 + \sigma^2}$$ $$Q = -\frac{\sigma}{(1-\sigma^2)^2 + \sigma^2}$$

$A$ and $B$ are determined by the initial conditions you specified:

$$u^{(H)}(0) = 1 \implies A + B + P =1$$ $$u^{(H)'}(0) = 0 \implies ( -v + i \sqrt{1-v^2}) A + ( -v - i \sqrt{1-v^2}) B + \sigma Q =0$$

Then

$$A = (\frac{1}{2} (1-P) - \sigma Q) (1+v + i \sqrt{1-v^2})$$ $$B = \frac{1}{2} (1-P)(1-v - i \sqrt{1-v^2}) + \sigma Q (1+v + i \sqrt{1-v^2})$$

The net solution is then

$$u(t) = u^{(H)}(t) + u^{(I)}(t) = e^{-v t}[ A e^{i \sqrt{1-v^2} t} + B e^{-i \sqrt{1-v^2} t}] + P \cos{(\sigma t)} + Q \sin{(\sigma t)}$$

Note the presence of the damping term implies non-pure oscillation.

-
What's the difference between this and my solution? – nbubis Feb 5 '13 at 15:11
I was writing this because your solution at the time was not satisfactory in my opinion and I thought I could do better. In fact, you do not take into account that $0 < v < 1$ in the square root and leave it to the OP to figure out how to manipulate it. Also, your notation is inconsistent and does not distinguish between homogeneous and inhomogeneous. Furthermore, this sort of thing happens all the time; I found it very frustrating and actually posted on meta about it, but have since learned to live with it. – Ron Gordon Feb 5 '13 at 15:14
Nitpick: You shouldn't assume the general solution, $u^{(H)}$, of the homogeneous equation has the form $Ae^{rt}$; this isn't true. However, one may assume that a solution of the homogeneous equation has the form $Ae^{rt}$, and then form the general solution by taking linear combinations of the two independent solutions thus found. It should also be remarked that your guess for the particular solution does not contains terms in common with the solution to the homogeneous equation, so the guess will work. – David Mitra Feb 5 '13 at 15:45
@DavidMitra: fair enough, and I am aware. My explanation comes from the pedagogy from which I learned all of this. Thanks for the critique. – Ron Gordon Feb 5 '13 at 15:50

First find the homogeneous solution: $$u(t) = e^{\alpha t}$$ And plug it in to the homogeneous equation to find $\alpha$: $$\alpha^2+2v\alpha+1=0\ \to\ \alpha =\pm\sqrt{v^2-1}-v$$ Now it remains to find (guess) a non-homogeneous solution. Assume: $$u(t) = A\cos(\sigma t) + B\sin(\sigma t)$$ Then: $$-\sigma^2 (A\cos(\sigma t) + B\sin(\sigma t)) - 2v\sigma (A\sin(\sigma t) - B\cos(\sigma t)) + A\cos(\sigma t) + B\sin(\sigma t) =\cos(\sigma t)$$ You'll find that: $$A-2Bv\sigma -A\sigma^2 = 0$$ $$B+2Bv\sigma -B\sigma^2 = 1$$ And from here you can solve for $A,B$. The final solution is given by the sum: $$u(t) = C_1e^{(\sqrt{v^2-1}-v)t} + C_2e^{(-\sqrt{v^2-1}-v)t} + A\cos(\sigma t) + B\sin(\sigma t)$$

Now use the initial conditions: $$u(0)=1 \ \to \ C_1+C_2 +A=1$$ $$u'(0)=0 \ \to \ C_1(\sqrt{v^2-1}-v)+C_2(-\sqrt{v^2-1}-v) +B=0$$ And thus find out the constants $C_1$ and $C_2$. From the looks of it, this is not a purely oscillatory solution, since $C_1$ and $C_2$ are not zero (at least not for all values of $v$.

-