Solve system inhomogeneous differential equations with variable coefficients

Given the system of differential equations $$\frac{d\vec{y}}{dx} = \begin{pmatrix} 0 & 1 \\ -1 & 0 \\ \end{pmatrix}\vec{y} \ + \begin{pmatrix} sin(wx) \\ 0\\ \end{pmatrix} \ \ \ \ (w \neq \pm1)$$ There are two questions which I can't answer. 1. How can I find the general solution? 2. How can I find the periodic solutions (in general). I've tried to solve the following system$$\frac{d\vec{y}}{dx} = \begin{pmatrix} 0 & 1 \\ -1 & 0 \\ \end{pmatrix}\vec{y}$$ to find the complementary solution, which was $$\vec{y} = c_1\begin{pmatrix} cos(x) \\ -sin(x)\\ \end{pmatrix} \ +c_2\begin{pmatrix} sin(x) \\ cos(x)\\ \end{pmatrix}$$ So how do I proceed?

Try: $$\vec{y} = \left( \begin{matrix} y_1 \\ y_2 \end{matrix} \right) \quad\Rightarrow \quad \dfrac{d\vec{y}}{dx} = \left( \begin{matrix} y'_1 \\ y'_2 \end{matrix} \right)$$ Thus: \left( \begin{matrix} y'_1 \\ y'_2 \end{matrix} \right) = \left( \begin{matrix} 0 & +1 \\ -1 & 0 \end{matrix} \right) \left( \begin{matrix} y_1 \\ y_2 \end{matrix} \right) + \left( \begin{matrix} \sin(wx) \\ 0 \end{matrix} \right) \quad\Rightarrow\quad \left\{ \begin{align} y'_1 &= y_2 + \sin(wx) \\ y'_2 &= - y_1 \end{align} \right. Differentiating the second equation and replacing, you can get a second order differential equation: $$y_1 = - y'_2 \quad\Rightarrow\quad y'_1 = - y''_2 \quad\therefore\quad y''_2 + y_2 = - \sin(wx)$$ The general solution for $y_2$ is: $$\forall A,B\in\mathbb{C}: \quad y_2 = A \cos(x) + B \sin(x) + \dfrac{1}{w^2-1}\sin(wx)$$ (Note that $w\neq\pm 1$). For $y_1$: $$y_1 = - y'_2 \quad\Rightarrow\quad y_1 = A \sin(x) - B \cos(x) - \dfrac{w}{w^2-1}\cos(wx)$$ Finally, for all $A,B\in\mathbb{C}$ and $w\in\mathbb{C}$ such that $w\neq\pm 1$: $$\vec{y} = \left( \begin{matrix} A \sin(x) - B \cos(x) - \dfrac{w}{w^2-1}\cos(wx) \\ A \cos(x) + B \sin(x) + \dfrac{1}{w^2-1}\sin(wx) \end{matrix} \right)$$
Added: Periodicity Analysis. By definition of periodic function: $$y(x)\mbox{ is periodic in T}\quad\Leftrightarrow\quad\forall k\in\mathbb{Z},\,\exists T\in\mathbb{C}: \quad \vec{y}(x) = \vec{y}(x + Tk)$$ The function $\vec{y}$ consists of functions having different periods, $T_1$ and $T_2$. They corresponds to $\cos(x),\sin(x)$ and $\cos(xw),\sin(xw)$ functions, respectively: \begin{align} T_1 &= 2\pi & T_2 &= \frac{2\pi}{w} \\ \end{align} So this means that: $$\forall k\in\mathbb{Z},\,\exists k1,k2\in\mathbb{Z}: \quad Tk = T_1 k_1 = T_2 k_2 \quad\Rightarrow\quad \dfrac{T_1}{T_2} = w = \dfrac{k_2}{k_1}$$ Since $k1,k2\in\mathbb{Z}$, necessarily $\dfrac{k_2}{k_1}\in\mathbb{Q}$. Then: $$\vec{y}(x)\mbox{ is periodic}\quad\Leftrightarrow\quad w \in\mathbb{Q}$$
• Okay thanks! And this solution is periodic since for any value of $w$ there is a value $x$ and a value $x+\frac{2 \pi}{w}$ which will both yield the same solution? – Di-lemma Mar 28 '16 at 18:32
• I edited the solution to your request. If I were you, I always begin by analyzing the periodicity using the generic formula: $$f(x)\mbox{ is periodic in T}\quad\Leftrightarrow\quad\forall k\in\mathbb{Z},\,\exists T\in\mathbb{C}:\quad f(x) = f(x+Tk)$$ And when the condition for each sub-period $T_i$ is satisfied: $$Tk = T_1 k_1 = T_2 k_2 = \cdots = T_i k_i = \cdots$$ The point of all this is that you understand that a composite function not necessarily be periodic because their functions that make it up are periodic. Therefore, analyze each situation very carefully. – Noir Mar 28 '16 at 20:03