Let $F:\mathbb{R}^2\rightarrow\mathbb{R}^2$ be the following vector field: $$F(x,y)=\left< x\cdot p(x,y(x)), y(x)\cdot p(x,y(x))\right>$$
where
$$p(x,y(x)) = \frac{5x}{6} + \frac{7 x^2}{4} + \frac{5 y(x)}{6} + 15 x y(x) - 25 x^2 y(x) + \frac{7 y(x)^2}{4} - 25 x y(x)^2 + \frac{129 x^2 y(x)^2}{4}$$
$F$ is not conservative. So the line integral $\int_C F\cdot dr$ is not path independent, where $C$ is any path from $(0,0)$ to a given point $(a,b)\in[0,1]^2$. I'd like to find the path that minimizes this line integral. Should be an easy problem! But I've never really worked with the calculus of variations. And I'm making a mistake somewhere. Here's how I think I'm meant to approach the problem. First, choose a simple parameterization of $C$ in order to turn our line integral of the vector field $F$ into a line integral of a scalar field.
$$\int_0^a \left< x\cdot p(x,y(x)), y(x)\cdot p(x,y(x))\right> \cdot \left<1,y^\prime(x)\right> dx = \int_0^a x\cdot p(x,y(x)) +y(x)\cdot y^\prime(x)\cdot p(x,y(x)) dx$$
where $y(0)=0$ and $y(a)=b$. Let $L(y(x),y^\prime(x),x)=x p(x,y(x))+y(x)y^\prime(x)p(x,y(x))$.
So
$$\frac{\partial L}{\partial y(x)} = x \frac{\partial p}{\partial y(x)} + y^\prime(x)p(x,y(x)) + y(x) y^\prime(x) \frac{\partial p}{\partial y(x)}$$
$$\frac{\partial L}{\partial y^\prime (x)} = y(x) p(x,y(x))$$
$$\frac{d}{dx} (\frac{\partial L}{\partial y^\prime(x)}) = y^\prime(x)p(x,y(x)) + y(x)(\frac{\partial p}{\partial x} + y^\prime(x)\frac{\partial p}{\partial y(x)})$$
Hence
$$\frac{\partial L}{\partial y(x)} - \frac{d}{dx} (\frac{\partial L}{\partial y^\prime(x)}) = x \frac{\partial p}{\partial y(x)} - y(x) \frac{\partial p}{\partial x}$$
And $$p(x,y(x)) = \frac{5x}{6} + \frac{7 x^2}{4} + \frac{5 y(x)}{6} + 15 x y(x) - 25 x^2 y(x) + \frac{7 y(x)^2}{4} - 25 x y(x)^2 + \frac{129 x^2 y(x)^2}{4}$$
So
$$\frac{\partial p}{\partial y(x)} = \frac{5}{6} + 15 x - 25 x^2 + \frac{7 y(x)}{2} - 50 x y(x) + \frac{129 x^2 y(x)}{2}$$
And
$$\frac{\partial p}{\partial x} = \frac{5}{6} + \frac{7 x}{2} + 15 y(x) - 50 x y(x) - 25 y(x)^2 + \frac{129 x y(x)^2}{2}$$
Simplifying we get
$$x \frac{\partial p}{\partial y(x)} - y(x) \frac{\partial p}{\partial x} = \frac{1}{6} (x - y(x)) (5 + 30 (3 - 5 x) x + 3 y(x) (30 + 3 x (-50 + 43 x) + (-50 + 129 x) y(x)))$$
(This is precisely what Mathematica gives back to me too.) Unfortunately, $y^\prime(x)$ does not appear in our Euler-Lagrange equation. So solving for $y(x)$ does not introduce any constants that we can fix to ensure that $y(0)=0$ and $y(a)=b$.
At first I thought I saw my mistake. I was implicitly assuming that that $0\leq y(x)\leq b$. These are really the only curves I'm interested in. Perhaps there's no global minimum, and that's what my result is reflecting. But our line integral must nonetheless take a local minimum on the compact space of curves with $0\leq y(x)\leq b$. So maybe I need to use a slack function to ensure that this inequality is satisfied.
But I run into the same sort of problem when I use a slack function to do the analogous constrained optimization problem. I must be mucking up something more basic.
Any advice that might help me stop spinning my wheels would be absolutely lovely!