# Why the work done is coming out to be positive?

In textbooks or in lectures it is said that : Work can be either positive or negative: if the force has a component in the same direction as the displacement of the object, the force is doing positive work. If the force has a component in the direction opposite to the displacement, the force does negative work.

In the light of above statement I have some doubt.

Let's say we've some kind of field which is giving rise to a force ##\mathbf{F} = kx^2 \hat i## (k is some positive constant) on some particle depending on it's position x.

If I move the particle from ## x =0## to ##x=-2## then it is certain that I've to apply a force of magnitude ##kx^2## but opposite in direction of that field force . The work that I'll do will be the negative of the work done by the field force and from the statement that I have quoted we can say that field force will do a negative work because force is in ##\hat i## direction and displacement will be in directly opposite direction, i.e. ##- \hat i##.

Work done by the field force is
$$W = \int_{0}^{-2} \mathbf{F} \cdot d\mathbf{l} \\ \\ \mathbf{F} \cdot d\mathbf{l} = \langle kx^2 , 0 , 0 \rangle \cdot \langle -dx , 0 , 0 \rangle \\ \textrm{ I've written -dx because displacement is in negative x direction} \\ \\ \mathbf{F} \cdot d\mathbf{l} = -kx^2 ~dx + 0 +0 \\ \\ W = \int_{0}^{-2} -kx^2 ~dx \\ W = -\frac{kx^3}{3} \bigg |_{0}^{-2} \\ W = -\frac{k~(-2)^3}{3} - \left( \frac{-k 0^3}{3}\right) \\ W = \frac{-k ~ (-8)}{3} \\ W = \frac{8k}{3}$$

I have got positive work! WHY?

Thank you. Any help will be much appreciated.

Work done by the field force is
$$W = \int_{0}^{-2} \mathbf{F} \cdot d\mathbf{l} \\ \mathbf{F} \cdot d\mathbf{l} = \langle kx^2 , 0 , 0 \rangle \cdot \langle -dx , 0 , 0 \rangle \\$$

I have got positive work! WHY?

The problem is how you set up the integral. ##dx## relates to your variable (not to the direction of your path). If you are using the normal ##x## coordinate, then you use simply ##dx## here. The direction of your path is indicated by the order of the end points on your integral. In this case you go from ##0## to ##-2##. In this case you should have ##dx## from ##0## to ##-2##.

If you have ##-dx## going from ##0## to ##-2##, then that is the same as ##dx## going from ##0## to ##2##. That's then a path in the positive direction.

The problem is how you set up the integral. ##dx## relates to your variable (not to the direction of your path). If you are using the normal ##x## coordinate, then you use simply ##dx## here. The direction of your path is indicated by the order of the end points on your integral. In this case you go from ##0## to ##-2##. In this case you should have ##dx## from ##0## to ##-2##.

If you have ##-dx## going from ##0## to ##-2##, then that is the same as ##dx## going from ##0## to ##2##. That's then a path in the positive direction.
I thought ##d\mathbf{l}## must be having a direction and I assigned it pointing it from 0 to -2 . But you have clarified that writing the lower limit as 0 and the upper limit as 1, it got defined by itself.

But if we use this expression ##\mathbf{F} = kx \hat i## Then there comes no problem, then writing ##d\mathbf{l}## as -dx gives the correct answer (that is negative work).

But if we use this expression ##\mathbf{F} = kx \hat i## Then there comes no problem, then writing ##d\mathbf{l}## as -dx gives the correct answer (that is negative work).

##d\mathbf{l}## is the vector line segment. If we have ##d\mathbf{l} = -dx## then the question is how to set up an integral. If you choose an integral with respect to ##x##, then you use ##dx## in the integral and ensure that the order of your end points matches the path defined by ##d\mathbf{l} = -dx##.

If you use ##u = -x## so that ##du = -dx##, then ##u## runs from ##0## to ##2## in this case.

It's one or the other:

Either ##x, dx, 0, -2##

or, with ##u = -x## and ##du = -dx##

##u, du, 0, 2##

I think the confusion stems from a strange use of the definition of a line integral. The savest way is to stick to the invariant definition in terms of vectors. If you want the work done on the particle given its trajectory ##\vec{x}(t)##, which defines the path along which the particle moves given the force, the work is defined simply as
$$W_{12}=\int_{t_1}^{t_2} \mathrm{d} t \dot{\vec{x}}(t) \cdot \vec{F}[\vec{x}(t)].$$
If the force is conservative, which is obviously the case here, you can simply define it as a line integral along any path connecting the initial and the final point, because the integral is independent of the path connecting these points. Then you can define the integration path in any way you like. If the initial point is ##(0,0,0)## and the final point ##(-2,0,0)## you can simply choose the straight path connecting these points. Then you have
$$\vec{x}(\lambda)=(-2,0,0) \lambda, \quad \mathrm{d}_{\lambda} \vec{x}(\lambda)=(-2,0,0)$$
and thus
$$\vec{F}[\vec{x}(\lambda)] \cdot \mathrm{d}_{\lambda} \vec{x}(\lambda)=(k (-2 \lambda)^2,0,0) \cdot (-2,0,0))=-8 k \lambda^2$$
and thus
$$W=\int_0^1 \lambda \mathrm{d} \lambda \vec{F}[\vec{x}(\lambda)] \cdot \mathrm{d}_{\lambda} \vec{x}(\lambda)=-\frac{8k}{3}<0.$$
Indeed the particle moves in opposite direction of the force, and thus the work done is negative.

