# Ansatz for solving a differential equation

I asked this question ealier today on reddit someone told me to better ask this here.

I started reading about the Klein-Gordon equation and I tried to solve some problems. At some point I had to solve an Differential equation that looked like $f''(r)/f(r) = h(r)$, so I had the idea to use the Ansatz $f(r) = r^a e^{br}$ and define $g(r) = f''(r)/f(r)$. And then I taylored $g$ and $h$ in $s$, neglect everything of order $(r-s)^2$ and higher and solved for $a$ and $b$. Now I have a solution $f(r; a(s), b(s))$ that should solve the differential equation if $r$ is close enough to $s$.
Unfortunately that doesn't help. I used this method to solve a problem, that also can be solved analytically ($f'/f = e^x$) and plotted the result in python to see if this actually works. It doesn't. The reason for it to fail is I think that I get a different solution for every $s$. What I mean by this is that if $F(x;m)$ was an actual solution for every $m$ then $f(x;a(s), b(s)) = F(x;m(s)) \neq F(x;m)|_{m=const.}$.
And my question would be if someone knows if this can be fixed and if yes how? Is this maybe a well-known math problem?

The easiest non-trivail ODE of this kind has $h(r)=r$ and is the equation for the Airy function. As you can see even in that simple case there are no easy solutions. Some cases are related to other special functions like Bessel-functions, which are themselves solutions of specific second order ODE.