# Solving for ODE

Let

$$x'(t) = -y(t)$$ $$y'(t) = x(t)$$

The solution is $x(t) = a$ cos$(t)-b$ sin$(t)$, $y(t)=a$ sin$(t)+b$ cos$(t)$

I solved the above equation by "guessing" based on the fact that I know how the derivative of trig functions work.

I am just wondering what is the actual way of solving it? Also how to we prove that any solution to this system has to be of that form?

$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} \mrm{x}'\pars{t} + \mrm{y}'\pars{t}\ic & = \ic\bracks{\mrm{x}\pars{t} + \mrm{y}\pars{t}\ic}\implies \mrm{x}\pars{t} + \mrm{y}\pars{t}\ic = A\exp\pars{\ic t}\,,\quad A \in \mathbb{C} \\[5mm] \implies\mrm{x}\pars{t} & = \Re\pars{A\exp\pars{\ic t}}\,,\qquad \mrm{y}\pars{t} = \Im\pars{A\exp\pars{\ic t}} \end{align}
Hint: Differentiate first equation: $x''(t)=-y'(t)$ and plug it into the second equation: $x''(t)=-x(t)$. This equation is the well known harmonic occilator with $x(t)=a\sin(t)+b\cos(t)$ as solution. Plut this into the first equation to determine $y(t)$.
Differentiate the first equation: $x''(t)=-y'(t)=-x(t)$.
So $x(t)=a\cos(t)+b\sin(t)$
Then $x'(t)=-a\sin(t)+b\cos(t)=-y(t)$
So $y(t)=a\sin(t)-b\cos(t)$