Consider the discrete-time time-invariant system with input $x[n]$ and output $y[n]$ satisfying
$$y[n] = \sum_{k=1}^5{x[n-k]}$$
Consider approximating the desired system with a second-order IIR system with system function
$$H^{'}(z)= \frac{1}{1+a_1z^{-1}+a_2z^{-2}}$$
Use the following error criterion:
where $h_d$ is the desired impulse response. $$E = \sum_{n=-\infty}^{\infty}\left\lvert h_d[n]+a_1h_d[n-1]+a_2h_d[n-2]\right\rvert^2$$
How can the particular error function be useful in solving the system of equations or the desired impulse response?
Do I need to take derivative w.r.t both $a_1$ and $a_2$ and make it 0 to get the system of equations?
Now this is what I am getting:
$$0 = \sum_{n=-\infty}^{\infty}( h_d[n]h_d[n-1]+a_1h_d[n-1]h_d[n-1]+a_2h_d[n-2]h_d[n-1])$$
and
$$0 = \sum_{n=-\infty}^{\infty}( h_d[n]h_d[n-2]+a_1h_d[n-1]h_d[n-2]+a_2h_d[n-2]h_d[n-2])$$
Now how can I solve these system of two equations and how can I approximate the desired impulse response from that?