<s>[INST] How to write the equation of a field line of an electrostatic field? How can we write the equations of a line of force between two charges, say $q$ and $q'$?
As an example, you may consider the simpler case of two opposite charges $+q$ and $-q$, and focus on the field line emerging out of $+q$ by making an angle of $\theta$ and reaching $-q$ with an angle $\phi$ with respect to the $x$-axis (see picture below).

 [/INST] Let a charge $+q$ be at the point $(a, 0)$ and a charge $-q$ be at the point $(-a, 0)$. Then the electric field at a point
$(x, y)$ is
\begin{equation}\tag{e1}\label{e1}
\vec{E} = q\vec{r}\left(\frac{1}{r_1^3} - \frac{1}{r_2^3}\right) - qa\hat{e}_x\left(\frac{1}{r_1^3} + \frac{1}{r_2^3}\right),
\end{equation}
where $\vec{r} = x\hat{e}_x + y\hat{e}_y$, $\vec{r}_1 = \vec{r} + a\hat{e}_x$ and $\vec{r}_2 = \vec{r} - a\hat{e}_x$. The
equation of lines of force is 
\begin{equation}\tag{e2}\label{e2}
\frac{\partial y}{\partial x} = \frac{y}{x + a\frac{r_2^3 + r_1^3}{r_2^3 - r_1^3}}.
\end{equation}
We will now solve equation \eqref{e2}. We first rearrange it as
\begin{equation}
\left((r_2^3 - r_1^3)x + a(r_2^3 + r_1^3)\right)\frac{\partial y}{\partial x} = (r_2^3 - r_1^3)y.
\end{equation}
Multiplying both sides by $y/(r_1^3 r_2^3)$, 
\begin{equation}
\left(\frac{x + a}{r_1^3} - \frac{x - a}{r_2^3}\right)y\frac{\partial y}{\partial x} = \frac{y^2}{r_1^3} - \frac{y^2}{r_2^3}.
\end{equation}
We substitute $y^2 = r_1^2 - (x + a)^2$ in the first factor on the right hand side and $y^2 = r_2^2 - (x - a)^2$ in
the second factor to get
\begin{equation}
\left(\frac{x + a}{r_1^3} - \frac{x - a}{r_2^3}\right)y\frac{\partial y}{\partial x} = \frac{1}{r_1} - \frac{(x+a)^2}{r_1^3} - \frac{1}{r_2} + \frac{(x-a)^2}{r_2^3}
\end{equation}
or,
\begin{equation}\tag{e3}\label{e3}
\frac{1}{r_1} - \frac{1}{r_2} - \frac{(x+a)}{r_1^3}\left((x + a) + y\frac{\partial y}{\partial x}\right) + \frac{(x-a)}{r_2^3}\left((x - a) + y\frac{\partial y}{\partial x}\right) = 0.
\end{equation}
We use the derivatives of $r_1$ and $r_2$ with respect to $x$
\begin{eqnarray*}
\frac{\partial r_1}{\partial x} &=& \frac{x + a}{r_1} + \frac{y}{r_1}\frac{\partial y}{\partial x} \\
\frac{\partial r_2}{\partial x} &=& \frac{x - a}{r_2} + \frac{y}{r_2}\frac{\partial y}{\partial x}
\end{eqnarray*}
in equation \eqref{e3} to get
\begin{equation}
\frac{1}{r_1} - \frac{x+a}{r_1^2}\frac{\partial r_1}{\partial x} - \frac{1}{r_2} + \frac{x-a}{r_2}\frac{\partial r_2}{\partial x} = 0,
\end{equation}
or
\begin{equation}
\frac{d}{dx}\left(\frac{x + a}{r_1}\right) - \frac{d}{dx}\left(\frac{x + a}{r_1}\right) = 0,
\end{equation}
from which we readily get
\begin{equation}\tag{e4}\label{e4}
\frac{x + a}{r_1} - \frac{x - a}{r_2} = C,
\end{equation}
where $C$ is a constant, as the solution of the differential equation (e2). This is also the solution given in article 63 of 'The Mathematical Theory of Electricity and Magnetism' by Sir James Jeans (5th edition).
</s>