# How to decide which way are the limits of an integral?

So, I'm trying to calculate the electric field at a point $$r$$ distance away on the perpendicular bisector of a finite line charge having uniform charge density $$\lambda$$

I arrive at the following expression for electric field:

$$\dfrac{\lambda}{4\pi\epsilon_0 r} \left[\sin{\theta}\ \right]$$

What I cannot understand however, is how to decide which way to take limits , $$\theta$$ to $$-\theta$$ or the other way around? Is there any convention regarding this?

you start from the contribution of the elementary charge $$d E_x = \frac{dq}{4\pi \epsilon_0 r^2}\frac{x}{r}$$ and integrate over the charge distribution; the limits should be $$0$$, $$Q$$ , where $$Q$$ is the total charge. Then you transform the charge element $$dq = \lambda dz$$ and the new integration limits are something like $$-l/2$$, $$l/2$$ if $$l$$ is the length of the line charge. In the final step you should change the variable from $$z$$ to $$\theta$$ and calculate the integration limits accordingly. There is nothing arbitrary here.
• Yes,and what I'm asking is why are the limits $-L/2$, $L/2$ and not $L/2$, $-L/2$? Jun 19 '20 at 19:41
• because the first condition imposed is that the integral over $L$ gives the correct total charge. You want $$\int \limits_{-L/2}^{L/2}dx\lambda = \lambda L = Q$$. If you change the limits here you get $-Q$ and this would be wrong. Jun 19 '20 at 19:46
• Put differentially, when you change variables from $\mathrm dq$ to $\lambda ~ \mathrm dy$ it is part of this definition that you want negative charges to contribute via a negative $\lambda$ or positive charges to contribute via a positive $\lambda$. This means that the physical meaning of the sign of $\mathrm dq$, positive vs negative charge, turns into a sign convention of positive $\mathrm dy$, which means you are choosing an increasing direction for the integral, so $-L/2 \to L/2$ is correctly increasing while $L/2\to -L/2$ would be decreasing. Jun 19 '20 at 20:01