I want to differentiate the following equation
$$ x \mapsto \|x\|^2 + \lambda{\|Ax - b\|}^2 $$
where the real symmetric matrix $A$ is not invertible. I have decomposed $A$ using the spectral theorem, but stuck on how to then differentiate the function w.r.t to $x$. The function then looks like
$$ x \mapsto \|x\|^2 + \lambda {\left\| Q B Q^{-1} x - b \right\|}^2 $$
How do I differentiate this now?