# 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?

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)$