Series solutions of ODEs?



>I could generate the series (to the solution of
>y'=x^2+y^2, y(0)=1) by the more simple procedure
>(obtained by simply integrating through the
>DE):
>
>y:1
>for i:1 thru 10 y:1+x^3/3+integrate(y^2,x);
>expand(y);
>
>*if* there was a way of automatically getting all
>powers of x greater than 10 to be set to zero, or else the iteration
>gets swamped by unwieldy high powers of x.  Can I use Maxima's
>rules and patterns to do this?
>
>Thanks,
>Alasdair

Try this:

(%i1) tellrat(x^11)$
(%i2) algebraic : true$
(%i3) y : 1;
(%o3) 1
(%i4) for i : 1 thru 12 do y : rat(1+x^3/3+integrate(y^2,x));
(%o4) DONE
(%i5) y;
(%o5)
(17649*x^10+17120*x^9+16605*x^8+16160*x^7+15540*x^6+15120*x^5+14700*x^4+16800*x^3+12600*x^2+12600*x+12600)/12600


Barton