\documentclass[11pt,fleqn]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% template that does not use Revtex4
%%% but allows special fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% Please use this template.
%%% Edit it using e.g. Notepad
%%% Ignore the header (do not change it)
%%% Process the file in the Latex site
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page setup
\topmargin -1.5cm
\oddsidemargin -0.04cm
\evensidemargin -0.04cm
\textwidth 16.59cm
\textheight 24cm
\setlength{\parindent}{0cm}
\setlength{\parskip}{0cm}
% Fonts
\usepackage{latexsym}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{graphicx}
% Math symbols I
\newcommand{\sinc}{\mbox{sinc}}
\newcommand{\const}{\mbox{const}}
\newcommand{\trc}{\mbox{trace}}
\newcommand{\intt}{\int\!\!\!\!\int }
\newcommand{\ointt}{\int\!\!\!\!\int\!\!\!\!\!\circ\ }
\newcommand{\ar}{\mathsf r}
\newcommand{\im}{\mbox{Im}}
\newcommand{\re}{\mbox{Re}}
% Math symbols II
\newcommand{\eexp}{\mbox{e}^}
\newcommand{\bra}{\left\langle}
\newcommand{\ket}{\right\rangle}
% Mass symbol
\newcommand{\mass}{\mathsf{m}}
\newcommand{\Mass}{\mathsf{M}}
% More math commands
\newcommand{\tbox}[1]{\mbox{\tiny #1}}
\newcommand{\bmsf}[1]{\bm{\mathsf{#1}}}
\newcommand{\amatrix}[1]{\begin{matrix} #1 \end{matrix}}
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\eps}{\epsilon}
\newcommand{\fd}[2]{\frac{d #1}{d #2}}
\newcommand{\ffd}[2]{\frac{d^2 #1}{d #2^2}}
\newcommand{\fdl}[2]{(d #1/d #2)}
% Other commands
\newcommand{\hide}[1]{}
\newcommand{\drawline}{\begin{picture}(500,1)\line(1,0){500}\end{picture}}
\newcommand{\bitem}{$\bullet$ \ \ \ }
\newcommand{\Cn}[1]{\begin{center} #1 \end{center}}
\newcommand{\mpg}[2][1.0\hsize]{\begin{minipage}[b]{#1}{#2}\end{minipage}}
\newcommand{\Dn}{\vspace*{3mm}}
% Figures
\newcommand{\putgraph}[2][0.30\hsize]{\includegraphics[width=#1]{#2}}
% heading
\newcommand{\heading}[1]{\begin{center} \Large {#1} \end{center}}
\newcommand{\auname}[1]{\begin{center} \bf Submitted by: #1 \end{center}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DO NOT EDIT BEFORE THIS LINE
%% START YOUR TEXT FROM HERE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\heading{Electric dipole}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LEAVE THE PART BETWEEN THE COMMENTED LINES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\bf The problem:}
\Dn
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
An infinite wire is placed on the $z$-axis and homogeneously charged with
linear charge density $\lambda$. An electric dipole $\vec{p}=p\widehat{y}$ is
positioned at $(x,0,0)$.
\begin{enumerate}
\item What is the torque acting on the dipole?
\item What is the energy of the dipole in the field of the wire?
\item What is the energy of the wire in the field of the dipole?
\item Find the force acting on the dipole.
\end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LEAVE THE PART BETWEEN THE COMMENTED LINES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Dn
{\bf The solution:}
\Dn
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1. We know that the torque acting on a dipole is: $\vec{N}=\vec{p}\times{\vec{E}}$
\
\begin{eqnarray}
\vec{E}&=&\frac{2k\lambda}{r}\hat r
= k\frac{2\lambda}{r^{2}}\vec{r}=k\frac{2\lambda}{x^{2}+y^{2}}(x\hat{x}+y\hat{y}) \\
%
\vec{p}&=&p\hat{y} \\
%
\vec{N}&=&\vec{p}\times{\vec{E}}=-k\frac{2\lambda}{x^{2}+y^{2}}px\hat{z}
%
\end{eqnarray}
%
We can find the torgue at $y=0$:
%
\begin{eqnarray}
\vec{N}(y=0)&=&-\frac{2kp\lambda}{x}\hat{z}
\end{eqnarray}
\Dn
2. The energy of the dipole in the field of the wire
\begin{eqnarray}
U&=&-\vec{p}\cdot\vec{E}=-pE_{y}=-k\frac{2\lambda}{x^{2}+y^{2}}py \\
\end{eqnarray}
3. The energy of the wire in the field of the dipole is equal to the energy of the dipole in the field of the wire.
\Dn
4. We can derive the force from the energy by: $\vec{F}=-\vec{\nabla}U$
\begin{eqnarray}
\vec{F}_{x}&=&-\frac{\partial{U}}{\partial{x}}=2k\lambda py\frac{2x}{(x^{2}+y^{2})^{2}} \\
%
\vec{F}_{x}(y=0)&=&0\\
%
\vec{F}_{y}&=&-\frac{\partial{U}}{\partial{y}}=-2k\lambda p\frac{x^{2}-y^{2}}{(x^{2}+y^{2})^{2}} \\
%
\vec{F}_{y}(y=0)&=&\frac{-2k\lambda p}{x^{2}}
\end{eqnarray}
And finally we can check ourselves by verifying that $\vec N = \vec r \times \vec F$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}