\documentclass{article} % For LaTeX2e
\usepackage{nips15submit_e,times}
\usepackage{hyperref}
\usepackage{url}
\usepackage{graphicx}
\usepackage{amsmath}
%\documentstyle[nips14submit_09,times,art10]{article} % For LaTeX 2.09

\title{Weekly Report(January.25,2019-March.4,2019)}

\author{Rui Shaopu}

\maketitle

\begin{abstract}
During the winter holiday, I learned several optimization algorithms first, then I also learnt a lot about classifiers and finished assignment 1 of cs231n.
\end{abstract}

\section{Learnt and Did}

Mainly I learned about classifiers and optimization algorithms. And I finished assignment 1, which gives me a big challenge, since I'm not familiar with python.

\subsection{Optimization Algorithms}
\subsubsection{Gradient Descent}
Usually we use this way to find the maximum value or the minimum value. We shall make it when the function is convex function.

Main formula:
\begin{center}
${\displaystyle J(\theta) = \frac{1}{2m}\sum_{i=1}^{m}(y_i-h_\theta(x_i))^2}$
\end{center}
partial derivation:
\begin{center}
${\displaystyle \theta'_j=\theta_j+(y_j-h_\theta(x_i))x_j^i}$
\end{center}
To get the value we want, we need to update parameters in the oppsite direction of gradient.

\subsubsection{Logistic Regression}
It is usually used to dedal with two classification problems since its unique attributes.

Main formula:
\begin{center}
${\displaystyle Y_w=\frac{1}{1+e^{-W^TX}}}$
\end{center}
Log likelihood function:
\begin{center}
${\displaystyle L(W)=-\frac{1}{m}\log({\prod_{i=1}^{m}[Y_w(X_i)]^{y_i}[1-Y_w(X_i)]^{1-y_i}})}$
\end{center}
Iterative formula($\alpha$ is learning rate):
\begin{center}
${\displaystyle W_j=\frac{\alpha}{m}\sum_{i=1}^{m}(Y_w(xi)-y_i)x_{ij}}$
\end{center}

\subsubsection{Newton's method}
Newton's method drops faster than gradient descent. However, it works bad when dealing with hessian matrix.

Main formula:
\begin{center}
${\displaystyle x_{n+1}=x_n-\frac{f'(x_n)}{f"(x_n)}}$
\end{center}

Hessian matrix:
\begin{center}
${\displaystyle x_{n+1}=x_n-\frac{J_f(x_n)}{H(x_n)}}$

%\end{center}

${\displaystyle J_f(x_n)=}
% $
%$$
\left[
\begin{matrix}
	\frac{\partial y_1}{\partial x_1} & \cdots & \frac{\partial y_n}{\partial x_1}\\
	\vdots & \ddots & \vdots \\
	\frac{y_1}{x_n} & \cdots & \frac{y_n}{x_n}
\end{matrix}\quad
\right]
$

${\displaystyle H(x_n)=}
% $
%$$
\left[
\begin{matrix}
\frac{\partial^2 f}{\partial x_1^2}   & \cdots & \frac{\partial^2 f}{\partial x_1 \partial x_n}      \\
\vdots & \ddots & \vdots \\
\frac{\partial^2 f}{\partial x_n \partial x_1}   & \cdots & \frac{\partial^2 f}{\partial x_n^2}
\end{matrix}
\right]
% $
$

\end{center}

\subsection{Classifiers}

\subsubsection{KNN}
KNN, K Nearest Neighbor, One of the most easiest classifiers.

\begin{figure}[h]
	\centering  %插入的图片居中表示
	\includegraphics[width=.4\textwidth]{5.png}
	\caption{2-dimension}  %图片的名称
	\label{fig:f5}   %标签，用作引用
\end{figure}
In the training process of this algorithm, it stores all the input and output labels of training samples. in the test process, the distance between the test sample and each training sample L1 or L2 is calculated, then the first k training sample closest to test sample are selected. Then we'll vote on the label of the k samples, the category with the largest number of votes is categorized as test samples.

KNN is very easy, however it gets a bad result with classification accuracy of 27 percent.

\subsubsection{SVM}
SVM, Support Vector Machine, is a kind of generalized linear classifier which classifies data by supervised learning. Its decision boundary is the maximum margin hyperplane for solving learning samples.

Under normal conditions, we use linear-SVM to classify two kinds of data, between which there is an obvious interval. However, if it doesn't exist, we need to find it in higher dimension. The figures below show it.

\begin{figure}[h]
	\centering  %插入的图片居中表示
	\includegraphics[width=.4\textwidth]{1.jpg}
	\caption{2-dimension}  %图片的名称
	\label{fig:f1}   %标签，用作引用
\end{figure}
\begin{figure}[h]
	\centering  %插入的图片居中表示
	\includegraphics[width=.4\textwidth]{2.jpg}
	\caption{higher dimension}  %图片的名称
	\label{fig:f2}   %标签，用作引用
\end{figure}

\subsubsection{Softmax}
In mathematics, the softmax function, also known as softargmax or normalized exponential function, is a function that takes as input a vector of K real numbers, and normalizes it into a probability distribution consisting of K probabilities.

That is, after applying softmax, each component will be in the interval(0,1), and the components will add up to 1, so that they can be interpreted as probabilities. Furthermore, the larger input components will correspond to larger probabilities. Softmax is often used in neural networks and Often acts as an activation function of a neural network

The standard (unit) softmax function ${\displaystyle \sigma : {R} ^{K}\to {R} ^{K}}$ is defined by the formula

${\displaystyle \sigma (\mathbf {z} )_{j}={\frac {e^{z_{j}}}{\sum _{k=1}^{K}e^{z_{k}}}}}$
for j = 1, …, K and ${\displaystyle {\mathbf {z}}=(z_{1},\ldots ,z_{K})\in  {R} ^{K}}$

\subsubsection{Neural Network}
Neural network is a very important part of machine learning. As I know, Convolutional neural network is the most powerful one. In assignment 1, I need to finish a two-layer neural network.

Main Formulas:

Hyperplane:
\begin{center}
	${\displaystyle y = W X+b}$
\end{center}

Activation function:
\begin{center}
	${\displaystyle f_{sigmod} = \frac{1}{1+e^{z}}}$
\end{center}
Activation function derivation:
\begin{center}
	${\displaystyle f'_{sigmod} = f_{sigmod}(1-f_{sigmod})}$
\end{center}

\begin{figure}[h]
	\centering  %插入的图片居中表示
	\includegraphics[width=.4\textwidth]{4.png}
	\caption{2-dimension}  %图片的名称
	\label{fig:f3}
\end{figure}

\section{Problems}
The best problem I got is that I'm not familiar with Python libraries, such as numpy, matplotlib and so on. So was matrix operation. It took me a lot of time dealing with them and they still troubles me. My English is not very good too, I'm really gatefull that you finish reading it. Thanks a lot.

\section{Plan for Next Weeks}
In the following weeks, I will keep going and finish assignment 2. I will still learn to use python and latex familiarly.

\end{document}


\documentclass[12pt]{amsart}
\usepackage[margin=0.5in]{geometry}
  % see geometry.pdf on how to lay out the page. There's lots.
\usepackage{bsymb}
\usepackage{calculational}
\usepackage{ulem}
\usepackage{hyperref}
\usepackage{unitb}

\newcommand{\REQ}{\text{REQ}}
\newcommand{\OBJ}{\mathcal{O}bj}
\newcommand{\Addr}{\mathcal{P}tr}
\newcommand{\link}{\textit{LINK}}
\newcommand{\trash}{\textit{TRASH}}
\newcommand{\shared}{\textit{SHARED}}

\begin{document}

\section{m0}
\input{pop-left/machine_m0}
\begin{machine}{m0}
    \with{functions}
    \[\newset{\Addr_0}\]
    \[\newset{\OBJ_0}\]

shared:
    \[ \variable{ LH, RH : \Addr_0 } \]
    \[ \variable{ free : \set [\Addr_0] } \]
    \[ \variable{ ver : \Int } \]
    \[ \variable{ \link, \trash : \Addr_0 \pfun
        \{ 'item : \OBJ_0
         , 'left : \Addr_0
         , 'right : \Addr_0  \} } \]

private:
    \[ \variable{ popL,remL : \Bool } \]
    \[ \variable{ resL : \OBJ_0 } \]

internal:
\newevent{add:popL}{req\_popL}
\newevent{hdl:popL:empty}{hdl\_popL\_empty}
\newevent{hdl:popL:one}{hdl\_popL\_one}
\newevent{hdl:popL:more}{hdl\_popL\_more}
\newevent{returnL}{returnL}

\begin{align*}
    \evguard{add:popL}{m0:grd0}{\neg popL}
\end{align*}

external:
\newevent{ext:pushL:empty}{EXT\_pushL\_empty}
\newevent{ext:pushL:non:empty}{EXT\_pushL\_non\_empty}
\newevent{ext:pushR:empty}{EXT\_pushR\_empty}
\newevent{ext:pushR:non:empty}{EXT\_pushR\_non\_empty}
\newevent{ext:popL:empty}{EXT\_popL\_empty}
\newevent{ext:popL:one}{EXT\_popL\_one}
\newevent{ext:popL:more}{EXT\_popL\_more}
\newevent{ext:popR:empty}{EXT\_popR\_empty}
\newevent{ext:popR:one}{EXT\_popR\_one}
\newevent{ext:popR:more}{EXT\_popR\_more}
\newevent{ext:return}{EXT\_return}

\end{machine}
\section{m1}

\end{document}


\documentclass{article}
\usepackage{amsmath}
\usepackage{a4wide}

\usepackage{igor_macros}

%%No paragraph break on emty lines
\catcode10=10   \catcode13=10

\def\dint#1#2{\int_{#1}^{#2}}

\def\tower3#1#2#3{\overset{#3}{\underset{#2}{#1}}}

\def\braced#1{\left\lbrace{#1}\right\rbrace}

\title {4th order time dependence}
\author {Igor Bukanov}
\date { 2001-11-04 }

\begin{document}

\begin{abstract}
Should be written
\end{abstract}

\maketitle

\section{Should be named 1}

Time-dependent equation in Dirak picture:
\eqn{
\frac{dX}{dt} = \left[\frac{i}{\hbar}H(t), X\right]
}
or
\eqnl{diff-time-dependence}{
\frac{dX}{dt} = \left[h(t), X\right]
}
with
\eqn{
h(t) \equiv \frac{i}{\hbar}H(t)
}

\p
Typically $H(t)$ is a small operator (in some particular sence) given by
\eqn{
H(t) = e^{\frac{it}{\hbar}H_0}H_1 e^{-\frac{it}{\hbar}H_0t}
}
where $H_0 + H_1$ form the time independent Hamiltonian with $H_1$ small.

\p
Integral form of \rf{diff-time-dependence} is
\eqnl{int-time-dependence}{
X(T) = X(t_0) + \dint{t_0}{T} dt \left[h(t), X(t)\right]
}

\p The forth order approximation of the solution for \rf{int-time-dependence} is given by
\eqn{
X(T) \approx X_0 + Z_1 + Z_2 + Z_3 + Z_4
}
where
\eqn{
X_0 \equiv X(t_0)
}
and $Z_i$ are defined by

\eqnl{Z-definition}{
\begin{split}
Z_1 & = \dint{t_0}{T} dt [h(t), X_0] \\
Z_2 & = \dint{t_0}{T} dt_2 \dint{t_0}{t_2} dt_1 [h(t_2), [h(t_1), X_0]] \\
Z_3 & = \dint{t_0}{T} dt_3 \dint{t_0}{t_3} dt_2 \dint{t_0}{t_2} dt_1
         [h(t_3), [h(t_2), [h(t_1), X_0]]] \\
Z_4 & = \dint{t_0}{T} dt_4 \dint{t_0}{t_4} dt_3 \dint{t_0}{t_3} dt_2
         \dint{t_0}{t_2} dt_1 [h(t_4), [h(t_3), [h(t_2), [h(t_1), X_0]]]]
\end{split}
}

\p
The problem with the expression for $Z_i$ in \rf{Z-definition} is that it is not possible to perform integration over $t$ without knowledge of $X_0$. So in the following I will get expression for $Z_i$ that would involve only time integration  of some expressions of $h(t_i)$-commutators with dependence on $x_0$ only via subsequent commutation of the integration results with $X_0$.

\p
New shorthand
\eqn{\begin{split}
x & \equiv X_0 \\
h_i & \equiv h(t_i)
\end{split}}

And notation for multi intergration
\begin{multline*}
\braced{{i_1}_{a_1}^{b_1}{i_2}_{a_2}^{b_2}\dots{i_N}_{a_N}^{b_N}}
 f(t_{i_1}, t_{i_2}, \dots, t_{i_N})
\\
\equiv \quad
\int_{t_{a_1}}^{t_{b_1}} dt_{i_1}
\int_{t_{a_2}}^{t_{b_2}} dt_{i_2}
\dots
\int_{t_{a_N}}^{t_{b_N}} dt_{i_N}
f(t_{i_1}, t_{i_2}, \dots, t_{i_N})
\end{multline*}

with additional rule that if some $a_i$ or $b_i$ is $T$, then it stands in the integration limits for $T$ itself and not for $t_T$.
\p
Examples:
\eqn{
\braced{ 2_0^T 1_0^T }
 f(h_1, h_2) \quad
\equiv \quad
\int_{t_0}^T dt_2 \int_{t_0}^T dt_1 f(h(t_1), h(t_2))
}

\eqn{
\braced{ 3_0^T 1_3^T 2_3^1 }
 f(h_3, h_2, h_1) \quad
\equiv \quad
\int_{t_0}^T dt_3 \int_{t_3}^T dt_1 \int_{t_3}^{t_1} dt_2
f(h(t_3), h(t_2), h(t_1))
}

\begin{multline*}
\braced{4_0^T 3_0^4 2_0^3 1_0^2 }
 f(h_4, h_3, h_2, h_1) \\
\equiv \quad
\int_{t_0}^T dt_4 \int_{t_0}^{t_4} dt_3 \int_{t_0}^{t_3} dt_3
 \int_{t_0}^{t_2} dt_1  f(h(t_4), h(t_3), h(t_2), h(t_1))
\end{multline*}

\p
Now I can state in a compact form the following lemmas that I will need later during $Z_i$ transformatins.

\eqnl{cicle-int-sum-3}{
\left( \braced{3_0^T 2_0^3 1_0^3} + \braced{2_0^T 1_0^2 3_0^2}
 + \braced{1_0^T 3_0^1 2_0^1}
 \right) F
\, = \, \braced{3_0^T 2_0^T 1_0^T}  F
}

\eqnl{cicle-int-sum-4}{
\left( \braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{3_0^T 2_0^3 1_0^3 4_0^3}
+ \braced{2_0^T 1_0^2 4_0^2 3_0^2} + \braced{1_0^T 4_0^1 3_0^1 2_0^1}
 \right) F
\, = \, \braced{4_0^T 3_0^T 2_0^T 1_0^T}  F
}

where \rf{cicle-int-sum-3} in the left part contains cyclic transposition of $3\,2\,1$ and \rf{cicle-int-sum-4} contains cyclic transposition of
$4\,3\,2\,1$.

\p
These are generalization of
\eqnl{cicle-int-sum-2}{
\left( \braced{2_0^T 1_0^2} + \braced{1_0^T 2_0^1}
 \right) F
\, = \, \braced{2_0^T 1_0^T}  F
}

The proof of \rf{cicle-int-sum-3} and \rf{cicle-int-sum-4} uses the following change result for change of integration order:
\eqnl{int-order-change-2}{
\braced{1_B^C 2_A^1}  F
\; = \;
\left( \braced{2_A^B 1_B^C} + \braced{2_B^C 1_2^C}
 \right) F
}
or with explicit integral signs:
\eqn{
\int_{t_B}^{t_C} dt_1 \int_{t_A}^{t_1} dt_2
\; = \;
\left( \int_{t_A}^{t_B} dt_2 \int_{t_B}^{t_C} dt_1
+  \int_{t_B}^{t_C} dt_2 \int_{t_2}^{t_C} dt_1 \right) F

}

Indeed:
\begin{align*}
\braced{1_B^C 2_A^1}  F
& = \; \left(\braced{1_B^A 2_A^1} + \braced{1_A^C 2_A^1}\right) F
\; = \; \left(-\braced{1_A^B 2_A^1} + \braced{1_A^C 2_A^1}  \right) F
\\& = \; \left(-\braced{2_A^B 1_2^B} + \braced{2_A^C 1_2^C} \right) F
\\& = \; \left(-\braced{2_A^B 1_2^C} - \braced{2_A^B 1_C^B}
     + \braced{2_A^C 1_2^C} \right) F
\\& = \; \left(-\braced{2_A^B 1_2^C} + \braced{2_A^B 1_B^C}
     + \braced{2_A^C 1_2^C}  \right) F
\\& = \; \left(\braced{2_B^A 1_2^C}  + \braced{2_A^B 1_B^C}
     + \braced{2_A^C 1_2^C} \right) F
\\& = \; \left(\braced{2_A^B 1_B^C}
     + \braced{2_B^A 1_2^C} + \braced{2_A^C 1_2^C} \right) F
\\& = \; \left(\braced{2_A^B 1_B^C}  + \braced{2_B^C 1_2^C}\right) F,
\end{align*}

where I used:
\eqn{
\int_a^b dt f(t) \; = \; \left(\int_a^c dt + \int_c^b\right) dt f(t),
\qquad \int_a^b dt f(t) \; = \; -\int_b^a dt f(t)
}
and
\eqn{
\int_a^b dt_1 \int_a^{t_1} dt_2 f(t_1, t_2)
\; = \; \int_a^b dt_2 \int_{t_1}^b dt_1 f(t_1, t_2)

}

Now I have for the left side of \rf{cicle-int-sum-3} by changing integration order in the second and third terms to $3-2-1$:
\begin{align*}
\lefteqn{\braced{3_0^T 2_0^3 1_0^3} + \braced{2_0^T 1_0^2 3_0^2}
 + \braced{1_0^T 3_0^1 2_0^1}}
\\ & = \;
\braced{3_0^T 2_0^3 1_0^3} + \braced{2_0^T 3_0^2 1_0^2}
 + \braced{3_0^T 1_3^T 2_0^1}
\\ & = \;
\braced{3_0^T 2_0^3 1_0^3} + \braced{3_0^T 2_3^T 1_0^2}
 + \braced{3_0^T 2_0^3 1_3^T} + \braced{3_0^T 2_3^T 1_2^T}.
\end{align*}

Farther regrouping and fusing according to $\int_a^b = \int_a^c + \int_c^b$ first for $t_1$ and then for $t_2$ prooves \rf{cicle-int-sum-3}:
\begin{align*}
\lefteqn{\braced{3_0^T 2_0^3 1_0^3} + \braced{2_0^T 1_0^2 3_0^2}
 + \braced{1_0^T 3_0^1 2_0^1}}
\\ & = \;
\braced{3_0^T 2_0^3 1_0^3}  + \braced{3_0^T 2_0^3 1_3^T}
+ \braced{3_0^T 2_3^T 1_0^2} + \braced{3_0^T 2_3^T 1_2^T}.
\\ & = \;
\braced{3_0^T 2_0^3 1_0^T} + \braced{3_0^T 2_3^T 1_0^T}
\; = \;
\braced{3_0^T 2_0^T 1_0^T}

\end{align*}

\p
The procedure works for \rf{cicle-int-sum-4} as well. Changing integration order to $4-3-2-1$ gives:
\begin{align*}
\lefteqn{\braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{3_0^T 2_0^3 1_0^3 4_0^3}
+ \braced{2_0^T 1_0^2 4_0^2 3_0^2} + \braced{1_0^T 4_0^1 3_0^1 2_0^1}}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{3_0^T 4_0^3 2_0^3 1_0^3}
+ \braced{2_0^T 4_0^2 3_0^2 1_0^2}
+ \braced{1_0^T 4_0^1 3_0^1 2_0^1}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{4_0^T 3_4^T 2_0^3 1_0^3}
+ \braced{4_0^T 2_4^T 3_0^2 1_0^2}
+ \braced{4_0^T 1_4^T 3_0^1 2_0^1}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{4_0^T 3_4^T 2_0^3 1_0^3}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^2}+ \braced{4_0^T 3_4^T 2_3^T 1_0^2}
+ \braced{4_0^T 1_4^T 3_0^1 2_0^1}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{4_0^T 3_4^T 2_0^3 1_0^3}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^2} + \braced{4_0^T 3_4^T 2_3^T 1_0^2}
\\ & \qquad
+ \braced{4_0^T 3_0^4 1_4^T 2_0^1} + \braced{4_0^T 3_4^T 1_3^T 2_0^1}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{4_0^T 3_4^T 2_0^3 1_0^3}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^2} + \braced{4_0^T 3_4^T 2_3^T 1_0^2}
\\ & \qquad
+ \braced{4_0^T 3_0^4 2_0^4 1_4^T} + \braced{4_0^T 3_0^4 2_4^T 1_2^T}
+ \braced{4_0^T 3_4^T 2_0^3 1_3^T} + \braced{4_0^T 3_4^T 2_3^T 1_2^T}
\end{align*}

Rearrangements and fusing provide \rf{cicle-int-sum-4}:

\begin{align*}
\lefteqn{\braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{3_0^T 2_0^3 1_0^3 4_0^3}
+ \braced{2_0^T 1_0^2 4_0^2 3_0^2} + \braced{1_0^T 4_0^1 3_0^1 2_0^1}}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{4_0^T 3_0^4 2_0^4 1_4^T}
+ \braced{4_0^T 3_4^T 2_0^3 1_0^3} + \braced{4_0^T 3_4^T 2_0^3 1_3^T}
\\ & \qquad
+ \braced{4_0^T 3_0^4 2_4^T 1_0^2} + \braced{4_0^T 3_0^4 2_4^T 1_2^T}
+ \braced{4_0^T 3_4^T 2_3^T 1_0^2} + \braced{4_0^T 3_4^T 2_3^T 1_2^T}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^4 1_0^T} + \braced{4_0^T 3_4^T 2_0^3 1_0^T}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^T} + \braced{4_0^T 3_4^T 2_3^T 1_0^T}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^4 1_0^T}+ \braced{4_0^T 3_0^4 2_4^T 1_0^T}
+ \braced{4_0^T 3_4^T 2_0^3 1_0^T}+ \braced{4_0^T 3_4^T 2_3^T 1_0^T}
\\ & = \;
\braced{4_0^T 3_0^4 2_0^T 1_0^T} + \braced{4_0^T 3_4^T 2_0^T 1_0^T}
\; = \;
\braced{4_0^T 3_0^T 2_0^T 1_0^T}
\end{align*}

\p
Transformation of $Z_2$ which in new notation is given according to from \rf{Z-definition} by
\eqn{
Z_2  = \braced{2_0^T 1_0^2} [h_2, [h_1, x]]
}

After splitting according to $a=\frac{1}{2}a + \frac{1}{2}a$ and renaming $1\leftrightarrow 2$ I have
\begin{align*}
Z_2
& = \; \frac{1}{2}\braced{2_0^T 1_0^2} [h_2, [h_1, x]] + \frac{1}{2}\braced{2_0^T 1_0^2} [h_2, [h_1, x]]
\\ & = \;  \frac{1}{2}\braced{2_0^T 1_0^2} [h_2, [h_1, x]] + \frac{1}{2}\braced{1_0^T 2_0^1} [h_1, [h_2, x]]
\end{align*}

Appling
\eqnl{comm-like-diff}{
[a, [b, c]] =  [[a, b], c]] + [b, [a, c]]
}
gives:
\begin{align*}
Z_2
& = \;  \frac{1}{2}\braced{2_0^T 1_0^2} [h_2, [h_1, x]] + \frac{1}{2}\braced{1_0^T 2_0^1} \left([[h_1, h_2], x]] + [h_2, [h_1, x]]\right)
\\ & = \;  \frac{1}{2}\left(\braced{2_0^T 1_0^2} + \braced{1_0^T 2_0^1}\right)[h_2, [h_1, x]] + \frac{1}{2}\braced{1_0^T 2_0^1} [[h_1, h_2], x]]
\end{align*}

