The given function is $y=a \cos x+b \sin x$ $(1)$.
Differentiating both sides of equation $(1)$ with respect to $x$,we get:
$\frac{d y}{d x} = -a \sin x + b \cos x$.
Differentiating again with respect to $x$,we get:
$\frac{d^{2} y}{d x^{2}} = -a \cos x - b \sin x$.
Now,substitute the values of $\frac{d^{2} y}{d x^{2}}$ and $y$ into the given differential equation:
$L.H.S. = \frac{d^{2} y}{d x^{2}} + y = (-a \cos x - b \sin x) + (a \cos x + b \sin x)$.
Simplifying the expression:
$L.H.S. = -a \cos x - b \sin x + a \cos x + b \sin x = 0$.
Since $L.H.S. = R.H.S. = 0$,the given function is indeed a solution of the differential equation.