Calculating the electric field produced by a line on a point Here's the question:

The electric field of a point charge can be obtained from Coulomb's law, But since here we have the charge distributed continuously over some region, the sum becomes an integral:
$$E(r) = \frac{1}{4\pi \epsilon_0} \int \frac{1}{r^2} \hat{r}dq$$
Now for my solution, I use the integral above in integrate $\frac{1}{x^2}$ from $0$ to the right end of $L_1$. The issue is after evaluation I have a division over $0$. In an attempt to change this, I took the midpoint of $L_1$ as a reference and then integrate over the range $\frac{-L1}{2}$ to $\frac{L1}{2}$. This integral does not converge. Should I integrate from $a$ to $b$? $a$ being the left end of $L_1$ and $b$ being the right end.
For part b, how do I integrate over the changing field points associated with locations along wire $L_2$?
 A: For part one you should integrate From x to $L_1$ - x. Take the left end of the segment as the reference point.
Let's say we want to find electric field at point P.
From the leftmost end point (The reference point) of the segment the point P lies x units away and from the rightmost end of the segment the point P lies x - $L_1$ from it.
Here, we are concerned about the distance of the point P from each of infinitesimal part of the segment and we put the limits in such a way that we cover all those infinitesimal parts and their respective distances from point P.
A: The small contribution to the $x$-component $dE_x$ at a point $x>L_1$ created by a small amount of charge $dq$ located at position $x_s$ is simply
$$
dE_x=\frac{dq}{4\pi\epsilon_0}\frac{1}{(x-x_s)^2}\, .
$$
For your line with total charge $Q_1$, you have $dq=\frac{Q_1}{L_1}dx_s$ for the piece of wire located at $x_s$, and the net field produced by this line will be continuous sum (i.e. the integral) from $0$ to $L_1$ of the $dE_x$'s:
$$
E_{1x}=\frac{Q_1}{4\pi\epsilon_0 L_1}\displaystyle\int_0^{L_1}
\frac{dx_s}{(x-x_s)^2}\, .
$$
You can deal with part b) in much the same way, by calculating the small force $dF_x$ on a small amount of charge in line two located at $x_2$, then integrate over the whole of line $2$.
