TITLE: Finding the solution to a non-homogeneous matrix exponential.
QUESTION [10 upvotes]: Consider
$$\frac{d}{du}  \begin{bmatrix}a\\b \end{bmatrix}  = \begin{bmatrix}-x& y\\ -y&-x\end{bmatrix}  \begin{bmatrix}a\\ b\end{bmatrix} + \begin{bmatrix}\cos(zu)\\ -\sin(zu)\end{bmatrix}$$ where $P = \begin{bmatrix}-x& y\\ -y&-x\end{bmatrix}$. And I have it for $u=0:$
$$\begin{bmatrix}a\\b \end{bmatrix} = \begin{bmatrix}0\\0 \end{bmatrix}$$
Having proved that $\exp\left[Pu\right] = \exp\left[-xu\right]$
$$\begin{bmatrix}\cos(yu)& \sin(yu)\\ -\sin(yu) & \cos(yu)\end{bmatrix}.$$ 
My question is:

How do I use this proof to solve this problem using the initial conditions?

Having thought about it - I consider that using the double angle formulae may help although I haven't been able to formulate this.
Any help would be welcome.

REPLY [7 votes]: So you solved the homogeneous system. To now get the solution of the inhomogeneous system you can use the variation of constant technique. Let 
$$ \begin{bmatrix}a\\b \end{bmatrix}=  e^{Pu}c(u) \longrightarrow \frac{d}{du}\begin{bmatrix}a\\b \end{bmatrix} = Pe^{Pu}c(u) +  e^{Pu}c'(u)$$
Thus we have  $e^{Pu}c'(u) = \begin{bmatrix}\cos(zu)\\ -\sin(zu)\end{bmatrix}$ and $c(0) = 0$. All that is left to do is to solve this linear system and integrate w.r.t. $u$:
$$c'(u) 
= e^{-Pu}\begin{bmatrix}\cos(zu)\\ -\sin(zu)\end{bmatrix} 
= e^{xu}\begin{bmatrix}\cos(yu)& \sin(yu)\\ -\sin(yu) & \cos(yu)\end{bmatrix}^{-1} \cdot\begin{bmatrix}\cos(zu)\\ -\sin(zu)\end{bmatrix}
$$
Since the matrix here is orthonormal its inverse is simply its transpose:
$$c'(u) 
= e^{xu}\begin{bmatrix}\cos(yu)& -\sin(yu)\\ \sin(yu) & \cos(yu)\end{bmatrix} \cdot\begin{bmatrix}\cos(zu)\\ -\sin(zu)\end{bmatrix}
= e^{xu}\begin{bmatrix}\cos(yu-zu) \\\sin(yu-zu)\end{bmatrix} 
$$
Were I used the addition theorems to simplify the expression. Now integrate, using the formulas
\begin{align}
\int \sin(\alpha u) e^{\beta u} du &= \frac{\beta\sin(\alpha u) - \alpha\cos(\alpha u)}{\alpha^2+\beta^2}e^{\beta u} +\text{const.}\\
\int \cos(\alpha u) e^{\beta u} du &= \frac{\beta\cos(\alpha u) + \alpha\sin(\alpha u)}{\alpha^2+\beta^2}e^{\beta u} +\text{const.}\\
\end{align}
to get
$$ c(u) = \frac{1}{x^2 + (y-z)^2}e^{xu}
\begin{bmatrix}
x\cos((y-z)u) + (y-z)\sin((y-z) u)\\
x\sin((y-z) u) - (y-z)\cos((y-z) u)
\end{bmatrix} + \text{const.} $$
And to satify the initial condition $c(0)=0$ we need
$$ \text{const.} = -\frac{1}{x^2 + (y-z)^2}\begin{bmatrix}
x \\- (y-z)
\end{bmatrix}$$