# Trouble finding appropriate potential function

## Homework Statement

Given a vector field defined by:
## \vec F = 2xc\hat x + cz\hat y + cx\hat z ##
Is conservative

Find a potential function for F. Verify this by taking the gradient to recover F.

## Homework Equations

## V = - \int_a^b \vec F \cdot \vec dr ##

## F = -\nabla V ##

## The Attempt at a Solution

The field is conservative, and this was found easily by computing the curl and finding it to be zero.

To find the potential function, I tried to simply apply the second formula in section two, as such:

## \vec dr = dx\hat x + dy\hat y + dz\hat z ##

And to choose a path from (0,0,0) to (x,y,z).

So then:

## \vec F \cdot \vec dr = 2xcdx + czdy + cydz ##

And the resulting integral is:

## - ( \int_0^x 2xcdx + \int_0^y czdy + \int_0^z cydz ) ##

Which results in:

## V = -cx^{2} - cyz - cyz = -cx^{2} - 2cyz ##

But when I try to get back to F using the negative gradient of V, I get the correct answer for the x component, but the factor of two ends up giving me the wrong answer for the y and z components. I'm not sure exactly what went wrong or how to fix it at this point.

vela
Staff Emeritus
Homework Helper
Your integral is wrong. Think more carefully about the path from the origin to (x, y, z).

LCKurtz
Homework Helper
Gold Member

## Homework Statement

Given a vector field defined by:
## \vec F = 2xc\hat x + cz\hat y + cx\hat z ##
Is conservative

That field isn't conservative. Presumably you mean the third term to be ##cy\hat z##.

Find a potential function for F. Verify this by taking the gradient to recover F.

## Homework Equations

## V = - \int_a^b \vec F \cdot \vec dr ##

## F = -\nabla V ##

## The Attempt at a Solution

The field is conservative, and this was found easily by computing the curl and finding it to be zero.

To find the potential function, I tried to simply apply the second formula in section two, as such:

## \vec dr = dx\hat x + dy\hat y + dz\hat z ##

And to choose a path from (0,0,0) to (x,y,z).

What path are you choosing?

So then:

## \vec F \cdot \vec dr = 2xcdx + czdy + cydz ##

And the resulting integral is:

## - ( \int_0^x 2xcdx + \int_0^y czdy + \int_0^z cydz ) ##

I don't follow that step. You need to specify a path.

I don't follow that step. You need to specify a path.

Quite right, I did mean the last component to be ## cy\hat y ##.

When you say to specify a path, do you mean I need to specify a specific path, like (0,0,0)->(1,1,1), and can't do a generic path from the origin to some (x,y,z) (it's been awhile since I last did vector calc)?

If so, say I choose the path I mention prior, going from the origin to (1,1,1). Then the integral should result in:

## V = -c - cz - cy ##

And going from there, I'm not sure where to begin going in the other direction.

vela
Staff Emeritus
Homework Helper
There is an infinite number of paths that connect (0, 0, 0) to (x, y, z). You need to choose one specific path to evaluate the integral.

There is an infinite number of paths that connect (0, 0, 0) to (x, y, z). You need to choose one specific path to evaluate the integral.

That's true, and since F is conservative, it shouldn't matter which of those infinite paths I take. That's convincing for why I needed to choose a particular path, but after that, is the number that I got when using a straight line from the origin to (1,1,1) correct?

Based on that, the gradient of V is, problematically, nothing that even looks even a bit like the original function. I'm thinking the mistake is in evaluating the integral, but I can't seem to tell where that problem is.

LCKurtz
Homework Helper
Gold Member
That's true, and since F is conservative, it shouldn't matter which of those infinite paths I take. That's convincing for why I needed to choose a particular path, but after that, is the number that I got when using a straight line from the origin to (1,1,1) correct?

You want to go from ##(0,0,0)## to ##(x,y,z)##, not ##(1,1,1)##. You will have to keep your variables straight. If you intend to use a straight line path, you need to write the equation of that path in the form ##\vec R(t) = \langle x(t),y(t),z(t)\rangle## and use that equation to evaluate the integral$$\int_C \vec F\cdot d\vec R = \int_a^b \vec F \cdot \frac{d\vec R}{dt}~dt$$where ##a## and ##b## are the ##t## limits of your parameterization of your straight line ##C##. Since you haven't gotten the correct answer you obviously aren't doing it right. So show us your equation of the line and your setup of the integral.

Alternatively, since, as you have mentioned, the integral is independent of path, you could choose a different path (there are easier ones) or you can find the potential function by integration methods.

Last edited:
I'm not sure exactly what would be an easier curve than a straight line, but here's how I set up the straight line using the formula you gave me:

## \vec F = <1,1,1> ## (since it's a straight line, x(t), y(t), z(t) are all t from 0 to 1)

##\frac{d\vec R}{dt} = <1,1,1> ## (the derivative of a straight line is a constant)

So then:

## \vec F \cdot \frac{d\vec R}{dt} = 2tc*1 + tc*1 + tc*1 = 4tc ##

