Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- findSeriesSolution[y_,x_,nTerms_]:=Module[
- {roots,pt=0,ode,s0,s1,ic,eq,sol},ic={y[0]->0,y'[0]->0};
- ode=y''[x]-4 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]]
- ]
- findSeriesSolution[y,x,5]
- (* (2 x^3)/3 *)
Add Comment
Please, Sign In to add comment