Finally according to \rf{cicle-int-sum-2} I get
\eqn{
Z_2 \; = \;  \frac{1}{2}\braced{2_0^T 1_0^T}[h_2, [h_1, x]] + \frac{1}{2}\braced{1_0^T 2_0^1} [[h_1, h_2], x]]
}

or after reaname $1\leftrightarrow 2$ in the second term
\eqnl{Z-2-transformed}{
Z_2
\; = \; \frac{1}{2}\braced{2_0^T 1_0^T}[h_2, [h_1, x]] + \frac{1}{2}\braced{2_0^T 1_0^2} [[h_2, h_1], x]]
}

which can be written also as
\eqn{
\begin{split}
Z_2 & = \;  \frac{1}{2}\left[\int_0^T dt\,h(t), \left[\int_0^T dt\,h(t), \; X_0\right]\right]
\\ & + \; \frac{1}{2}\left[\int_0^T dt_2 \int_0^{t_2} dt_1 [h(t_2), h(t_1)],\; X_0\right]
\end{split}
}

that allows to carry out time integration only with knowledge of $h(t)$.

\p Dealing with $Z_3$ and $Z_4$ would be based on similar transformations but of cause the calculation would be rather lengthy.

\p
For $Z_3$ I first use \rf{Z-2-transformed} to write
\eqn{
\begin{split}
Z_3
& \equiv \;
\braced{3_0^T 2_0^3 1_0^2} [h(t_3), [h(t_2), [h(t_1), x]]]
\\ & = \;
\frac{1}{2}\braced{3_0^T 2_0^3 1_0^3}[h_3, [h_2, [h_1, x]]] + \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\end{split}
}
\p
Slitting the first term via $a = \frac{1}{3}a + \frac{1}{3}a + \frac{1}{3}a$ and performing cyclic renames $2\leftrightarrow 3$ in the second part and $1\rightarrow 2 \rightarrow 3 \rightarrow 1$ in the second gives
\eqnl{Z3-calc-1}{
\begin{split}
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[h_3, [h_2, [h_1, x]]]
\\ & \quad
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[h_3, [h_2, [h_1, x]]]

\\& = \;
\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{6}\braced{2_0^T 3_0^2 1_0^2}[h_2, [h_3, [h_1, x]]]
\\ & \quad
+\frac{1}{6}\braced{1_0^T 3_0^1 2_0^1}[h_1, [h_3, [h_2, x]]]
\end{split}
}

