For the method of finding a potential function of a conservative vector field, usually I would let $\nabla \phi$ be equal to the vector field, and do some integration (indefinite) and differentiating whilst equating it to other components of $\nabla \phi$. However, in this youtube video (at 11:47), the technique was to do a definite integral twice, over some random path. Where could I learn this method and why does this work?
The question is to find the potential scalar field for the conservative vector field:
$$F = \begin{pmatrix} x \\ y \end{pmatrix} r^{n},\qquad \text{with $r = \sqrt{x^2 + y^2}$}$$
The method in the video found the potential vector field by evaluating the following integral:
$$\int_{1}^{y_1} (1+y_1 ^2)^{\frac{n}{2}} y_1\, \mathrm{d}y + \int_{1}^{x_1} (x_1 + y_1)^{\frac{n}{2}} x\, \mathrm{d}x.$$
Glossing over some fine points, the underlying idea is as follows: Choose a point $\mathbf x_0$ in the domain of the conservative vector field $\mathbf F$ and define $\phi:\mathbf x\mapsto\int_{\Gamma(\mathbf x)}\mathbf F$, where $\Gamma(\mathbf x)$ is a piecewise smooth path from $\mathbf x_0$ to $\mathbf x$. The value of hits integral is independent of the choice of $\Gamma(\mathbf x)$, so $\phi$ is well-defined. It’s a fairly straightforward exercise to prove that $\mathbf F=\nabla\phi$. The scalar potential $\phi$ is determined up to a constant; choosing a different point for $\mathbf x_0$ amounts to changing this constant of integration.
In practice, one often chooses the origin for $\mathbf x_0$ and a straight line segment with the obvious parameterization for $\Gamma$ so that the integral is evaluated from $0$ to $1$, but you can choose any convenient path from the fixed starting point to $\mathbf x$. It would appear that in this video the integral is taken along the path that consists of the line segment from $(1,1)$ to $(1,y_1)$ and the line segment from there to $(x_1,y_1)$.