# Electric Field of Bar [closed]

Problem: Positive charge $+Q$ is distributed uniformly along the positive $x$ axis from $x = 0$ to $x = a$. Negative charge $-Q$ is distributed along the $-x$ axis from $x = 0$ to $x = -a$. A point charge $+q$ is on $(0,y)$. Find the force that the positive and negative charge distributions exert on the point charge.

My (Wrong) Solution: We only consider the positive charges. Let $\sigma$ denote the charge density on the section. $\sigma = \dfrac{Q}{a}$. Then, the charge on a segment is $dQ = \sigma \hspace{1mm} dx = \dfrac{Q}{a} dx$. Plugging all this into the differential form of the formula for electric field, $$dE = \frac{k\dfrac{Q}{a}\,dx}{x^2+y^2}.$$ After drawing a diagram, we see that the $y-$component cancels out from both the positive and negative charges. Hence, we write $$dE_x = \frac{k\dfrac{Q}{a}\,dx}{x^2+y^2} \cdot \frac{a}{\sqrt{x^2 + y^2}} = \frac{k{Q}\,dx}{(x^2+y^2)^\frac{3}{2}}.$$ Then, we integrate as such $$\int^{a}_{0}dE_x = \frac{kQa}{y^2\sqrt{a^2 + y^2}}.$$ As the x components are the same for both the negative and positive charges and they add up in the negative x direction, the total force is $$F = \frac{2kQq}{y^2\sqrt{a^2 + y^2}}$$ in the $-x$ direction.

However, the correct answer is $$\frac{2qQ}{a}\left(\frac{1}{y} - \frac{1}{\sqrt{a^2 + y^2}}\right).$$

What have I done wrong in the calculations I've done in my attempt to solve the problem?

## closed as off-topic by ACuriousMind♦, user36790, dmckee♦Jun 26 '16 at 15:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Homework-like questions should ask about a specific physics concept and show some effort to work through the problem. We want our questions to be useful to the broader community, and to future users. See our meta site for more guidance on how to edit your question to make it better" – ACuriousMind, Community, dmckee
If this question can be reworded to fit the rules in the help center, please edit the question.

• Well I've made my question and my problem solving effort more apparent in my edited post. – lithium123 Jun 26 '16 at 18:22

When you calculated $dE_x$, you multiplied by $\frac{a}{\sqrt{x^2+y^2}}$. Why? Hint: try $\frac{x}{\sqrt{x^2+y^2}}$