Let $w$ be our image. For example, consider the following with the vectorized $w$: $$ E(w) = \frac 12 \|Aw+b\|_2^2 $$ I know the optimal condition of the above equation: $$ \nabla_wE = A^TA\hat w + b = 0 $$
Now, we consider the filtered image by Gaussian such that $$ E(w) = \frac 12 \|A (G * w)+b\|_2^2 $$
In this case, how to get the optimal condition? (i.e., how to derivative w.r.t $w$?)