I use \rf{comm-like-diff} to get for the third and forth term expression that would involve $[h_3, [[h_2, [h_1, x]]]$ plus terms where x nesting is no more then 2. For the commutators in the third and forth terms I have
\eqn{
\begin{split}
[h_2, [h_3, [h_1, x]]]
& = \; [[h_2, h_3], [h_1, x]] + [h_3, [h_2, [h_1, x]]]
\\
[h_1, [h_3, [h_2, x]]]
& = \; [[h_1, h_3], [h_2, x]] + [h_3, [h_1, [h_2, x]]]
\\ & = \; [[h_1, h_3], [h_2, x]] + [h_3, [[h_1, h_2], x]] + [h_3, [h_2, [h_1, x]]]
\end{split}
}

Thus \rf{Z3-calc-1} becomes
\eqn{
\begin{split}
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{6}\braced{2_0^T 3_0^2 1_0^2}
\left([[h_2, h_3], [h_1, x]] + [h_3, [h_2, [h_1, x]]] \right)
\\ & \quad
+\frac{1}{6}\braced{1_0^T 3_0^1 2_0^1}\left([[h_1, h_3], [h_2, x]] + [h_3, [[h_1, h_2], x]] + [h_3, [h_2, [h_1, x]]]\right)
\end{split}
}

or after regrouping terms and using \rf{cicle-int-sum-3}
\eqn{
\begin{split}
Z_3
& = \;
\frac{1}{6}\left(\braced{3_0^T 2_0^3 1_0^3} + \braced{2_0^T 1_0^2 3_0^2} + \braced{1_0^T 3_0^1 2_0^1}\right)[h_3, [h_2, [h_1, x]]]
\\ & \quad
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{6}\braced{2_0^T 3_0^2 1_0^2}[[h_2, h_3], [h_1, x]]
\\ & \quad
+\frac{1}{6}\braced{1_0^T 3_0^1 2_0^1}\left([[h_1, h_3], [h_2, x]] + [h_3, [[h_1, h_2], x]]\right)

\\& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{6}\braced{2_0^T 3_0^2 1_0^2}[[h_2, h_3], [h_1, x]]
\\ & \quad
+\frac{1}{6}\braced{1_0^T 3_0^1 2_0^1}\left([[h_1, h_3], [h_2, x]] + [h_3, [[h_1, h_2], x]]\right)
\end{split}
}

Renaming $2\,3$ back to $3\,2$ in the third term and $1\,3\,2$ back to $3\,2\,1$ in the forth gives
\eqnl{Z3-calc-2}{
\begin{split}
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[[h_3, h_2], [h_1, x]]
\\ & \quad
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}\left([[h_3, h_2], [h_1, x]] + [h_2, [[h_3, h_1], x]]\right)
\end{split}
}

