We consider an autonomous initial value ODE
y
′
(
t
)
=
f
(
y
(
t
)
)
with
y
(
t
0
)
=
y
0
.
{\displaystyle y'(t)=f(y(t))\quad {\text{with}}\quad y(t_{0})=y_{0}\,.}
(ODE )
Applying the Tradezoidal rule
gives the implicit Runge-Kutta method
y
n
+
1
=
y
n
+
h
2
(
f
(
y
n
)
+
f
(
y
n
+
1
)
)
.
{\displaystyle y_{n+1}=y_{n}+{\frac {h}{2}}\left(f(y_{n})+f(y_{n+1})\right)\,.}
(method )
We will show that (method ) is second order.
Expanding the true solution
y
(
t
n
+
h
)
{\displaystyle y(t_{n}+h)}
about
t
n
{\displaystyle t_{n}}
using Taylor series, we have
y
(
t
n
+
h
)
=
y
(
t
n
)
+
h
y
′
(
t
n
)
+
h
2
2
y
″
(
t
n
)
+
h
3
3
!
y
‴
(
t
n
)
+
O
(
h
4
)
.
{\displaystyle y(t_{n}+h)=y(t_{n})+hy'(t_{n})+{\frac {h^{2}}{2}}y''(t_{n})+{\frac {h^{3}}{3!}}y'''(t_{n})+O(h^{4})\,.}
Since
y
(
t
)
{\displaystyle y(t)}
satisfies (ODE ), we can substitute
y
′
(
t
)
=
f
(
y
(
t
)
)
{\displaystyle y'(t)=f(y(t))}
and obtain
y
(
t
n
+
h
)
=
y
(
t
n
)
+
h
f
(
y
(
t
n
)
)
+
h
2
2
f
′
(
y
(
t
n
)
)
f
(
y
(
t
n
)
)
+
h
3
3
!
[
f
″
(
y
(
t
n
)
)
(
f
(
y
(
t
n
)
)
)
2
+
(
f
′
(
y
(
t
n
)
)
)
2
f
(
y
(
t
n
)
)
]
+
O
(
h
4
)
.
{\displaystyle y(t_{n}+h)=y(t_{n})+hf(y(t_{n}))+{\frac {h^{2}}{2}}f'(y(t_{n}))f(y(t_{n}))+{\frac {h^{3}}{3!}}\left[f''(y(t_{n}))(f(y(t_{n})))^{2}+(f'(y(t_{n})))^{2}f(y(t_{n}))\right]+O(h^{4})\,.}
(true )
In (method ) we can assume
y
n
=
y
(
t
n
)
{\displaystyle y_{n}=y(t_{n})}
since that is the previous data.
Subtracting (method ) from (true ) gives us the local truncation error
y
(
t
n
+
h
)
−
y
n
+
1
=
h
2
[
f
(
y
(
t
n
)
)
−
f
(
y
n
+
1
)
]
+
h
2
2
f
′
(
y
(
t
n
)
)
f
(
y
(
t
n
)
)
+
h
3
3
!
[
f
″
(
y
(
t
n
)
)
(
f
(
y
(
t
n
)
)
)
2
+
(
f
′
(
y
(
t
n
)
)
)
2
f
(
y
(
t
n
)
)
]
+
O
(
h
4
)
.
{\displaystyle y(t_{n}+h)-y_{n+1}={\frac {h}{2}}\left[f(y(t_{n}))-f(y_{n+1})\right]+{\frac {h^{2}}{2}}f'(y(t_{n}))f(y(t_{n}))+{\frac {h^{3}}{3!}}\left[f''(y(t_{n}))(f(y(t_{n})))^{2}+(f'(y(t_{n})))^{2}f(y(t_{n}))\right]+O(h^{4})\,.}
(error1 )
In order to cancel more terms we need to expand
f
(
y
n
+
1
)
{\displaystyle f(y_{n+1})}
.
However,
y
n
+
1
≠
y
(
t
n
+
h
)
{\displaystyle y_{n+1}\not =y(t_{n}+h)}
so we cannot do a regular Taylor expansion.
Instead we can plug (method ) back into
f
{\displaystyle f}
and then do a Taylor expansion to obtain
f
(
y
n
+
1
)
=
f
(
y
(
t
n
)
+
h
2
(
f
(
y
(
t
n
)
)
+
f
(
y
n
+
1
)
)
)
=
f
(
y
(
t
n
)
)
+
h
2
(
f
(
y
(
t
n
)
)
+
f
(
y
n
+
1
)
)
f
′
(
y
(
t
n
)
)
+
h
2
8
(
f
(
y
(
t
n
)
)
+
f
(
y
n
+
1
)
)
2
f
″
(
y
(
t
n
)
)
+
O
(
h
3
)
.
{\displaystyle {\begin{aligned}f(y_{n+1})&=f\left(y(t_{n})+{\frac {h}{2}}\left(f(y(t_{n}))+f(y_{n+1})\right)\right)\\&=f(y(t_{n}))+{\frac {h}{2}}\left(f(y(t_{n}))+f(y_{n+1})\right)f'(y(t_{n}))+{\frac {h^{2}}{8}}\left(f(y(t_{n}))+f(y_{n+1})\right)^{2}f''(y(t_{n}))+O(h^{3})\,.\end{aligned}}}
(implicit )
Substituting (implicit ) into (error1 ) yields
h
2
4
f
′
(
y
(
t
n
)
)
[
f
(
y
(
t
n
)
)
−
f
(
y
n
+
1
)
]
+
−
h
3
16
(
f
(
y
(
t
n
)
)
+
f
(
y
n
+
1
)
)
2
f
″
(
y
(
t
n
)
)
+
h
3
3
!
[
f
″
(
y
(
t
n
)
)
(
f
(
y
(
t
n
)
)
)
2
+
(
f
′
(
y
(
t
n
)
)
)
2
f
(
y
(
t
n
)
)
]
+
O
(
h
4
)
.
{\displaystyle {\frac {h^{2}}{4}}f'(y(t_{n}))\left[f(y(t_{n}))-f(y_{n+1})\right]+{\frac {-h^{3}}{16}}\left(f(y(t_{n}))+f(y_{n+1})\right)^{2}f''(y(t_{n}))+{\frac {h^{3}}{3!}}\left[f''(y(t_{n}))(f(y(t_{n})))^{2}+(f'(y(t_{n})))^{2}f(y(t_{n}))\right]+O(h^{4})\,.}
(error2 )
This substitution was productive since the
h
{\displaystyle h}
terms canceled.
We can do this trick again, but this time only need (implicit ) up to
O
(
h
2
)
{\displaystyle O(h^{2})}
since everything will be multiplied by at least
h
2
{\displaystyle h^{2}}
and this can go into the
O
(
h
4
)
{\displaystyle O(h^{4})}
.
Substituting (implicit ) in for the first occurance of
f
(
y
n
+
1
)
{\displaystyle f(y_{n+1})}
in (error2 ) yields
h
3
2
{
f
″
(
y
(
t
n
)
)
[
1
3
(
f
(
y
(
t
n
)
)
)
2
+
−
1
8
(
f
(
y
(
t
n
)
)
+
f
(
y
n
+
1
)
)
2
]
+
(
f
′
(
y
(
t
n
)
)
)
2
[
1
3
f
(
y
(
t
n
)
)
+
−
1
4
(
f
(
y
(
t
n
)
)
+
f
(
y
n
+
1
)
)
]
}
+
O
(
h
4
)
.
{\displaystyle {\frac {h^{3}}{2}}\left\{f''(y(t_{n}))\left[{\frac {1}{3}}(f(y(t_{n})))^{2}+{\frac {-1}{8}}\left(f(y(t_{n}))+f(y_{n+1})\right)^{2}\right]+(f'(y(t_{n})))^{2}\left[{\frac {1}{3}}f(y(t_{n}))+{\frac {-1}{4}}\left(f(y(t_{n}))+f(y_{n+1})\right)\right]\right\}+O(h^{4})\,.}
(error3 )
This substitution was productive since the
h
2
{\displaystyle h^{2}}
terms canceled. We can do this again, now truncating (implicit ) at
O
(
h
)
{\displaystyle O(h)}
.
Substituting (implicit ) into (error3 ) yields
−
h
3
12
{
f
″
(
y
(
t
n
)
)
(
f
(
y
(
t
n
)
)
)
2
+
(
f
′
(
y
(
t
n
)
)
)
2
f
(
y
(
t
n
)
)
}
+
O
(
h
4
)
.
{\displaystyle {\frac {-h^{3}}{12}}\left\{f''(y(t_{n}))(f(y(t_{n})))^{2}+(f'(y(t_{n})))^{2}f(y(t_{n}))\right\}+O(h^{4})\,.}
Since the
h
3
{\displaystyle h^{3}}
term does not cancel, we have shown that the local truncation error is
O
(
h
3
)
{\displaystyle O(h^{3})}
and thus the method is order 2.