Work done in rotating electric dipole in uniform field For an electric dipole $p$ in a uniform field $E$ we write the work done by an external agent in rotating dipole as $\text{d}W = pE\sin\theta \, \text{d}\theta$. 
I'm having trouble understanding where this equation comes from and why
$W = \int_{\theta_i}^{\theta_f} pE\sin\theta \,\text{d}\theta$ is true, as the only definition of work I know is $W=Fs$. How does the above equation follow? 
 A: The general expression for the work done by a variable force along a path between the initial position $(x_i, y_i, z_i)$ and the final position $(x_f, y_f, z_f)$ is
$$
W = \int_{(x_i, y_i, z_i)}^{(x_f, y_f, z_f)}\vec{\bf F}{\bf \cdot}d\vec{\bf s}\,.
$$
In the case of an electric dipole consisting of two point charges $\pm q$ separated by the vector $\vec{\bf \ell}$ having length $\ell$, i.e. $p = q\ell$, in an external uniform electric field $\vec{\bf E}$, which makes an angle $\theta$ with the dipole separation vector $\vec{\bf \ell}$, the net force on the dipole is zero since the forces on each charge are of the same magnitude, but acting in opposite directions. However, there is a net torque acting on the dipole due to the separation of the charges. To calculate the work done by the torque in rotating the dipole let us consider the work done by the torque in rotating each charge in the dipole separately. The total work can be found by adding the work done in rotating each charge together. 
The work done by the torque in rotating each charge can be calculated using the expression for work above. In this case $\vec{\bf F}$ is the force doing the turning and $d\vec{\bf s}$ is an infinitesimal arc length of a circle of radius $r d\theta$, where $r = \ell/2\,,$ i.e. the pivot point for the application of the turning force is located at the midpoint of $\vec{\bf \ell}$. The force $\vec{\bf F}$ is tangential to the circle of radius $r$ and has magnitude $qE\sin\theta$ in each case. Since I assume that the external field $\bf \vec{E}$ provides positive torque on the positive charge in the dipole, i.e. a counter-clockwise torque we have, in the case of each charge, that $\vec{\bf F}$ and $d\vec{\bf s}$ are in the same direction so 
$$
\vec{\bf F}{\bf \cdot}d\vec{\bf s} = (qE\sin\theta)(r\,d\theta)\,.
$$
Therefore we have that the work done by the external field in rotating the electric dipole through some angle is
$$
W = \int_{\theta_i}^{\theta_f} qE\sin\theta\,r\,d\theta\, + \int_{\theta_i}^{\theta_f} qE\sin\theta\,r\,d\theta\,.
$$
Therefore
$$
W=2\int_{\theta_i}^{\theta_f} q r E\sin\theta\,d\theta\,.
$$
Since $r = \ell/2$ we find that the work done on the dipole by the torque provided by $\vec{\bf E}$ is
$$
W = \int_{\theta_i}^{\theta_f} q\ell E\sin\theta\,d\theta\, = \int_{\theta_i}^{\theta_f} pE\sin\theta\,d\theta\,
$$
where the electric dipole is given by $\vec{\bf p} = q\vec{\bf \ell}$ and has magnitude $p = q\ell\,.$ 
We can express the total work done by the torque in rotating the dipole as
$$
W = \int^{\theta_f}_{\theta_i}\tau_{z}\,d\theta\,,
$$
where $\tau_z = pE\sin\theta$.
If, in the above derivation, I assumed the opposite direction for the field, i.e. $\vec{\bf E}$ is replaced with $-\vec{\bf E}$, a clockwise torque would occur and the work done on the electric dipole would be
$$
W = -\int_{\theta_i}^{\theta_f}pE\sin\theta\,d\theta = \int^{\theta_f}_{\theta_i}\tau_{z}\,d\theta\,,
$$
where $\tau_z = -pE\sin\theta$.
A: Analogous to the work $$W=F\Delta s$$ done by a force $F$ over a distance $\Delta  s$ , there is also a work done by a torque $T$  for a rotational movement $$W=T\Delta \theta$$ where $\Delta \theta$ is the angle of rotation. The torque experienced by an electric dipole with dipole moment $\vec p$ in an electric field $\vec E$ is $${\vec T}={\vec  p}\times {\vec  E}=pE\sin{\theta}$$ were $\theta$ is the angle between the dipole moment and the electric field. Thus the work performed during a rotation of a dipole from an angle $\theta=\alpha$ to an angle $\theta=\beta$ is given by $$W=\int_\alpha^\beta T(\theta)d\theta=\int_\alpha^\beta pEd\theta \sin{\theta}$$