Transforming the last commutator:
\eqn{
[h_2, [[h_3, h_1], x]] = [[h_2, [h_3, h_1]], x] + [[h_3, h_1], [h_2, x]]
}
and using
\eqn{
\splitDo{
\braced{3_0^T 2_0^3 1_0^3}[[h_3, h_1], [h_2, x]]
 &= \braced{3_0^T 1_0^3 3_0^3}[[h_3, h_1], [h_2, x]]
\\& = \braced{3_0^T 2_0^3 1_0^3}[[h_3, h_2], [h_1, x]]
}
}
where I first change integration order and then renamed $1\leftrightarrow 2$,
provides for~\rf{Z3-calc-2}
\eqn{
\begin{split}
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[[h_3, h_2], [h_1, x]]
\\ & \quad
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}\left([[h_3, h_2], [h_1, x]] + [[h_2, [h_3, h_1]], x] + [[h_3, h_1], [h_2, x]] \right)

\\& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[[h_3, h_2], [h_1, x]]
\\ & \quad
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}\left([[h_3, h_2], [h_1, x]] + [[h_2, [h_3, h_1]], x] + [[h_3, h_2], [h_1, x]] \right)
\end{split}
}
or
\eqnl{Z3-calc-3}{
\splitDo{
Z_3 & = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]
\\ & \quad
+\frac{1}{2}\braced{3_0^T 2_0^3 1_0^3} [[h_3, h_2], [h_1, x]]
+\frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[[h_2, [h_3, h_1]], x]
}
}

I transform the second term in \rf{Z3-calc-3}:
\eqn{
\splitDo{
\lefteqn{\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]}
\\ & \; = \;
\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} \left([[h_3, [h_2, h_1]], x] + [[h_2, h_1], [h_3, x]] \right)
\\ & \; = \;
\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_2, h_1], [h_3, x]]
\\ & \; = \;
\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{2}\braced{1_0^T 3_0^1 2_0^3} [[h_3, h_2], [h_1, x]]
}}
after the rename $3\rightarrow 1\rightarrow 2 \rightarrow 3$ in the second term. Changing integration order in this term back to $3\,2\,1$ gives
\eqn{
\splitDo{
\lefteqn{\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [h_3, [[h_2, h_1], x]]}
\\ & \; = \;
\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{2}\braced{3_0^T 1_3^T 2_0^3} [[h_3, h_2], [h_1, x]]
\\ & \; = \;
\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_3^T} [[h_3, h_2], [h_1, x]]
}}

Thus I have for \rf{Z3-calc-3}
\eqn{
\splitDo{
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
\\ & \quad
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_3^T} [[h_3, h_2], [h_1, x]]
\\ & \quad
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^3} [[h_3, h_2], [h_1, x]]
+ \frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[[h_2, [h_3, h_1]], x],
}}

\eqn{
\splitDo{
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
\\ & \quad
+ \frac{1}{2}\left(\braced{3_0^T 2_0^3 1_3^T} + \braced{3_0^T 2_0^3 1_0^3}\right) [[h_3, h_2], [h_1, x]]
\\ & \quad
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[[h_2, [h_3, h_1]], x]
}}

