I tried to calculate a potential function using the two major methods (by partial differentiation/integration, and by line integral). The two worked with all of the examples that I tried, but then I found one vector field that fails when I use the line integral method.
These are the photos of my calculations:
And using line integral: https://www.dropbox.com/s/79mvvasdydxdpke/line.jpg?dl=0 (this site don't work with dropbox)
My question is why there is this extra x² when a solve using line integral ? Is there a error in my calculations ? This vector field is defined everywhere (at least it seems)...By the way, the first method give the right answer.
As suggested, I wrote the equations in tex to make my question more clear. I'm trying to calculate the potential function of this vector field using the fundamental theorem for line integral.
This is the vector field:
$
\vec{f} = \begin{bmatrix}
y\cos{(x)} + 2xe^y \\
\sin{(x)} + x^2e^y -1
\end{bmatrix}
$
And the theorem :
$\int_{c} \nabla\vec{f}\cdot d\vec{r} = F(a,b) - F(a_o,b_o)$
the parametric equation is the simple as it can be:
$c_1$ = { y = 0; x = t}
$c_2$ = { y = t; x = $x_o$ }
The following calculations should be self explanatory
$\int_{c} \vec{f}\cdot d\vec{r} = \int_{c_1} \vec{f}\cdot d\vec{r} + \int_{c_2} \vec{f}\cdot d\vec{r}$
For the $c_1$ path:
$ \int_{c_1} \vec{f}\cdot d\vec{r} = \int_{0}^{x_o} (y\cos{(x)} + 2xe^y)dx + (\sin{(x)} + x^2e^y -1)dy$
$ \int_{0}^{x_o} 2t dt = t^2\big|_{0}^{x_o} = x_o^2$
For the $c_2$ path:
$\int_{c_2} \vec{f}\cdot d\vec{r} = \int_{0}^{y_o} (y\cos{(x)} + 2xe^y)dx + (\sin{(x)} + x^2e^y -1)dy$
$ = \int_{0}^{y_o} \sin{(x_o) + x_o^2e^t - 1} dt = \big[ t\sin{(x_o)} + x_o^2e^t - t \big]_{0}^{y_o}$
$ = y_o\sin{(x_o)} + x_o^2e^{y_o} - y_o$
And finally:
$ \int_{c} \vec{f}\cdot d\vec{r} = x_0^2 + y_o\sin{(x_o)} + x_o^2e^{y_o} - y_o = F(x_o,y_o) - F(0,0)$
$ F(x,y) = y\sin{(x)} + x^2e^y - y + x^2 $
The final result give one extra x² that shouldn't have. I rewrote this and still was unable to spoil my mistake. WHERE IS IT ? Can someone point it to me ?