Square root of a $2 \times 2$ matrix 
How can I find the square root of the following non-diagonalisable matrix?
$$\begin{pmatrix}
  5 & -1 \\
  4 & 1
 \end{pmatrix}$$

I have shown that
$$A^{n}=3^{n-1}\begin{pmatrix}
  2n+3 & -n \\
  4n & 3-2n
 \end{pmatrix}$$
though I'm not sure how to use this fact.
 A: A direct computation starting with an arbitrary matrix $A$ with $A^2$ equal to the above matrix yields $4$ quadratic equations in $4$ variables, and we obtain
$$
A=\frac{1}{\sqrt{3}}\begin{pmatrix} 4 & -\frac{1}{2} \cr 2 & 2 \end{pmatrix}.
$$
Of course, also $-A$ is a solutions.
Remark: In fact, we may reduce the system of equations to only two equations
$$
b^2-4a^2+20=0,\quad b^2-2ab+4=0.
$$
A: In general if $A$ is an $n$ by $n$ matrix conjugated to $B=c (I + N)$ with $c>0$ and $N$ nilpotent (i.e. $N^2=0$) then $A^p$ is conjugated to $B^p=c^p(I+pN)$ for any real value of $p$. You may check this for integer $p$, which extends to rational and then  to real (and with some care, to complex numbers) by completion. 
So all you need is to rewrite your matrix in Jordan form
and take the square root of the Jordan form:
In our case you may pick  $P=\left(\begin{matrix} 1 & 2 \\ 2 &1 \end{matrix}\right)$ (the first vector is in the kernel of $A-3I$, the other is in the kernel of $(A-eI)^2=0$, whence arbitrary in the present case). Then
$$ A P = P 
\left(\begin{matrix} 3 & 3 \\ 0 &3 \end{matrix}\right)= PB=P \times 3  (I+ N), \ \  \mbox{with} \ \ 
N=\left(\begin{matrix} 0 & 1 \\ 0 &0 \end{matrix}\right).
$$
Then:
 $$ B^{1/2} = \sqrt{3} \left(\begin{matrix} 1 & \frac{1}{2} \\ 0 & 1 \end{matrix}\right)$$
This happens to yield
$$ A^{1/2}= P B^{1/2} P^{-1} = \frac{1}{\sqrt{3}}  \left(\begin{matrix} 4 & \frac{-1}{2}\\ 2 & 2\end{matrix}\right).$$
In our 2 by 2 case the solution is unique up to sign. For general complex exponent (we need a cut in the complex plane), $z\in {\Bbb C}\setminus (-\infty,0]$:
$$ A^{z}= P B^{z} P^{-1} = 3^z   \left( \begin{matrix} 1 +\frac{2}{3}z& -\frac{1}{3}z\\ \frac{4}{3}z & 1-\frac{2}{3}z\end{matrix}\right) 
 .$$
A: The Jordan decomposition $A=SJS^{-1}$ is given by the matrices $$S = \begin{pmatrix}1&\frac12\\2&0 \end{pmatrix},\quad J = \begin{pmatrix}3&1\\0&3 \end{pmatrix}. $$
Let $\lambda = 3$ and write $J = \lambda (I+K)$, where $$K=\begin{pmatrix}0&\frac13\\0&0 \end{pmatrix}.$$ Using the Mercator series, we compute the logarithm of $J$:
\begin{align}
\log J &= \log(\lambda(I+K))\\
&= \log(\lambda I) + \log (I+K)\\
&= 0 + \sum_{n=1}^\infty (-1)^{n+1}\frac{K^n}n\\
&= \begin{pmatrix}0&\log\frac43\\0&0 \end{pmatrix}.
\end{align}
Write $J=S^{-1}AS$, then we have
\begin{align}
\log A &= S(\log J) S^{-1}\\
&= \begin{pmatrix}1&\frac12\\2&0 \end{pmatrix}\begin{pmatrix}0&\log\frac43\\0&0 \end{pmatrix}\begin{pmatrix}0&\frac12\\2&-1 \end{pmatrix}\\
&= \begin{pmatrix}\frac23+\log 3&-\frac13\\\frac43&-\frac23+\log3 \end{pmatrix}.
\end{align}
It follows that
$$A^{\frac12} = e^{\log\left(A^{\frac12}\right)}
= e^{\frac12\log A}
= \frac{1}{\sqrt{3}}\begin{pmatrix} 4 & -\frac{1}{2} \cr 2 & 2 \end{pmatrix}.
$$
By the way, there is a very similar formula for power of $\log A$:
$$(\log A)^n = \frac13(\log 3)^{n-1}\begin{pmatrix}2n+3\log 3& -n\\ 4n& -2n+3\log 3 \end{pmatrix}. $$
