Let $\alpha$ be a $1$-form on $\mathbb{R}^n$. Define the following which takes $k$-forms to $(k+1)$-forms.
$$D\omega := d\omega+\alpha \wedge \omega $$
Show that $D^2=0$ iff $D=e^{-f}de^{f}$ for some function $f$ and express $\alpha$ in terms of $f$.
I get that
$$\begin{align} D^2 \omega=D(D(\omega) &= D(d\omega + \alpha \wedge \omega) \\ &= d(\alpha \wedge \omega)+ \alpha \wedge d\omega + \alpha \wedge \alpha \wedge \omega \\ &= d\alpha \wedge d\omega + \alpha \wedge d\omega + \alpha \wedge \alpha \wedge \omega \end{align}$$
but I cannot see how to proceed. I also find it strange that first term is a $(k+3)$-form.