Suppose we're given the following: $ x[n] = 2 + (-1)^n $, and are given the impulse response $ h[n] = u[n] a^n $, of an LTI system where $ |a| < 1$. We're asked to find the output $y[n]$, if $x[n]$ is input into $y[n]$.
My approach to this problem was to find the frequency response to $x[n]$ and the frequency response to $h[n]$, multiply the two, and then find the inverse fourier transform. However, this method was quite complicated, and I ended up not being able to solve it, since I essentially got back to a form where it was just $x[n]$ convolved with $h[n]$, which is difficult to compute by hand.
The answer key has a far simpler approach where $x[n]$ is written as $2 e^{j 0 n} + e^{ j \pi n}$, evaluates the frequency response $$ H = \frac{1}{1-a e^{-j \omega}} $$ at $\omega$; values of $0$ and $\pi$, multiplies and adds the result to yield:
$$ y[n] = \frac{2}{1-a} + \frac{1}{1-a} (-1)^n $$
Why can this be done? I'm not sure I follow why $y[n]$ can essentially by written as $H(\omega)$ evaluated at a value of $\omega * x[n]$.
Can this always be done for LTI systems--even continuous systems?