Find the solutions for $y''+y= \sin(x)$ I'm having a bit of confusion in finding the solutions to the second order differential equation: $$y''+y= \sin(x)$$
We have been told that the homogeneous solution is $0$
To find the particular solution this is what I have done so far:
$$y_p=A \sin(x)+B \cos(x)$$
$$y''_p=-A \sin(x)-B \cos(x)$$
Therefore
$$-A \sin(x)-B \cos(x)+A \sin(x)+B \cos(x)= \sin(x)$$
thus
$$0= \sin(x)$$
Does this mean that the general solution is $y=0?$
 A: $\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

$\ds{z = y' + y\ic\implies z' = y'' + y'\ic\implies \color{#f00}{y'' + y} =
\pars{z' - y'\ic} + \pars{-z\ic + y'\ic} = \color{#f00}{z' - z\ic}}$
  
  and $\bbox[8px,border:0.1em groove navy]{\ds{y = \Im\pars{z}}}$

\begin{align}
&z' - z\ic  = \sin\pars{x} \implies
\totald{\pars{\expo{-\ic x}z}}{x} = \expo{-\ic x}\sin\pars{x} =
-\,{\ic \over 2}\pars{1 - \expo{-2\ic x}}
\\[5mm] &
\expo{-\ic x}z = -\,{\ic \over 2}\,x + {\ic \over 2}{\expo{-2\ic x} \over -2\ic} + C\,,\qquad C = constant\ \in\ \mathbb{C}
\\[5mm] &
z =  -\,{\ic \over 2}\,x\expo{\ic x} - {1 \over 4}\,\expo{-\ic x} + C\expo{\ic x}
\implies
\color{#f00}{\mrm{y}\pars{x}} = \Im\pars{z} =
\color{#f00}{-\,{1 \over 2}\,x\cos\pars{x} + {1 \over 4}\,\sin\pars{x} +
\Im\pars{C\expo{\ic x}}}
\end{align}

As $\bbox[4px,#ddd]{\texttt{@Jack Lam}}$ observed, the term
  $\ds{{1 \over 4}\,\sin\pars{x}}$ can be absorbed into the last term. It's equivalent to:

$$
\color{#f00}{\mrm{y}\pars{x}} = \Im\pars{z} =
\color{#f00}{-\,{1 \over 2}\,x\cos\pars{x} +  a\sin\pars{x} + b\cos\pars{x}}\,,
\qquad a, b \in \mathbb{R}
$$

$\ds{C\ \mbox{and/or}\ \pars{~a\ \mbox{and}\ b~}}$ are determined once we know some initial conditions.

