I'm learning about differential equations from YouTube, so bear with me if this is trivial. When we have an exact equation,
$$P(x,y)+\frac{dy}{dx}Q(x,y)=0$$
To solve, we need to find the potential function $F$ with gradient $\langle P, Q \rangle$. Then the solution is $F(x,y)=C$.
My question is why?