1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Force to Potential Energy to Force again gives wrong formula

  1. Sep 23, 2012 #1
    So I have this vector Force:

    [itex]\vec{F} = y\hat{x} + x\hat{y}[/itex]

    This force is conservative ([itex]\nabla \times \vec{F} = 0[/itex]).

    So I integrate it to find the potential energy:

    [itex]U = -\int \vec{F} \bullet d\vec{s}[/itex]
    [itex]U = -\int y \delta x - \int x \delta y[/itex]
    [itex]U = -yx - xy[/itex]
    [itex]U = -2xy[/itex]

    Ignoring the arbitrary constant because it can be set to 0.

    And now to do what should be the reverse operation:

    [itex]\vec{F} = -\nabla U[/itex]
    [itex]\vec{F} = -\hat{x}\frac{\delta U}{\delta x} - \hat{y}\frac{\delta U}{\delta y}[/itex]
    [itex]\vec{F} = 2y\hat{x} + 2x\hat{y}[/itex]

    So somehow, in the process of integrating and then differentiating, the force doubled. I'm not sure where the error is here but I'd very much like to get rid of it. Can anyone point me in the right direction here please?
  2. jcsd
  3. Sep 23, 2012 #2


    User Avatar
    2017 Award

    Staff: Mentor

    You cannot integrate over different x and y like that. Both integrals there have to be the potential (up to an integration constant).
    See this thread for a similar problem and its solution (post 7).
  4. Sep 23, 2012 #3
    I'm not quite sure I know what you mean, but to expand a little on how the integration proceeded in my first post:

    [itex]\vec{F} = y\hat{x} + x\hat{y}[/itex]
    [itex]d\vec{s} = \hat{x}dx + \hat{y}dy[/itex]

    [itex]\int \vec{F} \bullet d\vec{s} = \int (y\hat{x} + x\hat{y})\bullet(\hat{x}dx + \hat{y}dy)[/itex]

    [itex]\int \vec{F} \bullet d\vec{s} = \int y\hat{x} \bullet \hat{x}dx + y\hat{x} \bullet \hat{y}dy + x\hat{y} \bullet \hat{x}dx + x\hat{y} \bullet \hat{y}dy[/itex]

    But since:
    [itex]\hat{x} \bullet \hat{x} = 1[/itex]
    [itex]\hat{x} \bullet \hat{y} = 0[/itex]
    [itex]\hat{y} \bullet \hat{x} = 0[/itex]
    [itex]\hat{y} \bullet \hat{y} = 1[/itex]

    [itex]\int \vec{F} \bullet d\vec{s} = \int ydx + xdy[/itex]

    [itex]\int \vec{F} \bullet d\vec{s} = \int ydx + \int xdy[/itex]

    [itex]\int \vec{F} \bullet d\vec{s} = yx + xy[/itex]

    [itex]\int \vec{F} \bullet d\vec{s} = 2xy[/itex]

    [itex]∴U = -2xy[/itex]

    Essentially, this is the same as saying:

    [itex]\vec{F} = y\hat{x} + x\hat{y}[/itex]
    [itex]F_{x} = y[/itex]
    [itex]F_{y} = x[/itex]

    [itex]U = -\int F_{x} dx - \int F_{y} dy[/itex]
    [itex]U = -\int y dx - \int x dy[/itex]
    [itex]U = -yx -xy[/itex]
    [itex]U = -2xy[/itex]

    If some part of this method is wrong, I don't see what it is.
    Last edited: Sep 23, 2012
  5. Sep 24, 2012 #4


    User Avatar
    Homework Helper
    Gold Member

    When evaluating a line (or path) integral, you must first choose a path. You have

    [tex]U(\mathbf{r}) \equiv -\int_{\mathcal{O}}^{\mathbf{r}}\mathbf{F}(\mathbf{r}') \cdot d\mathbf{r}' = -\int_{\mathcal{O}}^{\mathbf{r}} \left( y'dx'+x'dy'\right) = -\int_{\mathcal{O}}^{\mathbf{r}} y'dx' -\int_{\mathcal{O}}^{\mathbf{r}} \left( x'dy'\right) [/tex]

    Where you are integrating over any path from some arbitrary reference point [itex]\mathcal{O}[/itex] to your field point [itex]\mathbf{r}[/itex] (the primes are there to distinguish between the dummy variable of integration and the coordinates at the endpoint of the path, since it is bad notation to write something like [itex]\int_0^x f(x)dx[/itex]). Both integrals must be done over the same path. You cannot calculate one integral over a path with constant [itex]y[/itex], and the other over a path with constant [itex]x[/itex].

    For example, suppose we choose the origin as our reference point and integrate along the straight line [itex]y'=0[/itex] (so [itex]dy'=0[/itex] for this segment) from [itex]x'=0[/itex] to [itex]x'=x[/itex] and then along the line [itex]x'=x[/itex] (so [itex]dx'=0[/itex] for this segment) from [itex]y'=0[/itex] to [itex]y'=y[/itex] . Then we have:

    [tex]U =-\int_{\mathcal{O}}^{\mathbf{r}} \left( ydx+xdy\right) = \int_{x'=0}^{x'=x} -\left( (0)dx' + x'(0)\right) + \int_{y'=0}^{y'=y} -\left( y'(0)+xdy'\right) = -x\int_{y'=0}^{y'=y} dy' = -xy [/tex]

    The reason we can pull the [itex]x[/itex] out of the last integral is because it is a constant (which is made clear by the fact we are integrating over primed coordinates)

    Alternatively, we could again choose the origin as our reference point and integrate over an elliptical arc described by the parametric equations [itex]x'(t)=x\sin t[/itex] and [itex]y'(t)=y(1-\cos t)[/itex] from [itex]t=0[/itex] to [itex]t=\frac{\pi}{2}[/itex]. Everywhere along the path, we have [itex]dx'=x\cos t dt[/itex] and [itex]dy' = y\sin t dt[/itex], so we have:

    [tex]U =-\int_{\mathcal{O}}^{\mathbf{r}} \left( ydx+xdy\right) = -\int_{t=0}^{t= \frac{\pi}{2}} \left( y(1-\cos t)(x\cos t dt) + x\sin t(y\sin t dt)\right)= -\int_{t=0}^{t= \frac{\pi}{2}} xy\left( \cos t - \cos^2 t + \sin^2 t \right) dt = -xy [/tex]

    As you can see, you get the same value for each of the two example paths, as you would expect since the curl of [itex]\mathbf{F}[/itex] is zero.

    Of course, all this becomes much easier if you simply recognize that [itex]xdy+ydx=d(xy)[/itex] via the product rule, because then you are just integrating an exact differential and the fundamental theorem of calculus tells you that [itex]\int d(f(x,y)) = f(x,y) + \text{constant}[/itex]
  6. Sep 24, 2012 #5
    Thank-you gabbagabbahey, that helped my understanding a lot.

    Additionally, I didn't spot it at all, but now that you've pointed out that it's basically the product rule, it's like I can't unsee it. :smile:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook