A line integral along a straight segment is turned into an ordinary definite integral in three moves. Write both coordinates through one parameter, , ; replace and by and ; integrate from the value of at the starting point to the value at the finishing point. Two details decide the sign and the value. The limits follow the direction of travel - swapping the endpoints flips the sign. And when the field is not conservative, so the answer genuinely depends on the path: the fact that the path is a straight segment is part of the problem, not a convenience.
Find , where and , along the straight segment.
Both points lie on the line , so the whole segment is described by one parameter:
The path runs from to , so runs from down to - the limits keep that order.
Inside the brackets:
so the integral becomes
The minus sign is not an accident: we walked from to , that is, in the direction of decreasing . Reversing the direction would give .
Check the potential test for this field:
These are not equal, so the field is not conservative and the integral really does depend on the route. Along a different curve joining the same two points the answer would be different.
Screenshot any problem on your screen and get the steps. Chrome on a computer; free.