Let $$\tau=\inf \{t>0: \int_0^t e^{-(W_2^2+2W_s)}ds=2\}$$ and $$X=\int_0^{\tau}e^{-(\frac{W_s^2}2+W_s)}dW_s.$$ Please determine $\mathbb EX$, $VarX$ carefully justifying all transitions.
$$\mathbb EX=\mathbb E \left( \int_0^{\tau}e^{-(\frac{W_s^2}2+W_s)} dW_s \right) $$ $$Var X= \mathbb EX^2 = \mathbb E \int_0^{\tau} \left( e^{-(\frac{W_s^2}2+W_s)} \right)^2ds$$
Unfortunately, I cannot calculate any of these values. In particular, so far I have dealt with integrals with limits from $0$ to $t$, here an additional difficulty arises in the form of the limit of integration up to $\tau$,