Another way is to calculate the potential of the force, which here obviously is
$$V(\vec{x})=-\frac{k}{3} x^3,$$
because
$$\vec{F}(\vec{x})=-\vec{\nabla} V(\vec{x})=k x^2 \vec{e}_x.$$
Now the work done is calculated readily as the potential difference
$$W_{12}=-[V(\vec{x}_2)-V(\vec{x}_1)]=-\frac{8k}{3}.$$

• I think the confusion stems from a strange use of the definition of a line integral. The savest way is to stick to the invariant definition in terms of vectors. If you want the work done on the particle given its trajectory ##\vec{x}(t)##, which defines the path along which the particle moves given the force, the work is defined simply as
$$W_{12}=\int_{t_1}^{t_2} \mathrm{d} t \dot{\vec{x}}(t) \cdot \vec{F}[\vec{x}(t)].$$
If the force is conservative, which is obviously the case here, you can simply define it as a line integral along any path connecting the initial and the final point, because the integral is independent of the path connecting these points. Then you can define the integration path in any way you like. If the initial point is ##(0,0,0)## and the final point ##(-2,0,0)## you can simply choose the straight path connecting these points. Then you have
$$\vec{x}(\lambda)=(-2,0,0) \lambda, \quad \mathrm{d}_{\lambda} \vec{x}(\lambda)=(-2,0,0)$$
and thus
$$\vec{F}[\vec{x}(\lambda)] \cdot \mathrm{d}_{\lambda} \vec{x}(\lambda)=(k (-2 \lambda)^2,0,0) \cdot (-2,0,0))=-8 k \lambda^2$$
and thus
$$W=\int_0^1 \lambda \mathrm{d} \lambda \vec{F}[\vec{x}(\lambda)] \cdot \mathrm{d}_{\lambda} \vec{x}(\lambda)=-\frac{8k}{3}<0.$$
Indeed the particle moves in opposite direction of the force, and thus the work done is negative.

Another way is to calculate the potential of the force, which here obviously is
$$V(\vec{x})=-\frac{k}{3} x^3,$$
because
$$\vec{F}(\vec{x})=-\vec{\nabla} V(\vec{x})=k x^2 \vec{e}_x.$$
Now the work done is calculated readily as the potential difference
$$W_{12}=-[V(\vec{x}_2)-V(\vec{x}_1)]=-\frac{8k}{3}.$$
What is ##\lambda## ?

##d\mathbf{l}## is the vector line segment. If we have ##d\mathbf{l} = -dx## then the question is how to set up an integral. If you choose an integral with respect to ##x##, then you use ##dx## in the integral and ensure that the order of your end points matches the path defined by ##d\mathbf{l} = -dx##.

If you use ##u = -x## so that ##du = -dx##, then ##u## runs from ##0## to ##2## in this case.

It's one or the other:

Either ##x, dx, 0, -2##

or, with ##u = -x## and ##du = -dx##

##u, du, 0, 2##
I have read your reply multiple times, but I'm not able to understand why going from ## 0 \to -2 ## doesn't imply ##d\mathbf{l} = -dx \hat i + 0 \hat j + 0\hat k## ?

The product of two minuses is a plus. What you're saying is "go ##-2## units in the negative ##x## direction" instead of either " go ##2## units in the negative ##x## direction" or "go ##-2## units in the ##x## direction ".

• $$\int_{C} \mathrm{d} \vec{x} \cdot \vec{V}(\vec{x})=\int_{\lambda_1}^{\lambda_2} \mathrm{d} \lambda \mathrm{d}_{\lambda} \vec{x}(\lambda) \cdot \vec{V}[\vec{x}(\lambda)].$$