We need to compute
\[\R{partial\_x} [ j * q + 1 ]
=
\sum_{i=0}^{m-1} \R{partial\_y} [ i * q + 1]
( \partial y_i^1 ( x^0 , x^1 ) / \partial x_j^1 )\]
where \(q = 2\) and \(j = 0 , \ldots , n-1\).
Using the reverse_identity we have
\[\partial y_i^1 ( x^0 , x^1 ) / \partial x_j^1
=
\partial y_i^0 ( x^0 ) / \partial x_j^0\]
\[\R{partial\_x} [ j * q + 1 ]
=
\sum_{i=0}^{m-1} \R{partial\_y} [ i * q + 1]
( \partial y_i^0 ( x^0 ) / \partial x_j^0 )\]
which is the same as the first order
theory with
\[w_i = \R{partial\_y} [ i * q + 1]\]
We also need to compute
\[\R{partial\_x} [ j * q + 0 ]
=
\sum_{i=0}^{m-1} \R{partial\_y} [ i * q + 0]
( \partial y_i^0 ( x^0 ) / \partial x_j^0 )
+
\R{partial\_y} [ i * q + 1]
( \partial y_i^1 ( x^0 , x^1 ) / \partial x_j^0 )\]
Note that we can solve for
\[y^1 ( x^0 , x^1 ) = z^1 ( r , x^0 , x^1 )\]
using the following extended ODE; see
forward theory .
\[\begin{split}\left[ \begin{array}{c}
z^0_t (t, x^0 ) \\
z^1_t (t, x^0 , x^1 )
\end{array} \right]
=
\left[ \begin{array}{cc}
A^0 & 0 \\
A^1 & A^0
\end{array} \right]
\left[ \begin{array}{c}
z^0 (t, x^0 ) \\
z^1 (t, x^0 , x^1 )
\end{array} \right]
\; , \;
\left[ \begin{array}{c}
z^0 (0, x^0 ) \\
z^1 (0, x^0 , x^1 )
\end{array} \right]
=
\left[ \begin{array}{c}
b^0 \\
b^1
\end{array} \right]\end{split}\]
Note that
\(A^0\), \(b^0\) are components of \(x^0\)
and
\(A^1\), \(b^1\) are components of \(x^1\).
We use the following notation
\[\begin{split}\bar{x} = \left[ \begin{array}{c}
x^0 \\ x^1
\end{array} \right]
\W{,}
\bar{z}(t , \bar{x} ) = \left[ \begin{array}{c}
z^0 (t, x^0) \\ z^1 ( t, x^0 , x^1 )
\end{array} \right]
\W{,}
\bar{A} =
\left[ \begin{array}{cc}
A^0 & 0 \\
A^1 & A^0
\end{array} \right]
\W{,}
\bar{b} = \left[ \begin{array}{c}
b^0 \\ b^1
\end{array} \right]\end{split}\]
Using this notation we have
\[\bar{z}_t ( t , \bar{x} ) = \bar{A} \bar{z} (t, \bar{x} )
\W{,}
\bar{z} (0, \bar{x} ) = \bar{b}\]
Define \(\bar{w} \in \B{R}^{m + m}\) by
\[\bar{w}_i = \R{partial\_y}[ i * q + 0 ]
\W{,}
\bar{w}_{m + i} = \R{partial\_y}[ i * q + 1 ]\]
For this case, we can compute
\[\partial_\bar{x} \bar{w}^\R{T} \bar{z}(r, \bar{x} )\]
which is same as the first order case but with the extended variables
and extended ODE.
We will only use the components of
\(\partial_\bar{x}\) that correspond to partials w.r.t. \(x^0\).