<s>[INST] Is there any procedure to compute the root of a matrix equation?? Actually I want to know the procedure, how could we calculate the value of $A$ where 
$A^2$= $\begin{pmatrix} x & y\\ z & w\\ \end{pmatrix}$
 [/INST] $A=\begin{pmatrix} x & y\\ z & w\\ \end{pmatrix}$
You want to find $B=\begin{pmatrix} a & b\\ c & d\\ \end{pmatrix}$ so that $B^2=A$
You can just calculate $B^2$ and solve for $a,b,c,d$ but a better way of doing it is to notice that $A$ commutes with $B$: $AB=B^2B=B^3=BB^2=BA$
From that, you can calculate $AB$ and $BA$ and since you know they are equal, it'll simplify $B$.
$AB=\begin{pmatrix} x & y\\ z & w\\ \end{pmatrix}\begin{pmatrix} a & b\\ c & d\\ \end{pmatrix}=\begin{pmatrix} xa+yc & xb+yd\\za+wc & zb+wd\\ \end{pmatrix}$
$BA=\begin{pmatrix} a & b\\ c & d \end{pmatrix}\begin{pmatrix} x & y\\ z & w\end{pmatrix}=\begin{pmatrix} xa+zb & ya+wb\\ xc+zd & yc+wd\end{pmatrix}$
$\begin{pmatrix} 0 & 0\\ 0 & 0 \end{pmatrix}=AB-BA=\begin{pmatrix} xa+yc & xb+yd\\za+wc & zb+wd \end{pmatrix}-\begin{pmatrix} xa+zb & ya+wb\\ xc+zd & yc+wd\end{pmatrix}=\begin{pmatrix} yc-zb & *\\* & zb-yc \end{pmatrix}$
So you get that $zb=yc$ which helps you simplify $B$:


*

*If $z=0=y$ then $A=\begin{pmatrix} x & 0\\ 0 & w \end{pmatrix}$ is diagonal so you can just take $B=\begin{pmatrix}a & 0\\ 0 & d \end{pmatrix}$ where $a^2=x$ and $d^2=2$

*If $y\not= 0$, you get $c=\cfrac{z}{y}b$ so $B=\begin{pmatrix} a & b\\ \cfrac{z}{y}b & d\\ \end{pmatrix}$

*If $z\not= 0$, you get $b=\cfrac{y}{z}c$ so $B=\begin{pmatrix} a & \cfrac{y}{z}c\\ c & d\\ \end{pmatrix}$
Then you just calculate $B^2$ and solve for $a,b,c,d$ (or the ones that remain in the expression of $B$).

By the way there are some matrix that do no have a square root.
$A=\begin{pmatrix} 0 & 1\\ 0 & 0\\ \end{pmatrix}$
$y=1\not= 0$ so we have $B=\begin{pmatrix} a & b\\ \cfrac{z}{y}b & d\\ \end{pmatrix}=\begin{pmatrix} a & b\\ 0 & d\\ \end{pmatrix}$
Now $B^2=\begin{pmatrix} a & b\\ 0 & d\\ \end{pmatrix}\begin{pmatrix} a & b\\ 0 & d\\ \end{pmatrix}=\begin{pmatrix} a^2 & (a+d)b\\ 0 & d^2\\ \end{pmatrix}$
We want $B^2=A$, that is $\begin{pmatrix} a^2 & (a+d)b\\ 0 & d^2\\ \end{pmatrix}=\begin{pmatrix} 0 & 1\\ 0 & 0\\ \end{pmatrix}$
which implies $a=0=d$ and $1=(a+d)b=0b=0$ so you can not find a $B$ so that $B^2=A$
</s>