initial value problem: y'' + 4y = f(t) , y(0)= y'(0)=0. f(t) = { 0 if t <3; t if t >3} Solve the initial value problem: 
$$y'' + 4y = f(t) , y(0)= y'(0)=0. $$
where
$$ f(t) = \begin{cases} 0 &t < 3 \\ t & t > 3\end{cases} $$
I've solved for the homogeneous equation, $y'' + 4y = 0,$ to get the general solution, 
$y = A\cos(2t) + B \sin(2t)$ for some arbitrary constants $A$ and $B$. 
But, now where do I go next? 
Thanks! 
 A: A related problem. In fact, you need to solve these two differential equations
$$ \begin{cases} y'' + 4y = 0 &t < 3 \\ y'' + 4y = t & t > 3\end{cases} .$$
A: Again, as referenced above, I would Laplace transform.  The LT of the RHS is not hard:
$$\int_0^{\infty} dt \, f(t) e^{-s t} = \int_3^{\infty} dt \, t\, e^{-s t} = \frac{(3 s+1) e^{-3 s}}{s^2}$$
The equation for the LT $Y(s)$ is then
$$Y(s) = \frac{(3 s+1) e^{-3 s}}{s^2 (s^2+4)}$$
The ILT $y(t)$ may be found by using the theory of residues on
$$y(t) = \frac{1}{i 2 \pi} \int_{c-i \infty}^{c+ i\infty} ds \frac{(3 s+1)}{s^2 (s^2+4)} e^{s (t-3)}$$
That is, for $t>3$, we close the loop to the left and sum the residues of the poles at $s=0$ and $s=\pm2 i$.  For $t<3$, we close the loop to the right and enclose no poles, so the ILT is zero there.
I will leave the details of evaluating the residues to the reader; I get
$$f(t) = \left [ \frac{t}{4} - \frac{3}{4} \cos{[2 (t-3)]} - \frac18 \sin{[2(t-3)]}\right] \theta(t-3)$$
where $\theta$ is the Heaviside step function.
A: *

*Find two solutions for for $y'' + 4y = 0$ (Set $y(t) = e^{st}$ and solve for $s$, note that $s$ may be complex. If you don't want to use complex numbers, set $y(t)=e^{\sigma t}\sin(\omega t + \phi)$ instead). 

*Combine those solutions to find a solution of the IVP $y_1'' + 4y_1 = 0$ with boundary conditions $y_1'(0) = 0$ and $y_1(0)=0$.

*Then find a solution for $y'' + 4y = t$. (Set $y(t) = At$ and solve for $A$)

*Combine the two solutions from (1) and the one from (3) to find a solution fo the IVP $y_2'' + 4y_2 = t$ with initial conditions $y_2'(3) = y_1'(3)$ and $y_2(3) = y_1(3)$ for $t \geq 3$.

*Now $$
    y(t) = \begin{cases}
      y_1(t) &\text{if $t \leq 3$} \\
      y_2(t) &\text{if $t > 3$}
    \end{cases}
  $$ is the solution you're looking for
Here's a plot of the solution as calculated by Mathematica

A: I would use a Laplace transform:
$$\scr{L}(y''+4y)=\scr{L}f(t)$$
$$s^2Y(s)+4Y(s)=F(s)$$
$$Y(s)=\frac{F(s)}{s^2+4}$$
$$y(t)=\scr{L}^{-1} \frac{f(s)}{s^2+4}$$
The Laplace transform of $f(t)$ is $\frac{1}{s^2}e^{-3s}$.
$$y(t)=\scr{L}^{-1}\frac{1}{s^2(s^2+4)}e^{-3s}$$
Using partial fraction decomposition:
$$\frac{1}{s^2(s^2+4)}=\frac{1}{4}(\frac{1}{s^2}-\frac{1}{s^2+4})$$
$$\frac{1}{4}\scr{L}^{-1}\{\frac{1}{s^2}-\frac{1}{s^2+4}\}=\frac{1}{4}t-\frac{1}{8}\sin{2t}\space u(t)$$
$$\scr{L}^{-1}e^{-3s}=\delta{(t-3)}$$
The property of convolution states that:
$$f(t) * g(t)=\scr{L}\{f(s)g(s)\}$$
$$y(t)=\int_{-\infty}^\infty\delta{(\tau-3)}(\frac{1}{4}t-\frac{1}{4}\tau-\sin{(2(t-\tau))})u(t-\tau)d\tau$$
$$y(t)=(\frac{1}{4}t-\frac{3}{4}-\frac{1}{8}\sin(2t-6))u(t-3)$$
