2
$\begingroup$

Suppose $x = (x_1,...,x_n)^T$ is some vector in $\mathbb{R}^n$. I want to write the square diagonal matrix $$ \begin{bmatrix} x_1^2 & 0 & \cdots & 0 \\ 0 & x_2^2 & \cdots & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & \cdots & x_n^2 \end{bmatrix} $$

in terms of some matrix/vector operations on $x$. I'm not even sure this is possible but my first though is use somehow use the matrix $xx^T$ because it has the correct diagonal, but then I'm not really sure what to subtract to get rid of the non-diagonal entries. Thanks for the help.

$\endgroup$
2
  • $\begingroup$ so we can only use $x$ and $x^T$? or what other things can we use? $\endgroup$
    – Asinomás
    Jun 15 '17 at 0:53
  • $\begingroup$ Ideally yes only those two. But I'm open to any suggesting you have I just don't want something like $diag(x_1^2,...,x_n^2)$. $\endgroup$
    – John Doe
    Jun 15 '17 at 0:59
3
$\begingroup$

Here is a possibility for the $2\times2$ case - I think the extension to the $n\times n$ case is fairly obvious: $$\pmatrix{1&0\cr0&0\cr}\pmatrix{x\cr y\cr}\pmatrix{x&y\cr}\pmatrix{1&0\cr0&0\cr}=\pmatrix{x^2&0\cr0&0\cr}$$ and $$\pmatrix{0&0\cr0&1\cr}\pmatrix{x\cr y\cr}\pmatrix{x&y\cr}\pmatrix{0&0\cr0&1\cr}=\pmatrix{0&0\cr0&y^2\cr}$$ and adding these gives the matrix you want.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.