## \int_0^1 4tc dt = \left. 2t^{2} \right|_0^1 = 2 ##

But this is even worse than the first attempt. Is there some subtlety with using a straight line that I'm missing?

LCKurtz
Homework Helper
Gold Member
I'm not sure exactly what would be an easier curve than a straight line, but here's how I set up the straight line using the formula you gave me:

## \vec F = <1,1,1> ## (since it's a straight line, x(t), y(t), z(t) are all t from 0 to 1)

You already have ##\vec F = c\langle 2x,z,y\rangle##. Don't use it for something different now.

##\frac{d\vec R}{dt} = <1,1,1> ## (the derivative of a straight line is a constant)

What you have called ##\vec F## and should be ##\vec R(t)## above isn't the equation of a straight line because there is no ##t## variable in it. And as you have been told before you don't want the path to go from (0,0,0) to (1,1,1) anyway. It has to go to (x,y,z). I would suggest you have it go to (X,Y,Z) so you don't get your dummy integration variables dx,dy, and dz mixed with them.

But this is even worse than the first attempt. Is there some subtlety with using a straight line that I'm missing?

It isn't exactly subtle. You need to start by writing the parametric equation of the line from (0,0,0) to (X,Y,Z). You can change the answer back to lower case once you have the line integral figured out.

Typos abound in the above post, sorry about that. It was supposed to be:

## \vec R = <t, t, t>, \frac{d\vec R}{dt} = <1,1,1> ##

So if the path is from (0,0,0) to (X,Y,Z), if I were to do it by integrating with dt, would I need to use bounds on t from 0 to, say, T?

Last edited:
LCKurtz
Homework Helper
Gold Member
You need to start by writing the parametric equation of the line from (0,0,0) to (X,Y,Z)..

Typos abound in the above post, sorry about that. It was supposed to be:

## \vec R = <t, t, t>, \frac{d\vec R}{dt} = <1,1,1> ##

Is that supposed to be your response to my above quote?

I hit "enter" too soon. It's been edited to add the rest.

LCKurtz
Homework Helper
Gold Member
At the risk of repeating myself: YOU HAVE TO BEGIN BY WRITING THE PARAMETRIC EQUATION OF THE STRAIGHT LINE from (0,0,0) to (X,Y,Z). Surely your text tells you how to write the line between two points.

At the risk of repeating myself: YOU HAVE TO BEGIN BY WRITING THE PARAMETRIC EQUATION OF THE STRAIGHT LINE from (0,0,0) to (X,Y,Z). Surely your text tells you how to write the line between two points.

The general form is given as:
## x(t) = x_0 + at ##
## y(t) = y_0 + bt ##
## z(t) = z_0 + ct ##

And ## \vec R (t) = \langle x(t), y(t), z(t) \rangle ##

Since the line starts at the origin, the initial points (x0, y0, z0) are all zero. The end points are (X, Y, Z). So then if t goes from 0 to 1, then a = X, b = Y, c = Z.

So:
## \vec R (t) = \langle Xt, Yt, Zt\rangle ##

And by taking the derivative:

## \frac{d\vec R}{dt} = \langle X, Y, Z\rangle ##

Given that it returns the correct values for the start and end points, I'm pretty confident that this is the correct equation for the line.

And then I rewrite F with R(t) included:

## \vec F = \langle2cXt, cZt, cYt \rangle ##

And taking the dot product of F with the derivative of R:

## 2ctX^{2} + ctZY + ctYZ = 2ctX^{2} + 2ctYZ ##

Applying that to the integral:

## \int_0^1 2ctX^{2} + 2ctYZ dt = \left. ct^{2}X^{2} + ct^{2}YZ \right|_0^1 = cX^{2} + cYZ ##

Which gives me the correct vector field upon taking the gradient, finally. Sorry for being so incredibly dense; that shouldn't have been half as difficult as I made it.

LCKurtz
Homework Helper
Gold Member
I'm not sure exactly what would be an easier curve than a straight line,

Now that you have solved the problem, I will show you what I meant about an easier path. Ignoring the ##c##, you have the integral$$\int_{(0,0,0)}^{(X,Y,Z)} 2x~dx +z~dy +y~dz$$and you are free to choose the path. Think about the path that moves along the coordinate directions, first in the x direction, then the y direction, then the z direction. So the path has three sections$$(0,0,0) \to (X,0,0)\to (X,Y,0) \to (X,Y,Z)$$That may seem like adding work but as you will see, you have lots of zeros, and you can let the variables themselves be the parameters.

On the first path both dy and dz are zero so you just have ##\int_0^X 2x~dx = X^2##.
On the second path both dx and dz are zero so you have ##\int_0^Y z~dy = 0## since ##z=0## on that segment.
On the third path both dx and dy are zero so you have ##\int_0^Z y~dz = \int_0^Z Y~dz = YZ## since ##y=Y## on that path.

Adding them up gives ##X^2 + YZ##. Same answer but less work since you can do many of the steps I have written out in your head.