Solve: $x''(t)-2x'(t) + x(t) = 2 \sin(3t)$ It is asked to solve the ODE $x''(t)-2x'(t) + x(t) = 2 \sin(3t)$ for $x(0)=10, \; x'(0)=0$
It is equivalent to the first order system in two variables
$$\begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ -1 & 2 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} + \begin{bmatrix}0 \\ 1 \end{bmatrix} 2 \sin(3t), \; \begin{bmatrix}x_0 \\ y_0 \end{bmatrix} = \begin{bmatrix} 10 \\ 0 \end{bmatrix}$$
If 
$$A = \begin{bmatrix} 0 & 1 \\ -1 & 2 \end{bmatrix} , B = \begin{bmatrix}0 \\ 1 \end{bmatrix}$$
the solution for this ODE of first order is
$$ e^{tA} \begin{bmatrix} x_0 \\ y_0 \end{bmatrix} + \int_0^t e^{(t-s)A}2B\sin(3s)ds $$
I know we could look for the characteristic polynomial of the equation and try to find a solution which combines sines and cosines terms, but since I am studying resolution of second order systems using first order ones, I would like to check if this is a good way of solving it. The exponential of the matrix $tA$, for example, doesn't seems to have a good form (except if I wrote something wrong). So, what is the better way of solving it?
Thanks in advance!
Edit:
$$A = \begin{bmatrix} 0 & 1 \\ -1 & 2 \end{bmatrix} = \begin{bmatrix} 1&-1 \\ 1&0 \end{bmatrix} \begin{bmatrix} 1&1 \\0 &1 \end{bmatrix} \begin{bmatrix}0 &1 \\ -1&1 \end{bmatrix}$$
$$\Rightarrow e^{t\begin{bmatrix} 1& 1\\0 &1 \end{bmatrix}} = e^{t\begin{bmatrix} 1&0 \\ 0&1 \end{bmatrix} + \begin{bmatrix} 0&t \\ 0&0 \end{bmatrix}}=\begin{bmatrix}e^t &0 \\0 &e^t \end{bmatrix} \begin{bmatrix} 1&t \\0 &1 \end{bmatrix}$$ 
 A: Let $D=\dfrac d{dt}$  
We have particular solution:
$$D^2(x)-2Dx+x=2\sin(3t)$$
$$(D^2-2D+1)x=2\sin(3t)$$
$$x=\dfrac 2{D^2-2D+1} (\sin(3t))$$
$$=\dfrac 2{-9-2D+1}(\sin(3t))$$
$$=-\dfrac 1{D+4}(\sin(3t))$$
$$=-\dfrac{D-4}{D^2-16}(\sin(3t))$$
$$=\dfrac{D-4}{25}(\sin(3t))$$
$$=\dfrac 3{25}\cos(3t)-\dfrac 4{25}\sin(3t)$$
And the general solution is $x=\dfrac 3{25}\cos(3t)-\dfrac 4{25}\sin(3t)+C_1e^x+C_2xe^x$
I have used the fact that $f(D^2)\sin(ax)=f(-a^2)\sin(ax)$ for polynomial $f$.
This can be easily verified so I am not showing it here.
A: The characteristic polynomial is always helpful in forming higher order powers of the matrix. In this case,
$$
               A = \left[\begin{array}{cc} 0 & 1 \\ -1 & 2\end{array}\right]
$$
has characteristic polynomial $p(\lambda)=\lambda(\lambda-2)+1=(\lambda-1)^{2}$. That makes things trivial in this case because you end up with a terminating power series for the exponential:
$$
        \exp\{ uA \} = e^{uI}\exp\{ u(A-I)\}=e^{u}\{I + u(A-I)\}
