<s>[INST] Inverse of the matrix $$U(a,b)=\left(\begin{matrix}a&b&b&b\\b&a&b&b\\b&b&a&b\\b&b&b&a\end{matrix}\right)$$
Is there an easy way to find the inverse of $U(1,2)$ , a trick to solve this problem easy?(its part of an exam with answers)
 [/INST] Note that
$$U(a,b)U(c,d) = U(ac+3bd, bc+ad+2bd)$$
This can be seen because, if we let $A$ be the matrix each of whose entries are $1$'s, since $U(a,b)=(a-b)I+bA$, and since $A^2=4A$ 
$$((a-b)I+bA)((c-d)I+dA)$$
$$ = (a-b)(c-d)I+(b(c-d)+d(a-b)+4bd)A$$
$$= ((ac+3bd)-(bc+ad+2bd))I+(bc+ad+2bd)A$$
So, if $U(a,b)^{-1}$ exists and is equal to $U(c,d)$ for some $c,d$, then we would have $ac+3bd=1$ and $bc+ad+2bd=0$. The second equation gives us
$$bc = -(a+2b)d$$
The determinate of $U(a,b)$ is actually $(a-b)^3(a+3b)$, so suppose $U(a,b)\neq 0$, so that neither of these factors are zero. Plugging the above into the first equation,
$$-a(a+2b)d+3b^2d=b$$
$$\implies d = \frac{b}{-a^2-2ab+3b^2} = -\frac{b}{(a-b)(a+3b)}$$
Finally, 
$$c = \frac{a+2b}{(a-b)(a+3b)}$$
Therefore, assuming $a\neq b$ and $a\neq -3b$,
$$U(a,b)^{-1}=U\left(\frac{a+2b}{(a-b)(a+3b)} , -\frac{b}{(a-b)(a+3b)}\right)$$
</s>