# Solve $J - X = JX$, where $J$ is the $n\times n$ matrix consisting of $1$s

So I am having a problem with a following problem:

Let there be matrix $$J\in\mathbb{R}^{n\times n}$$, which has number $$1$$ everywhere. Solve the equation for $$X$$: $$J-X=JX$$.

I think I have to apply a trace of a matrix, but I am not sure how, since you have a product of matrices on the right side.

Hint: Rewrite the equation as $$(J+I)X=J$$ and show that $$\det(J+I)\neq 0$$, so that $$X=(J+I)^{-1}J.$$ There is no need of trace.

The determinant of a matrix with all non-diagonal coefficients equal to $$1$$ and diagonal $$2$$ has been computed at this site, see for example here:

Determinant of a specially structured matrix ($a$'s on the diagonal, all other entries equal to $b$)

Finding determinant for a matrix with one value on the diagonal and another everywhere else

You may also write $$J=ee^T$$, where $$e^T=(1,1,\ldots,1)$$. The equation is then equivalent to $$ee^T-X=ee^TX$$ or $$X=e(e^T-e^TX)$$. Let $$v^T=e^T-e^TX$$. Then $$X=ev^T$$ and $$v^T=e^T-e^TX=e^T-e^Tev^T=e^T-nv^T$$. Hence $$v^T=\frac{1}{n+1}e^T$$ and $$X=ev^T=\frac{1}{n+1}ee^T=\frac{1}{n+1}J$$.

• In what form is $v^T$ here? – david1201 Feb 23 at 11:05
• @david1201 What do you mean? – user1551 Feb 23 at 11:10
• I am not sure why did you use $v^T$ and how does this matrix looks? Sorry, I have just started with learning linear algebra this week. – david1201 Feb 23 at 11:15
• @david1201 $v^T$ is defined to be $e^T-e^TX$. So, it's a row vector. – user1551 Feb 23 at 11:17