Q1)
i thnk u missed to mention Electric field direction. since u have not mentioned
I'm assuming that direction of E is along the vertical axis ( that is equitorial axis to dipole )
hence angle between the dipole and Electric field E is initially 90° which is considered as zero energy position \tau =pEsin\theta
let dW is the small amount of workdone in turning the dipole through a small angle dθ.
→ dW = \tau d\theta
→ dW = pEsin\theta d\theta
here we r to rotate 90° clockwise which means in the final position of dipole axis makes 0° with electric lines of force hence we r rotating dipole from zero enrgy position
( 90° ) to 0° position
hence W = \int_{0}^{W}{dW}\Rightarrow W=\int_{\pi /2}^{0}{pEsin\theta d\theta }=pE\int_{\pi /2}^{0}{sin\theta d\theta }
→ W = - pE