Here is a convenient input format for Mathematica
Now we do the substitutions for the derivatives as described above.