Given the Runge-Kutta method, $$w_{i+1}=w_i+\frac{1}{4}k_1 +\frac{3}{8}k_2+\frac{3}{8}k_3 $$ where \begin{align} k_1 &= hf(t_i,w_i)\\ k_2 &= hf(t_i+\frac{2}{3}h,w_i+\frac{2}{3}k_1)\\ k_3 &= hf(t_i+\frac{2}{3}h,w_i+\frac{2}{3}k_2) \end{align} and $w_i$ is the approximation of $y$ the true solution at step $i$.
Show by matching Taylor series expansion of the true solution $y$, that the above method has an error of order $O(h^4)$.
Notes: This is not a question on how to solve the above question but how to do the necessary multivariate Taylor series expansion in Mathematica. Whatever I try I gives strange answers. I would like to have a general procedure for this type of problem as I am having trouble proving the order of a 5th order Runge-Kutta methods by hand.
If you need any clarification or explanation feel free to leave a comment.
Code Examples
Clear[k1, k2]
n = 2;
k1 = h f[t, w]
k2 = Series[h f[t + (2 h)/3, w + (2 k1)/3], {t, 0, n}, {w, 0, n}]
Clear[k1, k2]
k1 = h f[t, w]
k2 = Series[h f[t, w], {t, (2 h)/3, n}, {w, (2 k1)/3, n}]