or finally
\eqnl{Z-3-transformed}{
\splitDo{
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^T} [[h_3, h_2], [h_1, x]]
\\ & \quad
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{6}\braced{3_0^T 2_0^3 1_0^3}[[h_2, [h_3, h_1]], x]
}}

For practical calculations it is better to transform \rf{Z-3-transformed} to a form where it has smaller number of different commutators. I have for the last integration in \rf{Z-3-transformed} via renaming $2\leftrightarrow 3$ and integration order change:
\eqn{
\braced{3_0^T 2_0^3 1_0^3}[[h_2, [h_3, h_1]], x]
=
\braced{2_0^T 3_0^2 1_0^2}[[h_3, [h_2, h_1]], x]
=
\braced{3_0^T 2_3^T 1_0^2}[[h_3, [h_2, h_1]], x]
}

Thus \rf{Z-3-transformed} becomes
\eqn{
\splitDo{
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^T} [[h_3, h_2], [h_1, x]]
\\ & \quad
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{6}\braced{3_0^T 2_3^T 1_0^2} [[h_3, [h_2, h_1]], x]
\\
& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^T} [[h_3, h_2], [h_1, x]]
\\ & \quad
+ \left(\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2}
+ \frac{1}{6}\braced{3_0^T 2_3^T 1_0^2} \right) [[h_3, [h_2, h_1]], x].
}}

Regrouping the term in parenthesis gives:
\eqn{
\splitDo{
\frac{1}{2}\braced{3_0^T 2_0^3 1_0^2}
+ \frac{1}{6}\braced{3_0^T 2_3^T 1_0^2}
& = \;
\frac{1}{3}\braced{3_0^T 2_0^3 1_0^2}
+ \frac{1}{6}\left(\braced{3_0^T 2_0^3 1_0^2}
+ \braced{3_0^T 2_3^T 1_0^2}\right)
\\ & = \;
\frac{1}{3}\braced{3_0^T 2_0^3 1_0^2}
+ \frac{1}{6}\braced{3_0^T 2_0^T 1_0^2}
}}

so I get for $Z_3$:
\eqnl{Z-3-transformed-2}{
\splitDo{
Z_3
& = \;
\frac{1}{6}\braced{3_0^T 2_0^T 1_0^T} [h_3, [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{3_0^T 2_0^3 1_0^T} [[h_3, h_2], [h_1, x]]
\\ & \quad
+ \frac{1}{3}\braced{3_0^T 2_0^3 1_0^2} [[h_3, [h_2, h_1]], x]
+ \frac{1}{6}\braced{3_0^T 2_0^T 1_0^2}  [[h_3, [h_2, h_1]], x].
}}

or with the standard notations:
\eqnl{Z-3-transformed-int}{
\splitDo{
Z_3
& = \;
\frac{1}{6} \left[\int_{t_0}^{T} dt\,h(t),
    \left[\int_{t_0}^{T} dt\,h(t), \left[\int_{t_0}^{T} dt\,h(t),
      \; x\right]\right]\right]
\\ &
+ \;
\frac{1}{2}
\left[\int_{t_0}^{T} dt_3 \int_{t_0}^{t_3} dt_2, \left[h(t_3), h(t_2)\right], \left[\int_{t_0}^{T} dt\,h(t), \;x\right]\right]
\\ &
+ \;
\frac{1}{3}\left[
\int_{t_0}^{T} dt_3 \int_{t_0}^{t_3} dt_2 \int_{t_0}^{t_2} dt_1\,
   [h(t_3), [h(t_2), h(t_1)]], \; x\right]
\\ &
+ \;
\frac{1}{6}
\left[\left[\int_{t_0}^{T} dt\,h(t), \;
\int_{t_0}^{T} dt_2 \int_{t_0}^{t_2} dt_1,
\left[h(t_2), h(t_1)\right]\right], \; x\right].
}}

Lets deal with $Z_4$ in \rf{Z-definition} now:
\eqn{
Z_4 = \braced{4_0^T 3_0^4 2_0^3 1_0^2} [h_4, [h_3, [h_2, [h_1, x]]]]
}

Applying \rf{Z-3-transformed} gives:
\eqnl{Z-4-calc-1}{
\splitDo{
Z_4
& = \;
\frac{1}{6}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_4, [h_3, [h_2, [h_1, x]]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [h_4, [[h_3, h_2], [h_1, x]]]
\\ & \quad
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [h_4, [[h_3, [h_2, h_1]], x]]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [h_4, [[h_2, [h_3, h_1]], x]]
}}

I focus on the first term in \rf{Z-4-calc-1} which I will write as $\frac{1}{24}Z_4^1$ with
\eqn{
Z_4^1 = 4\braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_4, [h_3, [h_2, [h_1, x]]]]
}
where the factor $4$ is present to have less fraction in the following. So $Z_3$ becomes
\eqnl{Z-4-calc-2}{
\splitDo{
Z_4
& = \;
\frac{1}{24} Z_4^1
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [h_4, [[h_3, h_2], [h_1, x]]]
\\ & \quad
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [h_4, [[h_3, [h_2, h_1]], x]]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [h_4, [[h_2, [h_3, h_1]], x]]
}}

and I split $Z_4^1$ to for term via $4a = a + a + a + a$:
\alignDo{
Z_4^1  &\;  = \; \braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_4, [h_3, [h_2, [h_1, x]]]]
}

Now I do the following renames: $4\leftrightarrow 3$ in the second term, $4\rightarrow 2 \rightarrow 3 \rightarrow 4$ in the third term and $4\rightarrow 1 \rightarrow 2 \rightarrow 3 \rightarrow 4$ in the forth. It gives

\eqnl{Z-4-1-calc-1}{\splitDo{
Z_4^1  &\;  = \; \braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&\; + \braced{3_0^T 4_0^3 2_0^3 1_0^3} [h_3, [h_4, [h_2, [h_1, x]]]]
\\&\; + \braced{2_0^T 4_0^2 3_0^2 1_0^2} [h_2, [h_4, [h_3, [h_1, x]]]]
\\&\; + \braced{1_0^T 4_0^1 3_0^1 2_0^1} [h_1, [h_4, [h_3, [h_2, x]]]]
}}

Now I transform commutators in the second, third and forth terms to get $[h_4, [h_3, [h_2, [h_1, x]]]]$ plus terms where $x$ has nesting no more then $3$.
\eqn{
[h_3, [h_4, [h_2, [h_1, x]]]] =
 [[h_3, h_4], [h_2, [h_1, x]]] + [h_3, [h_3, [h_2, [h_1, x]]]],
}

\alignDo{
[h_2, [h_4, [h_3, [h_1, x]]]]
& =
[[h_2, h_4], [h_3, [h_1, x]]] + [h_4, [h_2, [h_3, [h_1, x]]]]
\\ & =
[[h_2, h_4], [h_3, [h_1, x]]]
\\ & \quad
+ [h_4, [[h_2, h_3], [h_1, x]]] + [h_4, [h_3, [h_2, [h_1, x]]]]
}

\alignDo{
[h_1, [h_4, [h_3, [h_2, x]]]]
& =
[[h_1, h_4], [h_3, [h_2, x]]] + [h_4, [h_1, [h_3, [h_2, x]]]]

\\& =
[[h_1, h_4], [h_3, [h_2, x]]] + [h_4, [[h_1, h_3], [h_2, x]]]
\\& \quad
+ [h_4, [h_3, [h_1, [h_2, x]]]]

\\& =
[[h_1, h_4], [h_3, [h_2, x]]] + [h_4, [[h_1, h_3], [h_2, x]]]
\\& \quad
+ [h_4, [h_3, [[h_1, h_2], x]]] + [h_4, [h_3, [h_2, [h_1, x]]]]
}

Substituting these expressions back to \rf{Z-4-1-calc-1} and putting all $[h_4, [h_3, [h_2, [h_1, x]]]]$ together I have

\eqnl{Z-4-1-calc-2}{\splitDo{
Z_4^1  &\;
= \; \left(\braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{3_0^T 4_0^3 2_0^3 1_0^3}
+ \braced{2_0^T 4_0^2 3_0^2 1_0^2} + \braced{1_0^T 4_0^1 3_0^1 2_0^1}
\right)
\\ & \qquad\qquad \times
[h_4, [h_3, [h_2, [h_1, x]]]]

\\&\; + \braced{3_0^T 4_0^3 2_0^3 1_0^3} [[h_3, h_4], [h_2, [h_1, x]]]

\\&\; + \braced{2_0^T 4_0^2 3_0^2 1_0^2}
\left([[h_2, h_4], [h_3, [h_1, x]]] + [h_4, [[h_2, h_3], [h_1, x]]]\right)

\\&\; + \braced{1_0^T 4_0^1 3_0^1 2_0^1}
\left([[h_1, h_4], [h_3, [h_2, x]]] + [h_4, [[h_1, h_3], [h_2, x]]]\right.
\\&\phantom{\; + \braced{1_0^T 4_0^1 3_0^1 2_0^1} \left(\right.}
+\left.[h_4, [h_3, [[h_1, h_2], x]]]\right)

}}

The result \rf{cicle-int-sum-4} gives:
\eqn{\splitDo{
Z_4^1  &\;
= \; \braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]

\\&\; + \braced{3_0^T 4_0^3 2_0^3 1_0^3} [[h_3, h_4], [h_2, [h_1, x]]]

\\&\; + \braced{2_0^T 4_0^2 3_0^2 1_0^2}
\left([[h_2, h_4], [h_3, [h_1, x]]] + [h_4, [[h_2, h_3], [h_1, x]]]\right)

\\&\; + \braced{1_0^T 4_0^1 3_0^1 2_0^1}
\left([[h_1, h_4], [h_3, [h_2, x]]] + [h_4, [[h_1, h_3], [h_2, x]]]\right.
\\&\phantom{\; + \braced{1_0^T 4_0^1 3_0^1 2_0^1} \left(\right.}
+\left.[h_4, [h_3, [[h_1, h_2], x]]]\right)

}}

To get the original intergration order I do reverse renames $4\leftrightarrow 3$ in the second term, $4\leftarrow 2 \leftarrow 3 \leftarrow 4$ in the third term and $4\leftarrow 1 \leftarrow 2 \leftarrow 3 \leftarrow 4$ in the forth. It gives
\eqn{\splitDo{
Z_4^1  &\;
= \; \braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]

\\&\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]

\\&\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4}
\left([[h_4, h_3], [h_2, [h_1, x]]] + [h_3, [[h_4, h_2], [h_1, x]]]\right)

\\&\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4}
\left([[h_4, h_3], [h_2, [h_1, x]]] + [h_3, [[h_4, h_2], [h_1, x]]]\right.
\\&\phantom{\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4} \left(\right.}
+\left.[h_3, [h_2, [[h_4, h_1], x]]]\right)

}}

