# Find the potential using a line integral (Electromagnetism)

## Homework Statement:

Problem 2.20 One of these is an impossible electrostatic field. Which one?
(a) E=k[xyx+2yzy+3xzz];
(b) E = k[y2 x + (2xy + z2) y + 2yz z].
Here k is a constant with the appropriate units. For the possible one, find the potential, using the origin as your reference point. Check your answer by computing V V.
[Hint: You must select a specific path to integrate along. It doesn't matter what path
you choose, since the answer is path-independent, but you simply cannot integrate
unless you have a definite path in mind.]

## Relevant Equations:

V = -integral (E \cdot dl)
Del cross E = 0
Sorry - I wish I had some way of writing equations in this forum so the "relevant equations" section is easier to read. The answer to the first part is (a) so the rest follows from using the electric field given in B. If anyone is interested this question comes from Griffith's 3rd edition, problem 2.20...

Anway, I can do this problem fine. If you do the line integral but make it indefinite you get something which when taking the negative gradient will correctly give you back the electric field. However when making it definite the answer is not the same when taking the gradient.
For my homework in specific we are to do the following:
When finding the potential, use a line integral, with the path being the straight line from the origin to an arbitray point in space, (x0, y0, z0).

What I did:

I integrated -Edx for the x-component and got V(x,y,z) = -k(y^2)x_0+G(y,z). I then took the negative derivative with respect to y to solve for G as a function of some C(z) to get V(x,y,z) = -k(x(y_0)^2+z^2(y_0))+k(x_0)(y_0)^2 + C(z) for a final answer of V(x,y,z) = -k(x(y_0)^2+z^2(y_0))+k(x_0)(y_0)^2 - k y^2x_0 + ky_0z_0^2-kyz_0^2. This was using the limits given in the problem which were to be from 0 to some x0,y0,and z0 respectively. Can anyone tell me what I'm doing wrong?

Last edited: