One thing you might want to do is write the vector $\vec{a}$ as some magnitude $\theta$ times a unit vector {a1, a2, a3}
. Then calculate $\exp(i \theta \,a\cdot\sigma)$. This will allow you to get rid of those factors of $\sqrt{a_1^2+a_2^2+a_3^2}$, which are just some $\theta$ anyway.
Here it is in Mathematica:
a = \[Theta] {a1, a2, a3};
b = a.Array[PauliMatrix, 3];
c = MatrixExp[I b];
c//FullForm;
c = c /. Plus[Power[a1, 2], Power[a2, 2], Power[a3, 2]] -> 1;
c // ExpToTrig // MatrixForm
$\left(
\begin{array}{cc}
\cos (\theta )+\text{a3} i \sin (\theta ) & \text{a2} \sin (\theta )+\text{a1} i \sin (\theta ) \\
i \text{a1} \sin (\theta )-\text{a2} \sin (\theta ) & \cos (\theta )-i \text{a3} \sin (\theta ) \\
\end{array}
\right)$
I used FullForm
to peek at the matrix c
so I would know how to make the substitution that eliminates the magnitude of the unit vector.
To answer your second question, you can expand any 2x2 matrix $M$ in terms of the set $S$ consisting of the identity matrix and the 3 Pauli matrices, but the coefficients in the expansion will only be real numbers if $M$ is Hermitian. It is fairly easy to prove this. You know that the set $T$ of 4 matrices each with a 1 in one position and 0's in the other positions is a basis for any 2x2 matrix. You can write each matrix in $T$ in terms of the matrices in $S$, but some of the coefficients are complex. If $S$ is basis for $T$ and $T$ is a basis for all 2x2 matrices ...
Thanks to your comment, we now seek coefficients $c_0, c_1, c_2, c_3$ such that matrix $\hat{c} = c_0 \hat{1} + i\,c_1\hat{\sigma}_1 +i\,c_2\hat{\sigma}_2 +i\,c_3\hat{\sigma}_3$. Here is one way to do it in Mathematica. First, create a basis set and a list of coefficients. Note that we have $i$ times the coefficients of the Pauli matrices, so we explicitly put the $i$ into the list of coefficients. The dot product of the coefficients and the basis is the matrix $m$, which we want to to be equal to the given matrix $c$. So, we form the equations and solve for the coefficients. A quick way to display the solution gives a "fair" result, but the Pauli matrices are not in the proper order. A "better" display can be had using the Row
function. Here is the code that takes the previous result for $c$ from above, finds the expansion coefficients and displays the result:
basis = Join[{IdentityMatrix[2]}, Array[PauliMatrix, 3]];
coeff = {c0, I c1, I c2, I c3};
m = coeff.basis // Expand;
m // MatrixForm;
eqns = Flatten[Thread /@ Thread[m == c]];
soln = Solve[eqns, {c0, c1, c2, c3}] // First;
fair = coeff.(MatrixForm /@ basis) /. soln
Table[coeff[[k]] MatrixForm[basis[[k]]], {k, 1, 4}];
better = Row[% /. soln, "+"]
$$
\cos (\theta )\left(
\begin{array}{cc}
1 & 0 \\
0 & 1 \\
\end{array}
\right) +
i \text{a1} \left(
\begin{array}{cc}
0 & 1 \\
1 & 0 \\
\end{array}
\right) \sin (\theta )+i \text{a2} \left(
\begin{array}{cc}
0 & -i \\
i & 0 \\
\end{array}
\right) \sin (\theta )+i \text{a3} \left(
\begin{array}{cc}
1 & 0 \\
0 & -1 \\
\end{array}
\right) \sin (\theta )$$
Factoring out the $i$ and the $\sin\theta$ and putting the Pauli matrix terms in parentheses is a bit trickier. I don't have a solution for that bit of finesse.