Calculate the derivative of $$f(x) = \|Ax - b\|^2$$ where $x \in \mathbb{R}^n$, $A \in \mathbb{R}^{m \times n}$, $b \in \mathbb{R}^m$.
My approach involves replacing substituting all notation with most elementary definitions and trying to isolate particular $x_i$, such that $f(x)$ into a form $f(x) = x_i^2\cdot c_1 + x_i \cdot c_2 + c_3$, where $c_1$, $c_2$ and $c_3$ are some expressions that don't depend on $x_i$ and can be treated as constants. Then, since $i$ is arbitrary, I can make a vector of partial derivatives $\frac{\delta f}{\delta x_i}$.
However, this approach is tedious, requires multiple pages of error-prone derivations, and, judging by the context of the exercise, I'm not meant to do it this way. I wonder, is there a more proper way of approaching such problems, perhaps using row and/or column vectors?