I have heard the comparison between line integrals and work, so how would I minimize a line integral of two points over a non-conservative vector field (if it were conservative, the line integral would be constant). I understand something like the Euler Lagrange Equation is needed to find a function that minimizes the line integral, however I am confused as to how to set up the Lagrangian and how to evaluate the equation.
The definition of work is
$$
W = \int d\vec x \cdot \vec F = \int_{t_1}^{t_2}dt\; \dot{\vec x}\cdot \vec F
$$
So, if you are interested in minimizing the work, you can consider:
$$
L(x,\dot x, y, \dot y) = \dot x F_x(x,y) + \dot y F_y(x,y)
$$
Take the following example:
Find a function that minimizes the absolute value of the line integral between (-1, 2) to (2, 8) over the vector field $F=\langle y^2 \cos(x), \sin(xy)\rangle$.
This is not the same type of question that you asked about above. Above you asked how to minimize the work, which is not the absolute value of the line integral.
Making it the absolute value rather than the value of the integral changes the problem. Clearly the smallest that the absolute value can be is zero. But that is not necessarily the smallest that the integral can be.
Find a function that minimizes the absolute value of the line integral between (-1, 2) to (2, 8) over the vector field $F=\langle y^2 \cos(x), \sin(xy)\rangle$.
All you really have to do is find any path for which the line integral is zero. Such a path automatically minimizes the absolute value you seek.
I suggest that you try evaluating the integral for some horizontal and vertical line segment paths to get a feel for the how this might work...
Further, since you are interested in a non-conservative force, the contribution of a closed loop path is not necessarily zero. You can find a closed loop path that cancels out the contribution from any path from (-1,2) to (2,8). So you can just create a path that loops a few times and then takes a simple path from (-1,2) to (2,8).
For example, if you integrate along a straight path from (-1,2) to (2,2) and then a straight path from (2,2) to (2,8), the value of the integral is about 7. Call this "Path A"
For example, if you integrate along a looping path from (-1,2) to (-2,2) to (-2,1) to (-1,1) to (-1,2) the value of the integral is about -1. Call this "Loop A"
Therefore a path that first executes 7 iterations of Loop A followed by Path A gets you from (-1,2) to (2,8) with an integral value of about zero.
Of course, there are lots of different paths that will work. As another example, the integral along the path from (-1,2) to (-4.07542633, 2) to (-4.07542633, 8) to (2,8) is zero to the precision of a single floating point number.
In addition, this exact question was asked in a Reddit thread yesterday. See the first comment by the Reddit OP on the received answer, which poses this exact question.