Find the minimum of $\sum_{i=1}^{n} d_{i}{x_{i}}^2$ where $d_{i}>0$ $\forall i=1, ... , n $, when $x$ is solution of $Ax=b$ For $A\in\mathcal M_{m\times n}(\Bbb R)$, let $x$ be solution of  $Ax=b$ when $A$ has full row rank. Find the minimum of $\sum\limits_{i=1}^n d_{i}x_i^2$ where $d_i>0$ $\forall i\in\{1,\ldots,n\}$.
I believe the question is related to least norm problem since with full row rank, one can find the solution of least norm problem as $x^*=A^{T}(AA^T)^{-1}b$, so I tried to divide $x$ into two components, by $x=x^*+x_N$, where $x_N$ is the component of $x$ in null space of $A$. However, it didn't help me out to find the solution for the case when $d_i>0$. Could someone enlighten me on how to solve this problem?
 A: Your hunch that this can be related to the least norm problem is correct. With that idea in mind, it's natural to try to view $\sum_i d_i x_i^2$ as the norm of some vector. Let $D = \text{diag}(\sqrt{d_1}, \ldots, \sqrt{d_n}).$ Then $\sum_i d_i x_i^2 = \| \hat{x} \|^2$ where $\hat{x} = D x.$ 
So by changing coordinates in this way, we want to find the minimum of $\| \hat{x} \|^2$ over all the solutions of $A D^{-1} \hat{x} = b,$ which you know how to do. 
A: Consider the Lagrangian $\min_x x^TDx - \lambda^T (Ax-b)$, the problem is convex.
Differentiate with respect to $x$, we have 
$$2Dx-A^T\lambda =0$$
$$x=\frac12D^{-1}A^T\lambda$$
Along with $Ax=b$, we have 
$$\frac12 AD^{-1}A^T\lambda = b$$
Now, you can solve for $\lambda$ and then solve for $x$.

Alternatively,
Express $x=x^*+x_N=x^*+B\mu$ where $B \in \mathbb{R}^{n \times k}$ is a matrix where its columns form a basis of the nullspace.
then we want to minimize
$$(x^*+B\mu )^TD(x^*+B\mu)$$
Hence, we just have to solve a quadratic equation in $\mu$.
