Given \(y = \sin ax + \cos bx\), the second derivative \(y''\) is calculated as follows:
\[
y' = a \cos ax - b \sin bx
\]
\[
y'' = -a^2 \sin ax - b^2 \cos bx
\]
Adding \(b^2y\) to \(y''\):
\[
y'' + b^2y = (-a^2 \sin ax - b^2 \cos bx) + b^2(\sin ax + \cos bx)
\]
\[
= -a^2 \sin ax
\]
This gives the expression \((b^2 - a^2)\sin ax\), confirming the correct answer.