# Convert 2nd order ode to first order ODES

• May 30th 2010, 05:32 PM
RoyalFlush
Convert 2nd order ode to first order ODES
Hello,
I have the DE:

$y''(t) + y = 0$

with IC's:

$y'(0) = 1$hs

$y(0) = 0$

If I convert this to a system of 1st order ODES is it just:

$\frac{dy_1}{dt} = y_2, \ \ \ \frac{dy_2}{dt} = -y_1$

How about if the DE is:

$y''(t) + y = \sin(2t)$ and the same IC's.

Thanks
• May 30th 2010, 08:55 PM
AllanCuz
Quote:

Originally Posted by RoyalFlush
Hello,
I have the DE:

$y''(t) + y = 0$

with IC's:

$y'(0) = 1$hs

$y(0) = 0$

If I convert this to a system of 1st order ODES is it just:

$\frac{dy_1}{dt} = y_2, \ \ \ \frac{dy_2}{dt} = -y_1$

How about if the DE is:

$y''(t) + y = \sin(2t)$ and the same IC's.

Thanks

The first question is a second order homogenious equation. We find the roots by computing the characteristic equation.

$\lambda^2 + 1 = 0$

Clearly this has the imaginary roots $-i$ and $i$

So,

$y = c_1 e^{-i x} + c_2 e^{ i x }$

Compute and sub in initial conditions.

The second question can be computed by method of comparing co-efficients (we can also use variation of paramters but co-efficients is easiast here).

For $y''(t) + y = \sin(2t)$ the general solution is the solution from question 1 plus the particular solution.

For the particular solution,

Let $y = Asin(2t) + Bcos(2t)$

So,

$y^{ \prime } = 2Acos(2t) -2Bsin(2t)$

$y^{ \prime \prime } = -4Acos(2t) - 4Bcos(2t)$

Subbing into the equation we get,

$-4Acos(2t) - 4Bcos(2t) + Asin(2t) + Bcos(2t) = sin(2t)$

$cos(2t) [ - 4A - 3B ] + Asin(2t) = sin(2t)$

$A = 1$

$-4 -3B = 0$

$B = - \frac{4}{3}$

And $y = sin(2t) - \frac{4}{3}cos(2t)$
• May 30th 2010, 09:15 PM
Prove It
Quote:

Originally Posted by AllanCuz
The first question is a second order homogenious equation. We find the roots by computing the characteristic equation.

$\lambda^2 + 1 = 0$

Clearly this has the imaginary roots $-i$ and $i$

So,

$y = c_1 e^{-i x} + c_2 e^{ i x }$

Compute and sub in initial conditions.

You should really use Euler's Formula to clean this up...
• May 31st 2010, 06:36 PM
AllanCuz
Quote:

Originally Posted by Prove It
You should really use Euler's Formula to clean this up...

You mean, actually do work? Pshh...

$y = c_1 e^{ -ix} + c_2 e^{ix}$

$= c_1 [ cosx - isinx ] + c_2 [cosx + isinx]$

$= [c_1 + c_2]cosx + [ i c_2 - i c_1 ] sinx$

Let $A = c_1 + c_2$ and $B = i c_2 - i c_2$

$y = Acosx + Bsinx$

This is actually the result of a seperation of variables of a wave equation :O!
• Jun 1st 2010, 04:02 AM
HallsofIvy
That's very clever, guys, but it doesn't actually answer the question asked, does it?

Royal Flush, yes, if you let $y_1= y$ and $y_2= \frac{dy}{dt}$, then we have immediately that $\frac{dy_1}{dt}= y_2$ and then $\frac{d^2y}{dt^2}= \frac{d}{dt}\frac{dy_1}{dt}= \frac{dy_2}{dt}$ so that $\frac{d^2y}{dt^2}+ y= \frac{dy_2}{dt}+ y_1= 0$ so that $\frac{dy_2}{dt}= -y_1$

And your initial conditions are $y_1(0)= 0$ and $y_2(0)=1$.

This can also be written as the "matrix" equation:
$\frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}= \begin{pmatrix}y_2 \\ -y_1\end{pmatrix}= \begin{pmatrix}0 & 1 \\-1 & 0\end{pmatrix}\begin{pmatrix}y_1 \\ y_2\end{pmatrix}$ subject to the initial condition $\begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}$.

In the same way, the equation y"+ y= sin(2t) becomes the pair of equations $\frac{dy_1}{dt}= y_2$ and $\frac{dy_2}{dt}= -y_1+ sin(2t)$ with the same intial conditions.

That also can be written as a "matrix" equation:
$\frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}=$ $\begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}\begin{pmatrix}y_1 \\ y_2\end{pmatrix}+ \begin{pmatrix}0 \\ sin(2t)\end{pmatrix}$
with initial condition $\begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}$.

Of course, the eigenvalues of the matrix $\begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}$ are i and -i which lead to the complex exponentials (sine and cosine) solutions Prove It and AllenCuz show.
• Jun 1st 2010, 06:43 AM
AllanCuz
Quote:

Originally Posted by HallsofIvy
That's very clever, guys, but it doesn't actually answer the question asked, does it?

Royal Flush, yes, if you let $y_1= y$ and $y_2= \frac{dy}{dt}$, then we have immediately that $\frac{dy_1}{dt}= y_2$ and then $\frac{d^2y}{dt^2}= \frac{d}{dt}\frac{dy_1}{dt}= \frac{dy_2}{dt}$ so that $\frac{d^2y}{dt^2}+ y= \frac{dy_2}{dt}+ y_1= 0$ so that $\frac{dy_2}{dt}= -y_1$

And your initial conditions are $y_1(0)= 0$ and $y_2(0)=1$.

This can also be written as the "matrix" equation:
$\frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}= \begin{pmatrix}y_2 \\ -y_1\end{pmatrix}= \begin{pmatrix}0 & 1 \\-1 & 0\end{pmatrix}\begin{pmatrix}y_1 \\ y_2\end{pmatrix}$ subject to the initial condition $\begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}$.

In the same way, the equation y"+ y= sin(2t) becomes the pair of equations $\frac{dy_1}{dt}= y_2$ and $\frac{dy_2}{dt}= -y_1+ sin(2t)$ with the same intial conditions.

That also can be written as a "matrix" equation:
$\frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}=$ $\begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}\begin{pmatrix}y_1 \\ y_2\end{pmatrix}+ \begin{pmatrix}0 \\ sin(2t)\end{pmatrix}$
with initial condition $\begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}$.

Of course, the eigenvalues of the matrix $\begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}$ are i and -i which lead to the complex exponentials (sine and cosine) solutions Prove It and AllenCuz show.

He said "if I convert to" which I took to mean he was trying to solve the problem via that method, and it wasn't specifically asked of him.