$
\textbf{Problem:} \\\\
\text{(a) Find the general solution for equation: } \ y'' -4y' + 5y = 30 + 40cos(3t) \\\\
\text{(b) Find solution that satisfies:} \ y(0) = 0, y'(0) = 0
$
$
\textbf{Solution for part (a): } \\\\
\text{Solve for homogenous solution:} \\\\
\begin{gather}
\begin{aligned}
r^{2} - 4r + 5 = 0 \Longrightarrow r = 2 \pm i \\\\
\end{aligned}
\end{gather}
$
$
\text{Therefore, } \\\\
\begin{gather}
\begin{aligned}
y_h = c_1 e^{2t}cos(t) + c_2 e^{2t}sin(t)
\end{aligned}
\end{gather}
$
$
\text{Let } y_p = At+B+Csin(3t)+Dcos(3t) \ \text{ , then we have} \\\\
\begin{gather}
\begin{aligned}
y'_p &= A+3Ccos(3t) -3Dsin(3t) \\\\
y''_p &= -9Csin(3t)-9Dcos(3t)
\end{aligned}
\end{gather}
$
$
\text{Plug them in the original equation, we have: } \\\\
\begin{gather}
\begin{aligned}
y'' -4y' + 5y &= -9Csin(3t)-9Dcos(3t) -4(A+3Ccos(3t) -3Dsin(3t)) + 5(At+B+Csin(3t)+Dcos(3t)) \\\\
&= 30 + 40cos(3t)
\end{aligned}
\end{gather}
$
$
\text{Solve for parameter A, B, C, and D, we get } A=0 ,\ B=6,\ C=-3,\ D=-1\\\\
\text{Thus we have: } \\\\ \\\\
\begin{gather}
\begin{aligned}
Y &= y_h + y_p \\\\
&= c_1 e^{2t}cos(t) + c_2 e^{2t}sin(t) -3sin(3t) -cos(3t) + 6
\end{aligned}
\end{gather}
$
$
\textbf{Solution for part (b): } \\\\
$
$
\text{Plug in } y(0)=0 \text{, we get } \ c_1 = -5 \text{, thus we have } \\\\
\begin{gather}
\begin{aligned}
Y = -5e^{2t}cos(t) + c_2 e^{2t}sin(t) -3sin(3t) -cos(3t) + 6
\end{aligned}
\end{gather}
$
$
\text{Now consider } y'(0)=0 \text{, then we have:}\\\\
\begin{gather}
\begin{aligned}
0 = -5(2e^{2t}cos(t) - e^{2t}sin(t)) + c_2(2e^{2t}sin(t)+e^{2t}cos(t)) - 9cos(3t) + 3sin(3t) \\\\
\Longrightarrow c_2 = 19
\end{aligned}
\end{gather}
$
$
\text{Thus the solution is:}\\\\
\begin{gather}
\begin{aligned}
Y = -5e^{2t}cos(t) + 19 e^{2t}sin(t) -3sin(3t) -cos(3t) + 6
\end{aligned}
\end{gather}
$