Higher Derivatives of NDSolve don't match the results from DSolve solution, can I somehow increase the accuracy of numerical method to match arbitrarily high derivatives?
Equation
I am using SeriesCoefficient to calculate probability distribution from the probability generating function $G(x)$ which should satisfy this parametric equation:
$$
4 x (x - 1)^2 G''(x)+((4 d - 4 L + 6) x^2 - (8 d - 4 L + 10)x + 4 (d + 1)) G'(x) +(L - d)(L - d - 1)(x - 1) G(x) = 0
$$
With boundary conditions $G(0)=0,G(1)=1$, where $G(x) = \sum_{n=d}^{L}P_{n}x^n \rightarrow P(n)=\frac{G^{(n)}(0)}{n!}$
Code
sol = ParametricNDSolveValue[
{4 x (x - 1)^2 f''[x] +
((4 d - 4 L + 6) x^2 + 4 (d + 1) - (8 d - 4 L + 10) x) f'[x] +
((L - d) (L - d - 1)) (x - 1) f[x] == 0,
{f[0] == 0, f[1] == 1}},f, {x, 0, 1}, {L, d},
Method -> "FiniteElement"];
G[x_] = (x^d Hypergeometric2F1[d/2 - L/2, 1/2 + d/2 - L/2, 1 + d, x])/
Hypergeometric2F1[d/2 - L/2, 1/2 + d/2 - L/2, 1 + d, 1];
Manipulate[{
Plot[{
sol[l, k][x], G[x] /. {L -> l, d -> k}}, {x, 0, 1},
PlotRange -> {0, 1}, PlotStyle -> {Thick, Dashed}],
ListLinePlot[{
Table[SeriesCoefficient[sol[l, k][x] /. {L -> l, d -> k}, {x, 0, n}], {n, 0, l}],
Table[SeriesCoefficient[G[x] /. {L -> l, d -> k}, {x, 0, n}], {n,0, l}]} ,
PlotRange -> {0, 1}, PlotStyle -> {Thick, Dashed}]},
{l, 0, 25, 1}, {k, 0, 25, 1}]
Problem
- I don't know if I can increase precision of the interpolated function of
NDSolveto match the results of the analytical solution. Parameter $L$ defines the size of the system, and it can assume the values from $0$ to an arbitrarily large number.
If $L=100$ then I need to calculate up to the 100th derivative $\frac{\partial^{100}}{\partial x^{100}}G(x)$. There are significant slowdowns for $L \rightarrow l >50$ already, and solutions also don't match when varying $d \rightarrow k$ parameter - Alternatively I would like to know what other numerical methods I could use for this kind of ODE or PDE besides those available in Mathematica, because only
Method -> "FiniteElement"gives some result when concerning BVP problem with singularities.
Related
highest-derivative-from-ndsolve
series-expansion-of-interpolatingfunction
Using InterpolationOrder->All or Method -> "ExplicitRungeKutta" and increasing "DifferenceOrder" don't seeem to work.

4 x (x - 1)^2 f''[x] + ((4 d - 4 L + 6) x^2 + 4 (d + 1) - (8 d - 4 L + 10) x) f'[x] + ((L - d) (L - d - 1)) (x - 1) f[x] == 0 /. f -> G /. {L -> 50, d -> 20, x -> 1/2} // SimplifyyieldsFalse, suggesting thatGis not a solution to the ODE. – Michael E2 Sep 30 '21 at 13:22