[Math] Calc of potential function using line integral

integrationmultivariable-calculusordinary differential equationsVector Fields

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:

enter image description here

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 ?

Best Answer

$$y\cos x+2xe^y+(\sin x+x^2e^y-1)y'=0$$

$\left(y\sin(x)+x^2e^y \right)'=y\cos(x)+2xe^y+\sin(x)y'+x^2e^yy'$ $$\left(y\sin(x)+x^2e^y \right)'-y'=0$$ Integrate : $$\left(y\sin(x)+x^2e^y \right)-y=C$$ This is the solution of the ODE expressed on the form of implicit equation.

You found :$\quad y\sin(x)+x^2e^y-y=\varphi$

This is correct with $\varphi=$constant.

In order to get the explicit solution we have to solve the equation for $y$. A closed form cannot be obtained with the elementary functions. A special function is required, the Lambert W function. http://mathworld.wolfram.com/LambertW-Function.html

$$y(x)=\frac{C}{\sin(x)-1}-W(X)\qquad\text{with}\qquad X=\frac{x^2\exp(\frac{C}{\sin(x)-1})}{\sin(x)-1}$$

I suppose that was not the expected form if it is a textbook exercise. The above implicit form of solution is probably sufficient.

ADDITION after the comments (the term that you forgot is written in red) :

$\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 \color{red}{-x_0^2}$

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 \color{red}{-x_0^2}= F(x_o,y_o) - F(0,0)$

$ F(x,y) = y\sin{(x)} + x^2e^y - y $

Related Question