3.6 Solving ODE using power series method

For an ode, that has just ordinary point at \(x=x_0\), we can find power series solution near \(x_0\) as follows. Assume the ode is

\[ u''(t)+\frac {1}{10} u(t)^3 u'(t)^2+4 u(t)=0 \]

with intitial conditions \(u(0)=1,u'(0)=1\), then

findSeriesSolution[t_, nTerms_] := Module[{pt = 0, u, ode, s0, s1, ic, eq, sol}, 
  ic = {u[0] -> 1, u'[0] -> 1}; 
  ode = u''[t] + 4 u[t] + 1/10 u[t]^3 u'[t]^2; 
  s0 = Series[ode, {t, pt, nTerms}]; 
  s0 = s0 /. ic; 
  roots = Solve@LogicalExpand[s0 == 0]; 
  s1 = Series[u[t], {t, pt, nTerms + 2}]; 
  sol = Normal[s1] /. ic /. roots[[1]] 
  ]
 

and now call it with

seriesSol = findSeriesSolution[t, 6]
 

It returns

\[ \frac {445409479 t^8}{840000000}+\frac {8878343 t^7}{10500000}-\frac {277427 t^6}{600000}-\frac {12569 t^5}{50000}+\frac {1607 t^4}{2000}-\frac {29 t^3}{50}-\frac {41 t^2}{20}+t+1 \]

Update: As of recent versions, we can just do this

ode = u''[t] + 4 u[t] + 1/10 u[t]^3*u'[t]^2 == 0; 
ic = {u[0] == 1, u'[0] == 1}; 
AsymptoticDSolveValue[{ode, ic}, u[t], {t, 0, 6}]
 
\[ -\frac {277427 t^6}{600000}-\frac {12569 t^5}{50000}+\frac {1607 t^4}{2000}-\frac {29 t^3}{50}-\frac {41 t^2}{20}+t+1 \]