Given the problem: $y’’+16y=\cos(4x)$
It’s particular $y$ is equal to zero. I know how to get the complementary $y$ but I had problem with the particular $y. $
\begin{align*} y_p&=A\sin(4x)+B\sin(4x)\\ y_p’&=4A\cos(4x)-4B\sin(4x)\\ y_p''&=-16A\sin(4x)-16B\cos(4x) \end{align*}
As we substitute the $y_p''$ and $y_p’$ to $y''+16y=\cos(4x),$ we get:
\begin{align*} -16A\sin(4x)-16B\cos(4x)+16(A\sin(4x)+B\sin(4x))&=\cos(4x)\\ -16A\sin(4x)-16B\cos(4x)+16A\sin(4x)+16B\sin(4x)&=\cos(4x) \end{align*}
Notice that $-16A\sin(4x)$ will cancel with $16A\sin(4x),$ the same with the $-16B\cos(4x),$ which will also cancel with $16B\cos(4x).$ The $A$ will equal $0$ and also the $B$ will equal $0.$
Is there anything wrong with the equation?
Thanks for those who could help.
The central problem here is that the RHS of your original DE contains only terms that are also in the homogeneous solution $$y_h(x)=A\cos(4x)+B\sin(4x). $$ Thus, the LHS is going to annihilate your choice of a particular solution. What to do? This is precisely the situation in which variation of parameters comes in, and allows you to find a particular solution that is NOT annihilated by the LHS. It can be shown that the correct ansatz for your particular solution is \begin{align*} y_p(x)&=Cx\cos(4x)+Ex\sin(4x)\\ y_p'(x)&=\sin (4 x) (-4 C x+E)+\cos (4 x) (C+4 E x)\\ y_p''(x)&=8 \cos (4 x) (-2 C x+E)-8 \sin (4 x) (C+2E x). \end{align*} So we plug in to get \begin{align*} &8 \cos (4 x) (-2 C x+E)-8 \sin (4 x) (C+2E x)\\ +&16\left[Cx\cos(4x)+Ex\sin(4x)\right]\\ =&\cos(4x). \end{align*} Set things equal and solve for the constants, and you've got your particular solution.