$${W = \int_{\theta_i}^{\theta_f} \tau\, d\theta}$$