or
\eqnl{Z-4-1-calc-4}{\splitDo{
Z_4^1  &\;
= \; \braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]

\\&\; + 3 \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]

\\&\; + 2 \braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_3, [[h_4, h_2], [h_1, x]]]

\\&\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_3, [h_2, [[h_4, h_1], x]]]

}}

I transform the third and forth terms here to get the same expression as the second term plus terms with $x$ nesting level no more then $2$.
\eqnl{Z-4-1-calc-4-a}{\splitDo{
\lefteqn{\braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_3, [[h_4, h_2], [h_1, x]]]}
\quad
\\ & =
\braced{4_0^T 3_0^4 2_0^4 1_0^4}[[h_3, [h_4, h_2]], [h_1, x]]
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_2], [h_3, [h_1, x]]]
\\ & =
\braced{4_0^T 3_0^4 2_0^4 1_0^4}[[h_3, [h_4, h_2]], [h_1, x]]
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]
}}

where to get the last line I used the fact in the $\braced{4_0^T 3_0^4 2_0^4 1_0^4} f(t_3, t_2, t_1)$ the integrations over $t_3$, $t_2$, $t_1$ have the same limits so by changing the integration order and renaming in the resulting expresssion $t_3$, $t_2$, $t_1$ to get the original integration order $\braced{4_0^T 3_0^4 2_0^4 1_0^4}$ I can replace indexes $3$, $2$, $1$ in $f(t_3, t_2, t_1)$ by their arbitrary transposition.

\p
Similary for the forth term in \rf{Z-4-1-calc-4} I have:
\eqn{\splitDo{
\lefteqn{[h_3, [h_2, [[h_4, h_1], x]]]}
\quad
\\& =
[h_3, [[h_2, [h_4, h_1]], x]] + [h_3, [[h_4, h_1], [h_2, x]]]

\\& = [h_3, [[h_2, [h_4, h_1]], x]]
+ [[h_3, [h_4, h_1]], [h_2, x]] + [[h_4, h_1], [h_3, [h_2, x]]]

\\& = [[h_3, [h_2, [h_4, h_1]]], x] + [[h_2, [h_4, h_1]], [h_3, x]]
\\& \phantom{=}
+ [[h_3, [h_4, h_1]], [h_2, x]] + [[h_4, h_1], [h_3, [h_2, x]]],
}}

and by using integration symmetry in $\braced{4_0^T 3_0^4 2_0^4 1_0^4}$ over $3$, $2$, $1$ I have:

\eqnl{Z-4-1-calc-4-b}{\splitDo{
\lefteqn{\braced{4_0^T 3_0^4 2_0^4 1_0^4} [h_3, [h_2, [[h_4, h_1], x]]]}
\quad
\\& = \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_2, [h_4, h_1]], [h_3, x]]
\\& \phantom{=}
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_1]], [h_2, x]]
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_1], [h_3, [h_2, x]]],

\\& = \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
\\& \phantom{=}
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]].

\\& = \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]
+ 2 \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
\\& \phantom{=}
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]].
}}

Substituting \rf{Z-4-1-calc-4-a} and \rf{Z-4-1-calc-4-b} into \rf{Z-4-1-calc-4} gives

\eqn{\splitDo{
Z_4^1  &\;
= \; \braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]

\\&\; + 3 \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]

\\&\;
+ 2 \braced{4_0^T 3_0^4 2_0^4 1_0^4}[[h_3, [h_4, h_2]], [h_1, x]]
+ 2 \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]

\\&\; + \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]
+ 2 \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
\\& \phantom{\; +}
+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]
}}

or
\eqn{\splitDo{
Z_4^1  &\;
= \; \braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]

+ 6 \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]

\\&\;
+ 4 \braced{4_0^T 3_0^4 2_0^4 1_0^4}[[h_3, [h_4, h_2]], [h_1, x]]

+ \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]
}}

\p
Substituting the last result into \rf{Z-4-calc-2} leads to
\eqn{
\splitDo{
Z_4 \;
& = \;
\frac{1}{24}\braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&
+ \frac{1}{4} \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]
\\&
+ \frac{1}{6} \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
+ \frac{1}{24}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]

\\&
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [h_4, [[h_3, h_2], [h_1, x]]]
\\ &
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [h_4, [[h_3, [h_2, h_1]], x]]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [h_4, [[h_2, [h_3, h_1]], x]]
}}

or
\eqnl{Z-4-calc-3}{
\splitDo{
Z_4 \;
& = \;
\frac{1}{24}\braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&
+ \frac{1}{4} \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [h_4, [[h_3, h_2], [h_1, x]]]
\\&
+ \frac{1}{6} \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [h_4, [[h_3, [h_2, h_1]], x]]
\\ &
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [h_4, [[h_2, [h_3, h_1]], x]]
+ \frac{1}{24}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]
}}

Now I consider the second and the third term, the only terms with $x$ nesting level equals 3:
\eqn{
Z_4^2 \equiv
\frac{1}{4} \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [h_4, [[h_3, h_2], [h_1, x]]]
}

Applying \rf{comm-like-diff} to the second term gives
\eqnl{Z-4-2-calc-1}{
\splitDo{
Z_4^2 =&
\frac{1}{4} \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
\\&
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_3, h_2], [h_4, [h_1, x]]]
}}

By renaming $3\rightarrow 4\rightarrow 2\rightarrow 3$ and changing integration order I have for the last term in \rf{Z-4-2-calc-1}
\eqn{
\splitDo{
\lefteqn{\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_3, h_2], [h_4, [h_1, x]]]
= \braced{2_0^T 4_0^2 3_0^4 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]}
&\\&=
\braced{4_0^T 2_4^T 3_0^4 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
= \braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
}}

Split $a\rightarrow\frac{1}{2}a+\frac{1}{2}a$ and rename $1\leftrightarrow 2$ give:
\eqn{
\splitDo{
\lefteqn{\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_3, h_2], [h_4, [h_1, x]]]}
&\\& =
\frac{1}{2}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
\\& =
\frac{1}{2}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 1_4^T 2_0^1} [[h_4, h_3], [h_1, [h_2, x]]]
}}

Now I apply \rf{comm-like-diff} to $[h_1, [h_2, x]]$ and then rename $1\leftrightarrow 2$ back in the second term:
\eqn{
\splitDo{
\lefteqn{\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_3, h_2], [h_4, [h_1, x]]]}
&\\& =
\frac{1}{2}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
\\& =
\frac{1}{2}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 1_4^T 2_0^1} [[h_4, h_3], [[h_1, h_2], x]]
\\&
+ \frac{1}{2}\braced{4_0^T 3_0^4 1_4^T 2_0^1} [[h_4, h_3], [h_2, [h_1, x]]]
\\& =
\frac{1}{2}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 1_4^T 2_0^1} [[h_4, h_3], [h_2, [h_1, x]]]
\\&
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [[h_2, h_1], x]]
}}

Putting the last expression into \rf{Z-4-2-calc-1} I have:
\eqn{
\splitDo{
Z_4^2 &
=\frac{1}{4} \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
\\&
+\frac{1}{4}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [h_2, [h_1, x]]]
\\&
+ \frac{1}{4}\braced{4_0^T 3_0^4 1_4^T 2_0^1} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{4}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [[h_2, h_1], x]]
}}

or
\eqnl{Z-4-2-calc-2}{
\splitDo{
Z_4^2 &
=\frac{1}{4} \left(
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^2}
+ \braced{4_0^T 3_0^4 1_4^T 2_0^1}
\right) [[h_4, h_3], [h_2, [h_1, x]]]
\\&
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
+ \frac{1}{4}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [[h_2, h_1], x]]
}}

Now by using \rf{int-order-change-2} and fusing integration I have for the integrations in the first term in \rf{Z-4-2-calc-2}:
\eqn{
\splitDo{
\lefteqn{
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^2}
+ \braced{4_0^T 3_0^4 1_4^T 2_0^1}
}
\\&=
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^2}
+ \braced{4_0^T 3_0^4 2_0^4 1_4^T}
+ \braced{4_0^T 3_0^4 2_4^T 1_2^T}
\\&=
\braced{4_0^T 3_0^4 2_0^4 1_0^4}
+ \braced{4_0^T 3_0^4 2_0^4 1_4^T}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^2}
+ \braced{4_0^T 3_0^4 2_4^T 1_2^T}
\\&=
\braced{4_0^T 3_0^4 2_0^4 1_0^T}
+ \braced{4_0^T 3_0^4 2_4^T 1_0^T}
= \braced{4_0^T 3_0^4 2_0^T 1_0^T}
}}

Thus for $Z_4^2$ I have
\eqnl{Z-4-2-calc-3}{
\splitDo{
Z_4^2 &
=\frac{1}{4}
\braced{4_0^T 3_0^4 2_0^T 1_0^T} [[h_4, h_3], [h_2, [h_1, x]]]
\\&
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
+ \frac{1}{4}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [[h_2, h_1], x]]
}}

Substitution of \rf{Z-4-2-calc-3} into \rf{Z-4-calc-3} to replace the second and the third terms gives:
\eqnl{Z-4-calc-4}{
\splitDo{
Z_4 \;
& = \;
\frac{1}{24}\braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&
+ \frac{1}{4} \braced{4_0^T 3_0^4 2_0^T 1_0^T} [[h_4, h_3], [h_2, [h_1, x]]]
\\&
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
+ \frac{1}{4}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [[h_2, h_1], x]]
\\&
+ \frac{1}{6} \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
+ \frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [h_4, [[h_3, [h_2, h_1]], x]]
\\ &
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [h_4, [[h_2, [h_3, h_1]], x]]
+ \frac{1}{24}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x].
}}

Introducing $Z_4^3$ via
\eqnl{Z-4-3-def}{
\splitDo{
Z_4^3 \;
& = \;
\frac{1}{2}\left(\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
+ \braced{4_0^T 3_0^4 2_0^3 1_0^2} [h_4, [[h_3, [h_2, h_1]], x]]\right)
\\&
+ \frac{1}{6}\left( \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
+ \braced{4_0^T 3_0^4 2_0^3 1_0^3} [h_4, [[h_2, [h_3, h_1]], x]]\right)
}}

I have for \rf{Z-4-calc-4}
\eqnl{Z-4-calc-5}{
\splitDo{
Z_4 \;
& = \;
\frac{1}{24}\braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&
+ \frac{1}{4} \braced{4_0^T 3_0^4 2_0^T 1_0^T} [[h_4, h_3], [h_2, [h_1, x]]]
\\&
+ \frac{1}{4}\braced{4_0^T 3_0^4 2_4^T 1_0^2} [[h_4, h_3], [[h_2, h_1], x]]
\\&
+ Z_4^3
+ \frac{1}{24}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x].
}}

Splitting the third term here, renaming $1\leftrightarrow 3$, $2\leftrightarrow 4$ and using \rf{comm-like-diff} I get:
\eqn{
\splitDo{
\lefteqn{\frac{1}{4}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[h_4, h_3], [[h_2, h_1], x]]} \quad&

\\& =
\frac{1}{8}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[h_4, h_3], [[h_2, h_1], x]]
+ \frac{1}{8}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[h_4, h_3], [[h_2, h_1], x]]

\\& =
\frac{1}{8}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[h_4, h_3], [[h_2, h_1], x]]
+ \frac{1}{8}\braced{2_0^T 1_0^2 4_2^T 3_0^4}
[[h_2, h_1], [[h_4, h_3], x]]

\\& =
\frac{1}{8}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[h_4, h_3], [[h_2, h_1], x]]
+ \frac{1}{8}\braced{2_0^T 1_0^2 4_2^T 3_0^4}
[[[h_2, h_1], [h_4, h_3]], x]
\\&\quad
+ \frac{1}{8}\braced{2_0^T 1_0^2 4_2^T 3_0^4}
[[h_4, h_3], [[h_2, h_1], x]]

\\& =
\frac{1}{8}\left(
\braced{4_0^T 3_0^4 2_4^T 1_0^2} + \braced{2_0^T 1_0^2 4_2^T 3_0^4}
\right)
[[h_4, h_3], [[h_2, h_1], x]]
\\&\quad
+ \frac{1}{8}\braced{2_0^T 1_0^2 4_2^T 3_0^4}
[[[h_2, h_1], [h_4, h_3]], x]
}}

By changing the integration order and integral fusing I have for the first term
\eqn{
\splitDo{
\lefteqn{\braced{4_0^T 3_0^4 2_4^T 1_0^2} + \braced{2_0^T 1_0^2 4_2^T 3_0^4}}
\\&
=
\braced{4_0^T 3_0^4 2_4^T 1_0^2} + \braced{2_0^T 4_2^T 3_0^4 1_0^2}
=
\braced{4_0^T 3_0^4 2_4^T 1_0^2} + \braced{4_0^T 2_0^4 3_0^4 1_0^2}
\\&
=
\braced{4_0^T 3_0^4 2_4^T 1_0^2} + \braced{4_0^T 3_0^4 2_0^4 1_0^2}
=
\braced{4_0^T 3_0^4 2_0^T 1_0^2}
}}

So
\eqn{
\splitDo{
\lefteqn{\frac{1}{4}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[h_4, h_3], [[h_2, h_1], x]]} \quad&

\\& =
\frac{1}{8}\braced{4_0^T 3_0^4 2_0^T 1_0^2}[[h_4, h_3], [[h_2, h_1], x]]
+ \frac{1}{8}\braced{2_0^T 1_0^2 4_2^T 3_0^4}
[[[h_2, h_1], [h_4, h_3]], x]

\\& =
\frac{1}{8}\braced{4_0^T 3_0^4 2_0^T 1_0^2}[[h_4, h_3], [[h_2, h_1], x]]
+ \frac{1}{8}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[[h_4, h_3], [h_2, h_1]], x]
}}
where in the last term I renamed back $1\leftrightarrow 3$, $2\leftrightarrow 4$.

