karush said:
\begin{align*}\displaystyle
&c_1 \cos(3 x)+c_2 \sin(3 x) - \frac{5}{16} \cos(5 x)
\end{align*}
where does the $- \frac{5}{16} \cos(5 x)$ come from
It comes from either applying the method of undetermined coefficients, the annihilator method, and perhaps other methods I'm not thinking of at the moment. The most straightforward way I know is to use the method of undetermined coefficients.
So, we look at the RHS of the original ODE, and we see it is not a solution to the corresponding homogeneous equation, and so we say the particular solution will take the form:
$$y_p(x)=A\cos(5x)+B\sin(5x)$$
Noting that this is a sinusoid, we know immediately that:
$$y_p''(x)=-25A\cos(5x)-25B\sin(5x)$$
So, we then substitute the particular solution into the original ODE to get:
$$-25A\cos(5x)-25B\sin(5x)+9A\cos(5x)+9B\sin(5x)=5\cos(5x)$$
Arrange this as:
$$-16A\cos(5x)-16B\sin(5x)=5\cos(5x)+0\sin(5x)$$
Equating coefficients, we obtain the system:
$$-16A=5\implies A=-\frac{5}{16}$$
$$-16B=0\implies B=0$$
And so our particular solution is:
$$y_p(x)=-\frac{5}{16}\cos(5x)$$
And then by the principle of superposition, we have the general solution to the ODE:
$$y(x)=y_h(x)+y_p(x)=c_1\cos(3x)+c_2\sin(3x)-\frac{5}{16}\cos(5x)$$
Now, what if the given ODE had been:
$$y''+9y=5\cos(3x)$$
What would the form for our particular solution be?