I need to derive the 3rd order Runge Kutta method which needs a tedious computation of partial derivatives, which i have a feeling i will make a mistake on eventually. I was wondering if there is any software or something those lines that will help me do this? Here is the setup
$$ f = f(t,x)=x'=x'(t)=\frac{dx(t)}{dt} $$ $$ x(t+h)=x(t)+hx'(t)+\frac{h^2}{2}x''(t)+\frac{h^3}{6}x'''(t)+O(h^4) $$ $$ x(t+h)=x(t)+hf+\frac{h^2}{2}(f_t+f_xf)+\frac{h^3}{6}(f_{tt}+f_{tx}f+f_{xt}f+f_tf_x+f_{xx}f^2+(f_x)^2f)+O(h^4) $$ 3rd order $$ O(h^4)=0 $$ This is where i need help. It is defined that $$ f(x+h,t+k)=\sum\limits_{i=1}^\infty {\frac{1}{i!}(h\frac{\partial}{\partial t}+k\frac{\partial}{\partial x})^i}f(x,t) $$ For the Runge Kutta method, k is a function of x and t. I need to show that $$ x(t+h)=x(t)+\frac{1}{9}(2F_1+3F_2+4F_3) $$ Where $$ F_1=hf(t,x) , F_2=hf(t+\frac{1}{2}h,x+\frac{1}{2}F_1),F_3=hf(t+\frac{3}{4}h,x+\frac{3}{4}F_2) $$ I need either a detailed explanation on how to derive this or at least some software that can expand $$ f(x+ah,t+bk) , k=F(x,t) $$ Thanks
First, lose the $t$. You can always make it an extra coordinate by setting $\frac{d}{dt}t=1$. Now you only have to specify everything for an autonomous system $x'=f(x)$. There should be derivative tensors involved,... but the nice thing is, the coefficients of the Runge-Kutta methods do not depend on dimensions, so you can just examine the case of dimension 1. As you did in your formulas anyway.
These simplifications should help for your computation. For the general case, Butcher not only gave his name to the tableaux, he also invented Butcher trees for the systematic generation of the equations for the coefficients of Runge-Kutta methods. There is even a connection to quantum group theory... https://www.math.auckland.ac.nz/~butcher/miniature/miniature15.pdf
Leaving the leading $h$ out, the following terms need only be examined in $O(h^3)$ since the final result is a combination of $hk_j$ \begin{align} k_1&=f(x)\\ k_2&=f(x+a_{21}hk_1)&&=f+hf'\,a_{21}f+\tfrac12h^2f''\,(a_{21}f)^2\\ k_3&=f(x+a_{32}hk_2)&&=f+hf'\,a_{32}(f+hf'\,a_{21}f)+\tfrac12h^2f''\,(a_{32}f)^2\\[0.4em]\hline x_+&=x+h(b_1k_1+b_2k_2+b_3k_3)&&=x+h(b_1+b_2+b_3)f+h^2(b_2a_{21}+b_3a_{32})f'f\\ &&&\quad+h^3b_3a_{32}a_{21}f'^2f+\tfrac12h^3(b_2a_{21}^2+b_3a_{32}^2)f''f^2 \end{align} Now compare that with your formula for $x(t+h)$, leaving out all $t$ partial derivatives $$ x(t+h)=x+hf+\tfrac12h^2f_xf+\tfrac16 h^3(f_{xx}f^2+f_x^2f) $$ to read off \begin{align} 1&=b_1+b_2+b_3\\ \tfrac12&=b_2a_{21}+b_3a_{32}\\ \tfrac13&=b_2a_{21}^2+b_3a_{32}^2\\ \tfrac16&=b_3a_{32}a_{21} \end{align} 4 equations for 5 parameters, so one degree of freedom left. Now insert $a_{21}=\tfrac12$, $a_{32}=\frac34$, $b_1=\frac29$, $b_2=\frac13$, $b_3=\frac49$.