What is the most general way to solve a linear, second-order ODE with variable coefficients? I'm looking for the solution method for solving an equation like the following:
$$a(x)y''+b(x)y'+c(x)y=g(x)$$
The solution methods I have come across are somewhat unsatisfactory because they tend to be for special cases of the above equation (for example, if the $y$ term is missing, we can convert it to a first order equation and use the integrating factor method). 
I'd like to know a $\it general$ way to attack such a problem, if there is one. 
 A: The general solution is variation of constants, which solves the problem
$$
a_n(x)y^{(n)} + a_{n-1}(x)y^{(n-1)} + \ldots + a_1(x)y' = b(x).
$$
Here we may as well assume $a_n(x) = 1$: if $a_n(x)=0$ then we reduce to the lower-order case, and otherwise we can divide the equation by $a_n(x)$. The general solution is given by the variation of constants formula: see http://en.wikipedia.org/wiki/Variation_of_parameters#Description_of_method.
This does not necessarily yield an explicitly computable answer or a solution in terms of elementary functions, but in principle the method always yields an exact answer; in practice the method reduces everything to quadrature, so it's good enough for numerics.
See the first section here for the Laplace transform applied to linear $n$-th order ODEs: http://en.wikipedia.org/wiki/Laplace_transform_applied_to_differential_equations.
A: In general, this equation can not be solved in terms of elementary functions nor classical special functions. By this I mean the homogeneous counterpart, since once the homogeneous equation is solved, the nonhomogeneous one can also be solved, at least in quadratures.
Solvable cases correspond to particular choices of $a(x),b(x),c(x)$. One way to understand if you are in such a special situation is to analyze the structure of singular points of the equation in the extended complex plane of $x$. This is an algorithmic procedure.
For example, if you have only 3 regular singular points (like here), the equation can be reduced to the hypergeometric one by a simple change of variables. When their number is greater than $3$, the equation is non-solvable, at least for generic coefficients. In the presence of irregular singularities, there is  a similar  procedure.
