I am tring to solve the following ODE with NDsolve
$2x~(1-x)~f''(x)+(3-4x)~f'(x)+a~f(x)+b~f^n(x)=0;~~a,b\in\mathbb{R},~n\in\mathbb{N}$.
The mathematica "code" is:
sol=NDSolve[{2*x (1 - x) *f''[x] + (3 - 4 x) f'[x] +a*f[x] -
b*(f[x])^n == 0, y[0.999999999] == 0,
y'[0.999999999] == 1}, {f[x]}, {x, 0, 0.999999999},
MaxSteps -> Infinity, Method -> "ExplicitRungeKutta",
Method -> {"StiffnessSwitching", "NonstiffTest" -> False}]
Plot[Evaluate[f[x] /. sol], {x, 0, 0.999999999}]
For values of $a,b,n$ and starting from an $x$ close to $1$ one can find solutions while solving towards $x=0$. I am wondering how correct/trustworthy the results are, considering the fact that at $x=0$ one has a regular singularity. Does anybody have an experience or intuition for such a problem?
I can't really understand why NDsolve does only work if I set the boundary to $x=0.999999999$ or closer to $1$ but not if I set $x=1$.
Finally, I would like to compute the $L^2$ norm of the solution with respect to a certain measure using NIntegrate leading to
NIntegrate[(Abs[f[x] /. sol])^2*Sqrt[x]/Sqrt[1 - x], {x, 0,
0.999999999}]
What I see is that depending on the precision set in the NDsolve the result changes significantly and varies over many orders of magnitude. I assume that this is because of the singularity so I am actually seeking for a very stable solution method which works nicely there.
I would be happy with any suggestion. Thanks!