Skip to content

Instantly share code, notes, and snippets.

@lucainnocenti
Created February 17, 2015 15:45
Show Gist options
  • Save lucainnocenti/138eca03adfe52c5bd1e to your computer and use it in GitHub Desktop.
Save lucainnocenti/138eca03adfe52c5bd1e to your computer and use it in GitHub Desktop.
Linear harmonic oscillator

#Linear Harmonic Oscillator [toc]

Consider the linear oscillator equation $$ \tag{LHO} y'' + \omega^2 y = 0. $$ We want to solve this equation using a series expansion around the origin. ##Frobenius Solution Method Start with the Ansatz $$ y(x) = x^\rho \sum_{n=0}^\infty c_n x^n, $$ where $c_0 \neq 0$ by definition (otherwise we would just rename the coefficients and absorb into $\rho$ the lowest power of $x$). Using this into the original differential equation gives the condition $$ \sum_{n=0}^\infty \left[ (\rho + n)(\rho+n-1) c_n x^{\rho+n-2} + c_n x^{\rho + n} \right] = 0. $$ Imposing that the coefficients of all the powers of $x$ must vanish we have

power of $x$ $\qquad$ coefficients $\qquad \qquad \qquad \qquad \qquad$
$x^{\rho-2}$ $\rho(\rho-1) c_0$ $=0$
$x^{\rho-1}$ $\rho(\rho+1) c_1$ $=0$
$x^{\rho}$ $(\rho+2)(\rho+1) c_2 + \omega^2 c_0 = 0$
$x^{\rho+1}$ $(\rho+3)(\rho+2)c_3 + \omega^2 c_1 = 0$

and so on. In particular the coefficient of $x^{\rho-2}$, together with the fact that $c_0 \neq 0$ gives the condition (indicial equation) $$ \rho(\rho-1) = 0 \Longrightarrow (\rho = 0 \text{ or } \rho = 1) $$ ###$\rho=0 $ If $\rho = 0$ then $$ y(x) = \sum_{n=0}^\infty c_n x^n, $$ and the recurrence relation for the coefficients of the even powers of $x$ gives $$ c_2 = - \frac{\omega^2}{1 \cdot 2} c_0, $$ $$ c_4 = - \frac{\omega^2}{2 \cdot 3} c_2 = (-1)^2 \frac{\omega^4}{4!} c_0, $$ $$ c_{2n} = (-1)^n \frac{\omega^{2n}}{(2n)!} c_0. $$ At the same time, the odd coefficients $c_{2n+1}$ are dependent on $c_1$ as follows: $$ c_{2n+1} = (-1)^n \frac{\omega^{2n}}{(2n+1)!} c_1 $$ Setting $c_1=0$ thus gives the solution $$ y(x) = \sum_{n=0}^\infty (-1)^n \frac{(\omega x)^{2n}}{(2n)!} c_0 = c_0 \cos(\omega x). $$ while if $c_1 \neq 0$ we have $$ y(x) = c_0 \cos(\omega x) + \frac{c_1}{\omega} \sin(\omega x). $$ ###$\rho=1 $ If $\rho=1$ then $$ y(x) = \sum_{n=0}^\infty c_n x^{n+1}, $$ and we have the following relations for the coefficients $$ c_1 = 0,$$ $$ c_{2n} = (-1)^n \frac{\omega^{2n}}{(2n+1)!}, $$ corresponding to the solution $$ y(x) = \frac{c_0}{\omega} \sin(\omega x).$$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment