Step 1: Differentiate the given function.
We are given \( y = e^{x} (A \cos x + B \sin x) \). First, find the first derivative:
\[
\frac{dy}{dx} = e^{x} (A \cos x + B \sin x) + e^{x} (-A \sin x + B \cos x)
\]
This simplifies to:
\[
\frac{dy}{dx} = e^{x} ((A + B) \cos x + (B - A) \sin x)
\]
Step 2: Differentiate again to find \( \frac{d^2 y}{dx^2} \).
Now, differentiate again to get the second derivative:
\[
\frac{d^2 y}{dx^2} = e^{x} ((A + B) \cos x + (B - A) \sin x) + e^{x} (-2A \sin x + 2B \cos x)
\]
This simplifies to:
\[
\frac{d^2 y}{dx^2} = e^{x} (-2A \sin x + 2B \cos x)
\]
Step 3: Form the differential equation.
Substitute the expressions for \( \frac{d^2 y}{dx^2} \) and \( \frac{dy}{dx} \) into the equation:
\[
\frac{d^2 y}{dx^2} - 2 \left( \frac{dy}{dx} \right) + 2y = 0
\]
Step 4: Conclusion.
Thus, the differential equation is \( \frac{d^2 y}{dx^2} - 2 \left( \frac{dy}{dx} \right) + 2y = 0 \).