Any second order linear ordinary differential equation
   or    
where
is a second order linear operator, can be rewritten in Sturm-Liouville form
![-\frac{d}{dx} \left[ p(x) \frac{dy}{dx} \right] +q(x) y = r(x)](http://www.dreamersedge.com/wp-content/plugins/latex/cache/tex_f8147e8361ad2611787a020f2fe46309.gif)
Method:
Start with a general 2nd order linear ODE

Divide by A(x) to obtain

Now we let
,Â
and 

Now we use the integrating factor, p(x), to reformulate the 2nd order differential part, such that
![p(x) = \textrm{exp} \left[ \int b(x) dx \right]](http://www.dreamersedge.com/wp-content/plugins/latex/cache/tex_3d5d82694d971f60b3db040822a87b52.gif)
The equation now becomes

where we now define
and
. So the original equation is now cast in Sturm-Loiuville form.
This can also be applied to eigenvalue problems...
Any second order linear eigenvalue equation
   or    
where
is a second order linear operator, can be rewritten in Sturm-Liouville form
![\frac{d}{dx} \left[ p(x) \frac{dy}{dx} \right] +q(x) y = \lambda w(x) y](http://www.dreamersedge.com/wp-content/plugins/latex/cache/tex_fae6480698edb9bf7b9b2802b2325669.gif)
The same proceedure is followed as the non eigenvalue problem. The only difference is the introduction of the weight function,
, which is defined as

Note: we need Â
on the interval ![\bigl[ a,b \bigr]](http://www.dreamersedge.com/wp-content/plugins/latex/cache/tex_81d8f8a61746d00ad938c6915c0ae7ef.gif)
and we require
![\left[p(x) \{ f^*(x)g^{'}(x) - f^{*'}(x) g(x) \} \right]^b_a = 0](http://www.dreamersedge.com/wp-content/plugins/latex/cache/tex_d3b5fcda1895cd3e532955652b0dce24.gif)
For a derivation of this see this post.
This ensures all eigenvalues,
, are real and corresponding eigenfunctions,
, are orthogonal relative to the weight function w(x).
Mathematically:
  (orthogonal)
and


  (real eigenvalues)
Example 1: Legendre's Equation

Divide by
, which gives

Now we compute the integrating factor, 
![p(x) = \textrm{exp} \left[ \int \frac{-2x}{1-x^2} dx \right] = 1-x^2](http://www.dreamersedge.com/wp-content/plugins/latex/cache/tex_4ce91f005fb514d0443638c4a024dfe5.gif)
So the Sturm-Liouville form is
![\frac{d}{dx} \left[ \left( 1-x^2 \right) \frac{dy}{dx} \right] = \lambda y](http://www.dreamersedge.com/wp-content/plugins/latex/cache/tex_4cd1132a598b7bfbeeda508c8d4ed0d9.gif)
So we see the weight function,
.