Complex ($\mathbb C$) least squares derivation
Denote the complex conjugate, transpose, and conjugate transpose of the matrix $A$ as $(A^*, A^T, A^H)$ respectively.
Use the Frobenius (:) Inner Product to write the function and take its differential $$\eqalign{ f &= (Ax-b)^*:(Ax-b) \cr\cr df &= (Ax-b)^*:A\,dx \cr &= A^T(Ax-b)^*:dx \cr }$$ Since $df=\Big(\frac{\partial f}{\partial x}:dx\Big),\,$ the gradient must be $$\eqalign{ \frac{\partial f}{\partial x} &= A^T(Ax-b)^* \cr }$$ Set the gradient to zero, take the complex conjugate, and solve for $x$ $$\eqalign{ A^T(Ax)^* &= A^Tb^* \cr A^HAx &= A^Hb \cr x &= (A^HA)^{-1}A^Hb \cr &= A^{+}b \cr }$$ Notice that $x$ and $x^*$ are treated as independent variables for the purpose of differentiation.