A Regular Perturbation Expansion
for
y ' = 1 + (1 + ϵ) y^2

Solution of y ' (x) = 1 + (1 + ϵ) y^2 with
y(0)=1.
We seek a solution of form
y(x) = y _ 0(x) + ϵy _ 1(x) + ϵ^2 y _ 2(x)
Logan 1.4 on page 50 (1st edition).

Here is the proposed series solution:

ys = Sum[y _ n[t] ϵ^n, {n, 0, 2}] + O[ϵ]^3

y _ 0[t] + y _ 1[t] ϵ + y _ 2[t] ϵ^2 + O[ϵ]^3

D[ys, t]

y _ 0^'[t] + y _ 1^'[t] ϵ + y _ 2^'[t] ϵ^2 + O[ϵ]^3

Here is the equation with the proposed perturbation solution:

peq = D[ys, t] == 1 + (1 + ϵ) ys^2

y _ 0^'[t] + y _ 1^'[t] ϵ + y _ 2^'[t] ϵ^2 + O[ϵ]^3 == (1 + y _ 0[t]^2) + (y _ 0[t]^2 + 2 y _ 0[t] y _ 1[t]) ϵ + (2 y _ 0[t] y _ 1[t] + y _ 1[t]^2 + 2 y _ 0[t] y _ 2[t]) ϵ^2 + O[ϵ]^3

With the O[ϵ] symbol, the LogicalExpand does a powerful step:

eqns = LogicalExpand[peq]

-1 - y _ 0[t]^2 + y _ 0^'[t] == 0 && -y _ 0[t]^2 - 2 y _ 0[t] y _ 1[t] + y _ 1^'[t] == 0 && -2 y _ 0[t] y _ 1[t] - y _ 1[t]^2 - 2 y _ 0[t] y _ 2[t] + y _ 2^'[t] == 0

Here is another way to look at it:

eqa = TableForm[ReplaceAll[eqns, And -> List]]

-1 - y _ 0[t]^2 + y _ 0^'[t] == 0
-y _ 0[t]^2 - 2 y _ 0[t] y _ 1[t] + y _ 1^'[t] == 0
-2 y _ 0[t] y _ 1[t] - y _ 1[t]^2 - 2 y _ 0[t] y _ 2[t] + y _ 2^'[t] == 0

Here is the ODE for y _ 0:

eqns[[1]]

-1 - y _ 0[t]^2 + y _ 0^'[t] == 0

...and it's solution:

sol0 = DSolve[{eqns[[1]], y _ 0[0] == 1}, y _ 0[t], t]

Solve :: ifun :  Inverse functions are being used by  Solve , so some solutions may not be found.

{{y _ 0[t] -> Tan[π/4 + t]}}

Here is the ODE for y _ 1, making use of the known solution for y _ 0:

eqn1 = eqns[[2]] /. sol0[[1]]

-Tan[π/4 + t]^2 - 2 Tan[π/4 + t] y _ 1[t] + y _ 1^'[t] == 0

Here is the solution for y _ 1:

sol1 = DSolve[{eqn1, y _ 1[0] == 0}, y _ 1[t], t]

{{y _ 1[t] -> (-1 - 2 t + Cos[2 t])/(2 (-1 + Sin[2 t]))}}

sol0[[1]]

{y _ 0[t] -> Tan[π/4 + t]}

eqns[[3]]

-2 y _ 0[t] y _ 1[t] - y _ 1[t]^2 - 2 y _ 0[t] y _ 2[t] + y _ 2^'[t] == 0

eqn2 = eqns[[3]] /. sol0[[1]] /. sol1[[1]]

-(-1 - 2 t + Cos[2 t])^2/(4 (-1 + Sin[2 t])^2) - ((-1 - 2 t + Cos[2 t]) Tan[π/4 + t])/(-1 + Sin[2 t]) - 2 Tan[π/4 + t] y _ 2[t] + y _ 2^'[t] == 0

sol2 = DSolve[{eqn2, y _ 2[0] == 0}, y _ 2[t], t]

