# Calculating electric field.

1. Jan 23, 2010

### E92M3

1. The problem statement, all variables and given/known data
A line (A-B-C-D) with uniform charge density is shown in the following figure. Calculate the electric field and the potential at center O, where AB=CD=Diameter of the semi-circle.

2. Relevant equations
$$E(r)=\frac{1}{4 \pi \epsilon_0}\int_l \frac{\lambda(r')}{n^2}\hat{n}dl'$$
n is the distance from the charge element to the point r and n hat is its direction.

3. The attempt at a solution
Form super position, I know that i can break it into sections of AB, BC and CD.
I think that the contribution of AB should cancel CD.
I let the length of AB=CD=L. Please verify the followings:
$$E(O)_{AB}=\frac{\lambda}{4 \pi \epsilon_0}\int_{\frac{-L}{2}}^{\frac{-3L}{2}}\frac{dx}{x^2}$$
$$E(O)_{CD}=\frac{\lambda}{4 \pi \epsilon_0}\int_{\frac{L}{2}}^{\frac{3L}{2}}\frac{dx}{x^2}$$
$$E(O)_{AB}=-E(O)_{CD}$$

But I'm stuck here, can't deal with the semi circle.

#### Attached Files:

• ###### phys.jpg
File size:
2.9 KB
Views:
55
Last edited: Jan 24, 2010
2. Jan 24, 2010

### vela

Staff Emeritus
Yes, you can see that from the symmetry. The contributions from AB and CD will be equal but point in opposite directions.
I'd switch the limits on the first integral so it comes out positive because if $\lambda>0$, you expect the contribution from AB to point in the +x direction at O. I'd put a negative sign in front of the second integral because CD's contribution should point in the -x direction. The signs in both cases come from $\hat{n}$.
You want to use polar coordinates and express $dl$ in terms of $r$ and $\theta$. Also, you can argue that only one component matters because the other will cancel by symmetry.

3. Jan 24, 2010

### E92M3

I did some more thinking but just get want to get one thing straight: What determines the limits of the integral? Namely, what determines P in:
$$E(r)=\frac{1}{4 \pi \epsilon_0}\int_l \frac{\lambda(r')}{n^2}\hat{n}dl'$$

I have 2 thoughts on this:
1. n hat. For section AB, n hat points to the +x-direction; therefore, the limits are -3L/2 (bottom) to -L/2(top). For section CD, n hat points towards the -x-direction, so the limits are 3L/2(bottom) to L/2(top). This will ensure that their contribution cancels. But what about BC? I know that it probably doesn't matter for this question since I will end up integrating in polar anyways. But should I integrate from B to C or from C to B? This lead me to come up with my second thought.
2. Define a direction for dl and stick with it. In this case I can choose from ABCD or DCBA. As with my 1st thougt, it won't matter for the semicircle in the middle, but if I do this, AB and CD won't cancel. Which one should I go with?

4. Jan 24, 2010

### E92M3

I worked out the solution for the electric field, please chck whether it's right, THANX!!!!!!
$$E=E_{AB}+E_{BC}+E_{CD}$$
$$=\frac{\lambda}{4 \pi \epsilon_0} \left [ \int_{-3L/2}^{-L/2}\frac{dx}{x^2} \hat{x}+\int_{-L/2}^{L/2} \frac{dl}{n^2} \hat{n}+ \int_{L/2}^{3L/2} \frac{dx}{x^2} (-\hat{x}) \right ]$$
The first and last integrals cancels. Now the center one:
$$dl=rd\theta = \frac{L}{2}d\theta$$
$$\hat{n}=cos\theta \hat{x}+sin\theta \hat{y}$$
$$=\frac{2\lambda}{4 L\pi \epsilon_0} \int_{0}^{\pi}cos\theta \hat{x}+sin\theta \hat{y}d\theta$$
$$=\frac{-\lambda}{ L\pi \epsilon_0} \hat{y}$$

Now what about the potential at O? I know that :
$$V(r)=-\int E \cdot dl$$
I take the potential at infinity to be zero and this integral is path independent. I choose the path along the y axis, then I have:
$$V(O)=\frac{\lambda}{ L\pi \epsilon_0} \int_{\infty}^0 \hat{y} \cdot dy(-\hat{y})$$
$$=\frac{-\lambda}{ L\pi \epsilon_0} \int_{\infty}^0 dy$$
This blows up. How can I deal with it?

Last edited: Jan 24, 2010
5. Jan 24, 2010

### vela

Staff Emeritus
You dropped a sign here. $\hat{n}$ should point away from wire when $\lambda>0$.
You also flipped a sign here so the answer came out right, but the integral of $\sin\theta=+2$, not -2.

6. Jan 24, 2010

### vela

Staff Emeritus
You're using E(O) in the integral, but you need to use E(y) if you take this approach.

They actually want you to integrate over the charge distribution again, but this time using the integrand for calculating the potential instead of for the electric field.

7. Jan 24, 2010

### E92M3

In that case I'll use this:
$$V=\frac{\lambda}{4 \pi \epsilon_0} \left [ \int_{-3L/2}^{-L/2} x^{-1}dx +\int_{0}^{\pi}d\theta +\int_{L/2}^{3L/2} x^{-1}dx \right ]$$
Well now the first integral blows up. You can't ln a negative number. Wait, can you even do the super position thing for potentials? Also, this brings me to my previous question in my previous post: how do I set the direction of the integral? In the electric part, I choose to integrate from A to D then used n hat to give me the signs that I need. But i could easily have chosen to integrate from D to A instead and still get the right answer. But I think that this is only due to the symmetry in this problem. Suppose the question just has charge distributed from C to D. Then n hat will always point to the negative x-direction. My answer will then depend on the direction I choose dl to be since changing the direction of dl will flip my limits thus changing the sign. So is my approach wrong?

Last edited: Jan 24, 2010
8. Jan 24, 2010

### vela

Staff Emeritus
You forgot the integral has an absolute value:

$$\int \frac{dx}{x} = \log |x|+C$$
Yes, because integration is a linear operation. The line integral of a sum of electric fields is the sum of the line integrals of the individual electric fields.

That's not quite right. What I wrote earlier wasn't clear. The direction of $\hat{n}$ is dictated by the geometry. It points in the direction of the vector going from the element of charge to the point in question. You can't flip its sign arbitrarily to get the answer you want.

$dl$ is a length, so it's inherently positive. If the charge density is positive, then the electric field points in the direction of $\hat{n}$ as it should. The sign of $dx$, on the other hand, is set by the direction of the integral. With the coordinate system you choose, if you integrate from A to B, $dx>0$, so $dl=dx$. If you integrate from B to A, however, $x$ is decreasing, so $dx<0$ and $dl=-dx$. To put it simply, $dl=|dx|$.

9. Jan 24, 2010

### E92M3

This is still not good. The first and last integral sums to give log(1)=0. The middle one gives pi. This will give me a constant potential. The gradient of V will then be zero. But I thought it must equal the negative of the E field I found previously.

10. Jan 24, 2010

### vela

Staff Emeritus
The first integral should be

$$V=\frac{\lambda}{4 \pi \epsilon_0} \int_{-3L/2}^{-L/2} \frac{1}{r}dx=\frac{\lambda}{4 \pi \epsilon_0} \int_{-3L/2}^{-L/2} \frac{1}{-x}dx$$

since the distance $r$ from the charge to O is $-x$.

The answer will come out to be a number because you're calculating the potential for a specific point. If you performed the calculation in general for the point (x,y,z), you'd then get a function of x, y, and z whose gradient would give you E.

11. Jan 24, 2010

### E92M3

But the distance is a magnitude, how could it have a sign? Plus, if I change the first integral, it won't cancel with the third one. do I change the third one too?

12. Jan 25, 2010

### vela

Staff Emeritus
For both the first and third integral, r=|x|. For the first integral, x runs from -3L/2 to -L/2, so r=|x|=-x. For the third integral, x is positive, so r=|x|=x.

The integrals are not supposed to cancel when you're calculating the potential. The more charge there is, the more work is required to bring a test charge in from infinity, so the two contributions need to add.