Explicit formula for the curvaure of a connection Let $E$ be a vector bundle over $M$ and denote by $\mathcal{A}^k(E)$ the space of sections of $\Lambda^k (TM)^* \otimes E$, i.e. the space $k$-forms with values in $E$.
A connection $\nabla:\mathcal{A}^0(E) \to \mathcal{A}^1(E)$ extends to a map $\nabla:\mathcal{A}^k(E) \to \mathcal{A}^{k+1}(E)$ by setting $\nabla(\alpha \otimes s)= d \alpha \otimes s + (-1)^k \alpha \wedge\nabla s$ and we can define the curvature of $\nabla$ as the composition $F_\nabla=\nabla \circ \nabla: \mathcal{A}^0(E) \to \mathcal{A}^2(E)$.
From the Leibniz rule one can see that $F_{\nabla}(fs) = f F_{\nabla}(s)$ and therefore we can view $F_\nabla$ as an element of $\mathcal{A}^2(\text{End}(E))$ ($F_\nabla$ evaluated at a pair of tangent vectors is the endomorphism $s \mapsto F_\nabla(X,Y)(s)$.
My question is whether the formula
$F_{\nabla}(X,Y) = \nabla_X \nabla_Y  - \nabla_Y \nabla_Y - \nabla_{[X,Y]}$ holds true.
I could prove it when $E=TM$ and $\nabla$ is a torsion free connection (because in that case we have a formula relating the exterior derivative with $\nabla$) but I don't know how to deal with the general case.
 A: Short answer: the formula is true. Long answer: see below for the calculation.
Choose local coordinates $(x^1, \ldots, x^n)$ and a local frame field $(e_1, \ldots, e_r)$ for $E$, both of these over an open neighbourhood $U$, and let
$\newcommand{\Tud}[3]{{#1}^{#2}_{\phantom{#2}{#3}}}$
$$\nabla e_\mu = \Tud{\omega}{\nu}{\mu} \otimes e_\nu$$
for some $\Tud{\omega}{\nu}{\mu} \in \Omega^1(U)$. (I am using the summation convention for repeated indices.) Let $\Tud{\Omega}{\nu}{\mu} \in \Omega^2(U)$ be such that
$$\nabla \nabla e_\mu = \Tud{\Omega}{\nu}{\mu} \otimes e_\nu$$
Now, by the Leibniz rule, we have
$$\nabla \nabla e_\mu = \mathrm{d}\Tud{\omega}{\nu}{\mu} \otimes e_\nu - \Tud{\omega}{\nu}{\mu} \wedge \Tud{\omega}{\rho}{\nu} \otimes e_\rho$$
thus,
$$\Tud{\Omega}{\nu}{\mu} = \mathrm{d}\Tud{\omega}{\nu}{\mu} + \Tud{\omega}{\nu}{\rho} \wedge \Tud{\omega}{\rho}{\mu}$$
Since
$$\nabla (W^\mu e_\mu) = \mathrm{d} W^\mu \otimes e_\mu + W^\mu \Tud{\omega}{\nu}{\mu} \otimes e_\nu$$
we have
$$\nabla \nabla (W^\mu e_\mu) = \mathrm{d} W^\mu \wedge \Tud{\omega}{\nu}{\mu} \otimes e_\nu + W^\mu \, \mathrm{d} \Tud{\omega}{\nu}{\mu} \otimes e_\nu - \mathrm{d}W^\mu \wedge \Tud{\omega}{\nu}{\mu} \otimes e_\nu - W^\mu \Tud{\omega}{\nu}{\mu} \wedge \Tud{\omega}{\rho}{\nu} \otimes e_\rho$$
thus, $\nabla \nabla$ is indeed $C^\infty(U)$-linear, with
$$\nabla \nabla (W^\mu e_\mu) = W^\mu \Tud{\Omega}{\nu}{\mu} \otimes e_\nu = W^\mu \nabla \nabla e_\mu$$
This means we only need to check the formula for the frame field instead of arbitrary sections of $E$.
Now, observe that, if $X$ and $Y$ are vector fields,
$$\begin{align}

\nabla_X \nabla_Y e_\mu = \nabla_X ( \langle \Tud{\omega}{\nu}{\mu} , Y \rangle e_\nu) & = \langle \mathrm{d} \langle \Tud{\omega}{\nu}{\mu} , Y \rangle, X \rangle e_\nu + \langle \Tud{\omega}{\nu}{\mu} , Y \rangle \langle \Tud{\omega}{\rho}{\nu} , X \rangle e_\rho \\

\nabla_Y \nabla_X e_\mu = \nabla_Y ( \langle \Tud{\omega}{\nu}{\mu} , Y \rangle e_\nu) & = \langle \mathrm{d} \langle \Tud{\omega}{\nu}{\mu} , X \rangle, Y \rangle e_\nu + \langle \Tud{\omega}{\nu}{\mu} , X \rangle \langle \Tud{\omega}{\rho}{\nu} , Y \rangle  e_\rho \\

\nabla_{[X, Y]} e_\mu & = \langle \Tud{\omega}{\nu}{\mu} , [X, Y] \rangle e_\nu
\end{align}$$
where I have written $\langle - , - \rangle$ for the canonical pairing of a 1-form and a vector field. So we have
$$\begin{align}
(\nabla_X \nabla_Y - \nabla_Y \nabla_X - \nabla_{[X, Y]}) e_\mu & = (\langle \mathrm{d} \langle \Tud{\omega}{\nu}{\mu} , Y \rangle, X \rangle - \langle \mathrm{d} \langle \Tud{\omega}{\nu}{\mu} , X \rangle, Y \rangle - \langle \Tud{\omega}{\nu}{\mu} , [X, Y] \rangle) \, e_\nu \\
& \phantom{=} + (\langle \Tud{\omega}{\nu}{\rho} , X \rangle \langle \Tud{\omega}{\rho}{\mu} , Y \rangle - \langle \Tud{\omega}{\nu}{\rho} , Y \rangle \langle \Tud{\omega}{\rho}{\mu} , X \rangle) \, e_\nu
\end{align}$$
while on the other hand
$$\Tud{\Omega}{\nu}{\mu} (X, Y) = \langle \Tud{\Omega}{\nu}{\mu} , X \wedge Y \rangle = \langle \mathrm{d}\Tud{\omega}{\nu}{\mu} , X \wedge Y \rangle + \langle \Tud{\omega}{\nu}{\rho} \wedge \Tud{\omega}{\rho}{\mu} , X \wedge Y \rangle$$
but by Cartan's formula for the exterior derivative
$$\langle \mathrm{d}\Tud{\omega}{\nu}{\mu} , X \wedge Y \rangle = \langle \mathrm{d} \langle \Tud{\omega}{\nu}{\mu} , Y \rangle , X \rangle - \langle \mathrm{d} \langle \Tud{\omega}{\nu}{\mu} , X \rangle , Y \rangle - \langle \Tud{\omega}{\nu}{\mu} , [X, Y] \rangle$$
Now, by definition
$$\langle \Tud{\omega}{\nu}{\rho} \wedge \Tud{\omega}{\rho}{\mu} , X \wedge Y \rangle = \langle \Tud{\omega}{\nu}{\rho} , X \rangle \langle \Tud{\omega}{\rho}{\mu}, Y \rangle - \langle \Tud{\omega}{\nu}{\rho} , Y \rangle \langle \Tud{\omega}{\rho}{\mu}, X \rangle $$
and so
$$\Tud{\Omega}{\nu}{\mu} (X, Y) e_\nu = (\nabla_X \nabla_Y - \nabla_Y \nabla_X - \nabla_{[X, Y]}) e_\mu $$
which is exactly what we want.
A: I guess I've  found an alternative computation. Can anyone tell me if this is right?
Let $s\in \mathcal A^0(E)$ a section and consider $\nabla s \in \mathcal A^1(E)$. By linearity we may assume that $\nabla s = \alpha \otimes t$ with $\alpha$ a 1-form and therefore $\nabla_X s = \alpha(X)t$.
If $X,Y$ are vector fields, the invariant formula for the exterior derivative gives $d \alpha (X,Y)= X \alpha(Y) - Y\alpha(X) - \alpha([X,Y])$ and therefore
$F_\nabla(X,Y)(s) = \nabla(\alpha \otimes t)(X,Y) = (d \alpha \otimes t - \alpha \wedge \nabla t)(X,Y)$
$=(d \alpha)(X,Y)t - \alpha(X) \nabla_Y t + \alpha(Y) \nabla_X t$
$= [X \alpha(Y) - Y\alpha(X) - \alpha([X,Y])]t - \alpha(X) \nabla_Y t + \alpha(Y) \nabla_X t$
$= (X \alpha(Y))t + \alpha(Y)\nabla_X t - (Y \alpha(X))t - \alpha(X)\nabla_Y t - \alpha([X,Y])t $
$= \nabla_X (\alpha(Y) t) - \nabla_Y(\alpha(X) t) - \alpha([X,Y])t$
$=\nabla_X \nabla_Y s - \nabla_Y \nabla_X s- \nabla_{[X,Y]}s.$