$$
The exponential operations are justified because $e^{A+B}=e^{A}e^{B}$ if $A$ and $B$ commute.
A: For another approach, note that the characteristic polynomial for 
$x''(t)-2x'(t) + x(t)=0$ is $r^{2}-2r+1=(r-1)^2$ from which we conclude that the general solution to the homogeneous case is
$\tag1x_{h}(t)=ae^{t}+tbe^{t}$
Now for a particular solution, we use judicious guessing:
$\tag2x_p(t)=A\sin 3t+B\cos3t$ whence 
$x'_p(t)=3A\cos 3t-3B\sin3t$
$x''_p(t)=-9A\sin 3t-9B\cos3t$
Now substitute the foregoing into the original differential equation, and find that
$-9A\sin 3t-9B\cos3t-6A\cos 3t+6B\sin3t+A\sin 3t+B\cos3t=2\sin 3t$
from which we obtain
$3B-4A=1;\quad -4B-3A=0\Rightarrow A=-\frac{4}{25}\quad \text {and}\quad B=\frac{3}{25}$.
The general solution is now 
$\tag3x_{h}(t)+x_{p}(t)=ae^t+bte^t+\dfrac 3{25}\cos(3t)-\dfrac 4{25}\sin(3t)$
and now you can easily determine $a$ and $b$ by imposing the initial conditions. 
A: Here (for a particular solution) we can use matrix representations of the differential operator
If the vector $[1,0]^T$ represents $\sin(3t)$ and $[0,1]^T$ represents $\cos(3t)$
then multiplication with the matrix
$${\bf D} = 3\left[\begin{array}{rr}0&1\\-1&0\end{array}\right]$$
from the left represents differentiation and ${\bf D}^2$ represents two times differentiation. So rewritten with matrices, we have:
$$({\bf D}^2-2{\bf D+I)x} = [2,0]^T$$
Now you can solve this as an ordinary linear equation system.
If we solve this, we get ${\bf x} = \left[\begin{array}{c}-4/25\\-3/25\end{array}\right]$, which if we plug it into the product above becomes:
$$\left[\begin{array}{rr}
-8&-6\\
6&-8
\end{array}\right] \left[\begin{array}{c}-4/25\\-3/25\end{array}\right] = \frac{1}{25}\left[\begin{array}{c}4\cdot 8 + 6\cdot3 \\ - 6 \cdot 4  + 8 \cdot 3\end{array}\right] = \left[\begin{array}{c}2\\0\end{array}\right]$$
A: You're off to a great start! Letting $\vec v=\begin{bmatrix}x\\y\end{bmatrix},$ $\vec v_0=\begin{bmatrix}10\\0\end{bmatrix},$ and $\vec b=2\sin(3t)B,$ your IVP is equivalent to the nonhomogeneous linear IVP $$\vec v'=A\vec v+\vec b,\:\vec v(0)=\vec v_0.\tag{1}$$
Now, let's start by considering the corresponding homogeneous linear system $$\vec v'=A\vec v.\tag{2}$$ Observe that $\vec w_1=\begin{bmatrix}1\\1\end{bmatrix}$ generates the (sole) eigenspace of $A$ (corresponding to the eigenvalue $1$), and that $\vec w_2=\begin{bmatrix}0\\1\end{bmatrix}$ is a solution to $(A-I)\vec w=\vec w_1,$ so that $\{\vec w_1,\vec w_2\}$ is a basis for $\Bbb R^2$ consisting of generalized eigenvectors of $A.$ Putting $\vec v=f\vec w_1+g\vec w_2$ and supposing that $\vec v$ satisfies $(2),$ we obtain by substitution the system $$f'\vec w_1+g'\vec w_2=(f+g)\vec w_1+g\vec w_2,\tag{2'}$$ whence $f'=f+g$ and $g'=g.$ Thus, $g(t)=ce^t$ for some constant $c.$ Hence, $f'(t)-f(t)=ce^t,$ so $c=f'(t)e^{-t}-f(t)e^{-t}=\left(f(t)e^{-t}\right)',$ whence $f(t)e^{-t}=ct+d$ for some constant $d,$ and so $f(t)=(ct+d)e^t.$ Thus, the solutions to $(2)$ have the form $$\vec v=(ct+d)e^t\vec w_1+ce^t\vec w_2=c\begin{bmatrix}te^t\\(t+1)e^t\end{bmatrix}+d\begin{bmatrix}e^t\\e^t\end{bmatrix}$$ for some constants $c,d.$ Equivalently, if $\Phi=\begin{bmatrix}te^t & e^t\\(t+1)e^t & e^t\end{bmatrix},$ then the general solutions of $(2)$ have the form $\vec v=\Phi\vec d,$ where $d=\begin{bmatrix}d_1\\d_2\end{bmatrix}$ for some constants $d_1,d_2.$ I leave it to you to verify that such $\vec v$ are solutions to $(2)$ regardless of our choice of $\vec d.$
Now, suppose that $$\vec z=\Phi(\vec f+\vec d),$$ where $\vec f=\begin{bmatrix}f_1\\f_2\end{bmatrix}$ for some differentiable functions $f_1,f_2$ and $\vec d$ is as above. Noting that $A\Phi=\Phi',$ it follows that $$(\Phi\vec f)'=\Phi'\vec f+\Phi\vec f'=A\Phi\vec f+\Phi\vec f',$$ so since $A\Phi\vec d=(\Phi\vec d)'$ by the work done with $(2)$, then $$\vec z'=(\Phi\vec f)'+(\Phi\vec d)'=A\Phi\vec f+\Phi\vec f'+A\Phi\vec d=A\vec z+\Phi\hat f'.$$ Thus, $\vec z$ is a solution to $(1)$ if and only if $\Phi\vec f'=\vec b.$
Since $\Phi$ is invertible, then letting $\vec f$ be any termwise antiderivative (with respect to $t$) of $$\Phi^{-1}\vec b=\begin{bmatrix}2e^t\sin(3t)\\-2te^t\sin(3t)\end{bmatrix},$$ we should find that $\vec v=\Phi\vec f$ is a solution to $\vec v'=A\vec v+\vec b.$ All that remains is to choose the integration constants appropriately to fit the given initial values.
