0

The electric field at a point is given by $-\nabla V$, where $V$ is the potential. So let the electric field be given to us, $a(y i\hat +x j\hat)$, to get the x component of the electric field we differentiated V keeping only x as the variable so I assumed while integrating we must do the same (keep x as the only variable) with this in mind I found potential as:$$-a(yx+xy)+C$$

where it is actually $-axy+C$, Where have I gone wrong?

I Don't have much knowledge on partial derivatives , It is taught to solve problems like this at a very basic level.

2 Answers2

2

We have

$$E_x=-\frac{\partial V}{\partial x}=ay \quad \Rightarrow \quad V(x,y)=-axy+g(y),$$

for some unknown function $g(y)$, and

$$E_y=-\frac{\partial V}{\partial y}=ax \quad \Rightarrow \quad V(x,y)=-axy+h(x),$$

for some unknown function $h(x)$. But these two expressions must be equal, which shows that $g(y)=h(x)=C$ is constant. Alternatively, you can take partial with respect to $y$ of the top expression for $V$, and the partial with respect to $x$ of the bottom expression, to see that $h'(x)=g'(y)=0$, so again $g(y)=h(x)=C$. Hence, $V(x,y)=-axy+C.$

Stuck
  • 1,712
1

While innerproduct's answer is correct, I always preferred a slightly different method for this type of problem, so I thought I should share.

I begin as he would, by integrating $\frac{\partial V}{\partial x} = -ay$ on both sides with respect to $x$ to get $V = -axy + g(y),$ where we use $g(y)$ as an arbitrary function of $y$ instead of a constant because this is what would vanish when taking a partial derivative with respect to $x.$

Then, instead of integrating our other expression, I would take derivatives with respect to $y$ on both sides: $\frac{\partial V}{\partial y} = -ax + g'(y).$ Now from the field we have $\frac{\partial V}{\partial y} = -ax,$ so $g'(y) = 0$ and $g(y) = C.$ Plugging this in we get $V(x,y) = -axy + C$ and we're done.

Sorry if this is considered a bit of a duplicate answer, but I just wanted to share my preferred method because personally, especially when this is generalized into higher dimensions, having all of those functions and checking that they all match up feels a bit messy and loose, and this feels a bit more elegant to me. (not a big deal either way though)