I'm struggling to reproduce Ex. 2 from the paper by Lafferriere and Sussmann. In short, we have a nilpotent Lie algebra of vector fields generated by two elements: $X$ and $Y$. Its basis is $B_1=X$, $B_2=Y$, $B_3=[X,Y]$, $B_4=[X,[X,Y]]$, and $B_5=[Y,[X,Y]]$ (all higher order brackets are zero).
The authors write an arbitrary element of the Lie group as $$S(t)=e^{h_5(t)B_5}\circ\dots\circ e^{h_1(t)B_1}$$ and assert that $S(t)$ can be obtaned as a solution to the DE $$\dot{S}(t)=S(t)(v_1(t)B_1 + v_2(t)B_2 + v_3(t)B_3 + v_4(t)B_4)\quad [\mbox{ note } v_5=0!],$$ with $S(0)=Id$ and where $h_i$'s are related to $v_i$'s by the DEs \begin{align*}\dot{h}_1={ }&v_1,\\ \dot{h}_2={ }&v_2,\\ \dot{h}_3={ }&h_1v_2+v_3\\ \dot{h}_4={ }&\frac{1}{2}h^2_1v_2+h_1v_3+v_4\\ \dot{h}_5={ }&h_2v_3+h_1h_2v_2\end{align*} with zero initial conditions. I was trying to differentiate $S(t)$, but failed to obtain the relations between $h_i$'s and $v_i$'s as shown above.
Could somebody give me a hint at how to approach this? I'll also appreciate a reference to the literature where such differential equations on Lie groups are treated.