I do not get an x^4 term.
findSeriesSolution[y_,x_,nTerms_]:=Module[
{roots,pt=0,ode,s0,s1,ic,eq,sol},ic={y[0]->0,y'[0]->0};
ode=y''[x]- (x+y[x]^2);
s0=Series[ode,{x,pt,nTerms}];
s0=s0/.ic;
roots=Solve@LogicalExpand[s0==0];
s1=Series[y[x],{x,pt,nTerms+2}];
sol=Normal[s1]/.ic/.roots[[1]]
]
And now
sol = findSeriesSolution[y,x,10]
(* x^3/6 + x^8/2016 *)
Compare
Plot[sol,{x,0,1}]
solm=NDSolve[{y''[x]-(x+y[x]^2)==0,y[0]==0,y'[0]==0},y,{x,0,1}];
Plot[Evaluate[y[x]/.solm],{x,0,1}]
Analytical solution is (thanks to Maple 2017.3)
$$
-\ln \left( {\frac {1}{{{\rm Ai}\left(-x\right)}{{\rm Bi}^{(1)}\left(
-x\right)}-{{\rm Ai}^{(1)}\left(-x\right)}{{\rm Bi}\left(-x\right)}}
\left( {\frac { \left( {\it \_C2}\,\sqrt {3}\pi+{3}^{2/3}\Gamma
\left( 2/3 \right) \right) {{\rm Ai}\left(-x\right)}}{\pi}}-{\it
\_C2}\,{{\rm Bi}\left(-x\right)} \right) } \right) -2\,i\pi\,{\it \_Z2
}
$$
Screen shot
Mathematica can't at this time solve this analytically. May be in future versions.
DSolve[{y''[x] - ( x + y[x]^2) == 0, y[0] == 0, y'[0] == 0}, y[x], x]
{}
button above the edit window. It is recommended that you browse the Markdown help $\endgroup$seriesDSolve[y''[x] == (x + y[x]^2), y, {x, 0, 13}, {y[0] -> 0, y'[0] -> 0}]
from my answer to (25363) solves your problem. $\endgroup$