\p

Substituting this into \rf{Z-4-calc-6} for the third term gives

\eqn{
\splitDo{
Z_4 \;
& = \;
\frac{1}{24}\braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&
+ \frac{1}{4} \braced{4_0^T 3_0^4 2_0^T 1_0^T} [[h_4, h_3], [h_2, [h_1, x]]]
\\&
+\frac{1}{8}\braced{4_0^T 3_0^4 2_0^T 1_0^2}[[h_4, h_3], [[h_2, h_1], x]]
+ \frac{1}{8}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[[h_4, h_3], [h_2, h_1]], x]
\\&
+ Z_4^3
+ \frac{1}{24}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x].
}}
or

\eqnl{Z-4-calc-6}{
\splitDo{
Z_4 \;
& = \;
\frac{1}{24}\braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&
+ \frac{1}{4} \braced{4_0^T 3_0^4 2_0^T 1_0^T} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{8}\braced{4_0^T 3_0^4 2_0^T 1_0^2}[[h_4, h_3], [[h_2, h_1], x]]
\\&
+ Z_4^3
\\&
+ \frac{1}{8}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[[h_4, h_3], [h_2, h_1]], x]
+ \frac{1}{24}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]
}}

Now comes the last part which is to deal with $Z_4^3$ defined in \rf{Z-4-3-def}:
\eqn{
\splitDo{
Z_4^3 \;
& = \;
\frac{1}{2}\left(\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
+ \braced{4_0^T 3_0^4 2_0^3 1_0^2} [h_4, [[h_3, [h_2, h_1]], x]]\right)
\\&
+ \frac{1}{6}\left( \braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
+ \braced{4_0^T 3_0^4 2_0^3 1_0^3} [h_4, [[h_2, [h_3, h_1]], x]]\right)
}}

Application of \rf{comm-like-diff} to the second and forth terms gives
\eqn{
\splitDo{
Z_4^3 \;
& =
\frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
\\&+
\frac{1}{2}\left(\braced{4_0^T 3_0^4 2_0^3 1_0^2}
[[h_4, [h_3, [h_2, h_1]]], x] + [[h_3, [h_2, h_1]], [h_4, x]]
\right)
\\&
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
\\&
+ \frac{1}{6}\left( \braced{4_0^T 3_0^4 2_0^3 1_0^3}
[[h_4, [h_2, [h_3, h_1]]], x] + [[h_2, [h_3, h_1]], [h_4, x]]
\right)
}}

or

\eqn{
\splitDo{
Z_4^3 \;
& =
\frac{1}{2}\left(
\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
+
\braced{4_0^T 3_0^4 2_0^3 1_0^2} [[h_3, [h_2, h_1]], [h_4, x]]
\right)
\\&
+ \frac{1}{6}\left(
\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
+
\braced{4_0^T 3_0^4 2_0^3 1_0^3} [[h_2, [h_3, h_1]], [h_4, x]]
\right)
\\&
+\frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [[h_4, [h_3, [h_2, h_1]]], x]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [[h_4, [h_2, [h_3, h_1]]], x]
}}

Renames $3\rightarrow 4\rightarrow 1\rightarrow 2\rightarrow 3$ in the second and forth terms lead to
\eqn{
\splitDo{
Z_4^3 \;
& =
\frac{1}{2}\left(
\braced{4_0^T 3_0^4 2_0^3 1_0^4} [[h_4, [h_3, h_2]], [h_1, x]]
+
\braced{1_0^T 4_0^1 3_0^4 2_0^3} [[h_4, [h_3, h_2]], [h_1, x]]
\right)
\\&
+ \frac{1}{6}\left(
\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
+
\braced{1_0^T 4_0^1 3_0^4 2_0^4} [[h_3, [h_4, h_2]], [h_1, x]]
\right)
\\&
+\frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [[h_4, [h_3, [h_2, h_1]]], x]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [[h_4, [h_2, [h_3, h_1]]], x]
}}

or
\eqnl{Z-4-3-calc-2}{
\splitDo{
Z_4^3 \;
& =
\frac{1}{2}\left(
\braced{4_0^T 3_0^4 2_0^3 1_0^4} + \braced{1_0^T 4_0^1 3_0^4 2_0^3}
\right) [[h_4, [h_3, h_2]], [h_1, x]]
\\&
+ \frac{1}{6}\left(
\braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{1_0^T 4_0^1 3_0^4 2_0^4}
\right) [[h_3, [h_4, h_2]], [h_1, x]]
\\&
+\frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [[h_4, [h_3, [h_2, h_1]]], x]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [[h_4, [h_2, [h_3, h_1]]], x]
}}

Changing integration ordrer and fusion gives for the first term:
\eqn{
\splitDo{
\lefteqn{\braced{4_0^T 3_0^4 2_0^3 1_0^4} + \braced{1_0^T 4_0^1 3_0^4 2_0^3}}
\\& \quad
=
\braced{4_0^T 3_0^4 2_0^3 1_0^4} + \braced{4_0^T 1_4^T  3_0^4 2_0^3}
=
\braced{4_0^T 3_0^4 2_0^3 1_0^4} + \braced{4_0^T 3_0^4 2_0^3 1_4^T }
=
\braced{4_0^T 3_0^4 2_0^3 1_0^T}
}}

and similarly for the second term
\eqn{
\splitDo{
\lefteqn{\braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{1_0^T 4_0^1 3_0^4 2_0^4}}
\\& \quad
=
\braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{4_0^T 1_4^T 3_0^4 2_0^4}
=
\braced{4_0^T 3_0^4 2_0^4 1_0^4} + \braced{4_0^T 3_0^4 2_0^4 1_4^T}
=
\braced{4_0^T 3_0^4 2_0^4 1_0^T}
}}

Thus I have for $Z_4^3$ from \rf{Z-4-3-calc-2}:
\eqnl{Z-4-3-calc-3}{
\splitDo{
Z_4^3 \;
& =
\frac{1}{2} \braced{4_0^T 3_0^4 2_0^3 1_0^T} [[h_4, [h_3, h_2]], [h_1, x]]
\\&
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^4 1_0^T} [[h_3, [h_4, h_2]], [h_1, x]]
\\&
+\frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [[h_4, [h_3, [h_2, h_1]]], x]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [[h_4, [h_2, [h_3, h_1]]], x]
}}

Substitung this result into \rf{Z-4-calc-6} gives for $Z_4$:
\eqnl{Z-4-calc-7}{
\splitDo{
Z_4 \;
& = \;
\frac{1}{24}\braced{4_0^T 3_0^T 2_0^T 1_0^T} [h_4, [h_3, [h_2, [h_1, x]]]]
\\&
+ \frac{1}{4} \braced{4_0^T 3_0^4 2_0^T 1_0^T} [[h_4, h_3], [h_2, [h_1, x]]]
+ \frac{1}{8}\braced{4_0^T 3_0^4 2_0^T 1_0^2}[[h_4, h_3], [[h_2, h_1], x]]
\\&
+ \frac{1}{2} \braced{4_0^T 3_0^4 2_0^3 1_0^T} [[h_4, [h_3, h_2]], [h_1, x]]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^4 1_0^T} [[h_3, [h_4, h_2]], [h_1, x]]
\\&
+\frac{1}{2}\braced{4_0^T 3_0^4 2_0^3 1_0^2} [[h_4, [h_3, [h_2, h_1]]], x]
+ \frac{1}{6}\braced{4_0^T 3_0^4 2_0^3 1_0^3} [[h_4, [h_2, [h_3, h_1]]], x]
\\&
+ \frac{1}{8}\braced{4_0^T 3_0^4 2_4^T 1_0^2}
[[[h_4, h_3], [h_2, h_1]], x]
+ \frac{1}{24}\braced{4_0^T 3_0^4 2_0^4 1_0^4} [[h_3, [h_2, [h_4, h_1]]], x]
}}

\end{document}