Solution (source code)

= Solution

Here $P_y=5=Q_x$, and direct integration constructs a global potential for this <exact differential form>. Integrate $P$ with respect to $x$ to obtain $f=6x^2+5xy-9x+g(y)$; matching $f_y=Q$ gives $g'=3y-4$. Thus
$$
\boxed{f(x,y)=6x^2+5xy-9x+\frac32y^2-4y+C.}
$$
Both derivatives recover the supplied coefficients.