# Determining Electric Potential due to a line of nonuniform charge density [closed]

A rod of length $$L$$ lies along the x axis with its left end at the origin. It has a non uniform charge density $$\lambda = \alpha x$$ where $$\alpha$$ is a positive constant. Calculate the electric potential at $$A(-d,0,0)$$.

First Attempt

$$V = - \int \vec{E}\cdot \mathrm d\vec{l}$$

Calculating The electric field $$E$$:

$$E = \int \frac{\lambda\,\mathrm dl}{4\pi \epsilon r^2 }$$

with $$r^2 = (x+d)^2$$

We then get $$E=\frac{\alpha}{4 \pi \epsilon}\Big(\ln(x+d) + \frac{d}{x+d}\Big)$$

Then, $$V = - \int_0^L E\cdot\mathrm dl= -(L+2d)\ln(l+d)+l+2d\ln(d)$$

Second Attempt

Using the formula $$V = \int_0^L \frac{\lambda\,\mathrm dl}{4\pi \epsilon r}$$

Evaluating this integral leads to the following :

$$V=\frac{\alpha}{4 \pi \epsilon}\Bigg(L-d \ln\Big(\frac{L+d}{d}\Big)\Bigg)$$

Why do both attempts give different solutions?

## closed as off-topic by ZeroTheHero, Jon Custer, Kyle Kanos, Aaron Stevens, Qmechanic♦Jan 30 at 16:32

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" – ZeroTheHero, Jon Custer, Kyle Kanos, Aaron Stevens, Qmechanic
If this question can be reworded to fit the rules in the help center, please edit the question.

• There are many issues here. In the first method you shouldn't have $r^2=(x+d)^2$. If you wan to go the first attempt route, you are trying to find the potential difference between the point A and the left end of the rod. So you need to find the field at all points on the line from $x=0$ to $x=-d$ (so maybe say $r^2=(x+x')^2$ and do the first integral over $x$?), and then do the line integral over $x'$ from $x=0$ to $x=-d$ – Aaron Stevens Jan 30 at 15:36
• Another issue is that the first method puts $V=0$ at $x=0$, but the second method puts $V=0$ at infinity. I would just stick with the second method. – Aaron Stevens Jan 30 at 15:37