Answer
Hence, the only function which is a solution of the given differential equation is
\[
y=-\dfrac{1}{2}x\cos x
\]
Work Step by Step
We have the second order differential equation
\[
y^{\prime\prime}+y=\sin x....(1)
\]
We need to find which function in (a), (b), (c), or (d) is a solution for the given differential equation. For (a), we have
\[
y=\sin x
\]
We find the second derivative, yields
\begin{eqnarray*}
y^\prime=\dfrac{d}{dx}\Big[\sin x\Big]&=&\cos x\\
y^{\prime\prime}=\dfrac{d}{dx}\Big[\cos x\Big]&=&-\sin x
\end{eqnarray*}
We substitute into (1), yields
\begin{eqnarray*}
y^{\prime\prime}+y&=&-\sin x +\sin x\\
&=&0 \\
&\neq& \sin x
\end{eqnarray*}
Thus, the given function in (a) is not a solution for the given differential equation. We apply the same method for the functions in part (b), (c), and (d). For (b), we have
\[
y=\cos x\quad \Rightarrow \quad y^{\prime}=-\sin x\quad \Rightarrow \quad y^{\prime\prime}=-\cos x
\]
Hence, we have
\begin{eqnarray*}
y^{\prime\prime}+y&=&-\cos x +\cos x\\
&=&0 \\
&\neq& \sin x\quad \text{Not a solution}
\end{eqnarray*}
For (c), we have
\begin{eqnarray*}
y=\dfrac{1}{2}x\sin x\quad \Rightarrow \quad y^{\prime}&=&\dfrac{1}{2}\sin x+\dfrac{1}{2}x\cos x\\
y^{\prime\prime}&=&\dfrac{1}{2}\cos x+\dfrac{1}{2}\cos x-\dfrac{1}{2}x\sin x\\
&=&\cos x-\dfrac{1}{2}x\sin x
\end{eqnarray*}
yields
\begin{eqnarray*}
y^{\prime\prime}+y&=&\cos x-{\dfrac{1}{2}x\sin x}+{\dfrac{1}{2}x\sin x}\\
&=&\cos x \\
&\neq &\sin x\quad \text{Not a solution}
\end{eqnarray*}
For (d), we have
\begin{eqnarray*}
y=\dfrac{-1}{2}x\cos x\quad \Rightarrow \quad y^{\prime}&=&\dfrac{-1}{2}\cos x+\dfrac{1}{2}x\sin x\\
y^{\prime\prime}&=&\dfrac{1}{2}\sin x+\dfrac{1}{2}\sin x+\dfrac{1}{2}x\cos x\\
&=&\sin x+\dfrac{1}{2}x\cos x
\end{eqnarray*}
yields
\begin{eqnarray*}
y^{\prime\prime}+y&=&\sin x+\dfrac{1}{2}x\cos x-\dfrac{1}{2}x\cos x\\
&=&\sin x\quad \text{Is a solution}
\end{eqnarray*}
Hence, the only function which is a solution of the given differential equation is
\[
y=-\dfrac{1}{2}x\cos x
\]