Question: How do I find a series solution to an ODE? 
I do not mean taking the Taylor series of an exact solution; I want to solve nasty nonlinear differential equations locally via plug and chug. Surely, that is a built-in option in *Mathematica*.

Answer: 
This method of developing a truncated solution can be done as below. I illustrate with an example that DSolve does not seem much to like.

```
ode = x''[t] - t*x'[t] + Sin[t] == 0;
initconds = {x'[0] == 1, x[0] == 0};

```

We create a differentail operator to create this ode.

```
odeOperator = D[#, {t, 2}] - t*D[#, t] + Sin[t] &;

```

Now set up our Taylor series as a symbolic expansion using derivatives of `x` evaluated at the origin. I use an order of 15 but that is something one would probably make as an argument to a function, if automating all this.

```
xx = Series[x[t], {t, 0, 15}];

```

Next apply the differential operator and add the initial conditions. Then find a solution that makes all powers of `t vanish.

```
soln = SolveAlways[Join[{odeOperator[xx] == 0}, initconds], t];

```

Let's look at the Taylor polynomial.

```
truncatedSol = Normal[xx /. soln[[1]]]

(* Out[500]= t + t^5/120 + t^7/1260 + (29 t^9)/362880 + (
 13 t^11)/1995840 + (2861 t^13)/6227020800 + (4649 t^15)/163459296000 *)

```

To assess how accurate it might be I will compare with `NDSolve`.

```
approxSol = NDSolve[Join[{ode}, initconds], x[t], {t, 0, 4}];

Plot[{truncatedSol, x[t] /. approxSol[[1]]}, {t, 0, 4}]

```

![enter image description here](https://i.stack.imgur.com/UsSAm.png)
On Mathematica `11.3` using a new function `AsymptoticDSolveValue`

Linear ODE:

```
AsymptoticDSolveValue[{y''[x] - x*y'[x] + Sin[x] == 0, y'[0] == 1, 
y[0] == 0}, y[x], {x, 0, 10}]

(* x + x^5/120 + x^7/1260 + (29 x^9)/362880  *)

```

Quasilinear ODE:

```
AsymptoticDSolveValue[{y''[x] + y'[x] == Sin[2*y[x]], y[0] == a, 
y'[0] == b}, y[x], {x, 0, 5}]

(* a + b x + 1/6 x^3 (b + 2 b Cos[2 a] - Sin[2 a]) + 
1/2 x^2 (-b + Sin[2 a]) + 
1/24 x^4 (-b - 4 b Cos[2 a] + Sin[2 a] - 4 b^2 Sin[2 a] + 
2 Cos[2 a] Sin[2 a]) + 
1/120 x^5 (b + 6 b Cos[2 a] - 8 b^3 Cos[2 a] + 4 b Cos[2 a]^2 - 
Sin[2 a] + 16 b^2 Sin[2 a] - 4 Cos[2 a] Sin[2 a] - 
12 b Sin[2 a]^2)*)

```

Nonlinear ODE:

```
AsymptoticDSolveValue[{y'[x] == 1 + y[x]^2, y[0] == 0}, y[x], {x, 0, 10}]

(* x + x^3/3 + (2 x^5)/15 + (17 x^7)/315 + (62 x^9)/2835 *)

```