{{y _ 2[t] -> 1/8 (Cos[t] - Sin[t])^(-1 - (2 Cos[2 t])/((Cos[t] - Sin[t])^3 (Cos[t] + Sin[t])) + Sin[4 t]/((Cos[t] - Sin[t])^3 (Cos[t] + Sin[t]))) (-3 Cos[t] - 2 t Cos[t] + 4 t^2 Cos[t] + 3 Cos[t] Cos[2 t] + 5 Sin[t] + 10 t Sin[t] + 4 t^2 Sin[t] - 3 Cos[2 t] Sin[t])}}

Now convert these replacement rules into approximate solutions, of increasing O[ϵ],
that we can plot:

ym0 = ys + O[ϵ]^1 /. sol0[[1]]

Tan[π/4 + t] + O[ϵ]^1

ym1 = ys + O[ϵ]^2 /. sol0[[1]] /. sol1[[1]]

Tan[π/4 + t] + ((-1 - 2 t + Cos[2 t]) ϵ)/(2 (-1 + Sin[2 t])) + O[ϵ]^2

ym2 = ys + O[ϵ]^3 /. sol0[[1]] /. sol1[[1]] /. sol2[[1]]

Tan[π/4 + t] + ((-1 - 2 t + Cos[2 t]) ϵ)/(2 (-1 + Sin[2 t])) + 1/8 (Cos[t] - Sin[t])^(-1 - (2 Cos[2 t])/((Cos[t] - Sin[t])^3 (Cos[t] + Sin[t])) + Sin[4 t]/((Cos[t] - Sin[t])^3 (Cos[t] + Sin[t]))) (-3 Cos[t] - 2 t Cos[t] + 4 t^2 Cos[t] + 3 Cos[t] Cos[2 t] + 5 Sin[t] + 10 t Sin[t] + 4 t^2 Sin[t] - 3 Cos[2 t] Sin[t]) ϵ^2 + O[ϵ]^3

ya0[t_] = Normal[ym0]

Tan[π/4 + t]

ya1[t_, ϵ_] = Normal[ym1]

(ϵ (-1 - 2 t + Cos[2 t]))/(2 (-1 + Sin[2 t])) + Tan[π/4 + t]

ya2[t_, ϵ_] = Normal[ym2]

1/8 ϵ^2 (Cos[t] - Sin[t])^(-1 - (2 Cos[2 t])/((Cos[t] - Sin[t])^3 (Cos[t] + Sin[t])) + Sin[4 t]/((Cos[t] - Sin[t])^3 (Cos[t] + Sin[t]))) (-3 Cos[t] - 2 t Cos[t] + 4 t^2 Cos[t] + 3 Cos[t] Cos[2 t] + 5 Sin[t] + 10 t Sin[t] + 4 t^2 Sin[t] - 3 Cos[2 t] Sin[t]) + (ϵ (-1 - 2 t + Cos[2 t]))/(2 (-1 + Sin[2 t])) + Tan[π/4 + t]

Test these functions:

{ya0[.6], ya1[.6, .1], ya2[.6, .1]}

{5.331855223458727`, 6.6838398691016145`, 7.038699217661623`}

Lucky for us, we can find the exact solution:

ye = DSolve[{y '[t] == 1 + (1 + ϵ) y[t]^2, y[0] == 1}, y[t], t]

Solve :: ifun :  Inverse functions are being used by  Solve , so some solutions may not be found.

{{y[t] -> Tan[t (1 + ϵ)^(1/2) + ArcTan[(1 + ϵ)^(1/2)]]/(1 + ϵ)^(1/2)}}

and here it is as a convenient function:

yexact[t_, ϵ_] = y[t] /. ye[[1]]

Tan[t (1 + ϵ)^(1/2) + ArcTan[(1 + ϵ)^(1/2)]]/(1 + ϵ)^(1/2)

Let's test it:

ya0[.6, .1]

ya0[0.6`, 0.1`]

ep = .1 ;

Here we plot the exact solution (green), the y _ 0(x)(red), y _ 0(x) + ϵy _ 1(x)(blue),  and y _ 0(x) + ϵy _ 1(x) + ϵ^2 y _ 2(x) (black).

Plot[{yexact[t, ep], ya0[t], ya1[t, ep], ya2[t, ep]}, {t, 0, .7}, PlotStyle -> {RGBColor[0, 1, 0],  RGBColor[1, 0, 0], RGBColor[0, 0, 1], RGBColor[0, 0, 0]}]

[Graphics:HTMLFiles/index_64.gif]

-Graphics -


Converted by Mathematica  (March 3, 2003)