I was checking the proof of Gauss theorem in do Carmo's book on Riemannian Geometry (p.131) and got stuck in one of the steps. The theorem of Gauss as stated on Do Carmo goes as:
Let $p\in M$ and let $x,y$ be orthonormal vectors in $T_pM$. Then** $$K(x,y)-\bar{K}(x,y)=\langle B(x,x),B(y,y)\rangle - \vert B(x,y)\vert^2.$$
Proof:
Let $X,Y$ be local orthogonal extensions of $x,y$, respectively, which are tangent to $M$; we denote the local extensions to $\bar{M}$ of $X,Y$ by $\bar{X},\bar{Y}$. Then
$$K(x,y)-\bar{K}(x,y)=\langle \nabla_Y\nabla_X X -\nabla_X\nabla_Y X-(\bar{\nabla}_\bar{Y}\bar{\nabla}_\bar{X}\bar{X}-\bar{\nabla}_\bar{X}\bar{\nabla}_\bar{Y}\bar{X}),Y\rangle(p)+\langle\nabla_{[X,Y]}X-\bar{\nabla}_{[\bar{X},\bar{Y}]}\bar{X},Y\rangle(p)$$
The last term being zero
On the other hand, if we denote by $E_1,\cdots,E_m$,$m=\dim\bar{M}-\dim M$ local orthonormal fields which are normal to $M$, we have
$$B(X,Y)=\sum_i H_i(X,Y)E_i,\ \ H_i=H_{E_i}, \ \ i=1,\cdots, m.$$
Therefore, at $p$,
$$ \bar{\nabla}_{\bar{Y}}\bar{\nabla}_{\bar{X}}\bar{X}=\bar{\nabla}_{\bar{Y}}(\sum_i H_i(X,X)€_i+\nabla_X X)\\ =\sum_i(H_i(X,X)\bar{\nabla}_{\bar{Y}}E_i+\bar{Y}H_i(X,X)E_i)+\bar{\nabla}_{\bar{Y}}\nabla_X X . $$ Hence, at $p$, $$ \langle\bar{\nabla}_{\bar{Y}}\bar{\nabla}_{\bar{X}}\bar{X},Y\rangle=-\sum_iH_i(X,X)H_i(Y,Y)+\langle\nabla_Y\nabla_X X,Y\rangle. $$
My question: I do not understand how he gets to this expression from the last one. Where does the $H_i(Y,Y)$ (and the minus sign) come from? I think the second term in the sum vanishes as $E_i$ is normal to $Y$, but the first term got me stuck.