We are given that
\[
y = A \sin x + B \cos x.
\]
Now, differentiate both sides of the equation with respect to \( x \):
\[
\frac{dy}{dx} = A \cos x - B \sin x.
\]
Next, differentiate the first derivative with respect to \( x \):
\[
\frac{d^2y}{dx^2} = -A \sin x - B \cos x.
\]
Now, observe that the second derivative is equal to the negative of the original function \( y \):
\[
\frac{d^2y}{dx^2} = -y.
\]
Thus, the required differential equation is:
\[
\frac{d^2y}{dx^2} + y = 0.
\]
Conclusion:
The differential equation of \( y = A \sin x + B \cos x \) is
\[
\frac{d^2y}{dx^2} + y = 0.
\]