No her I'm using f for the potential fn and d/dx etc are partial derivatives

in your first integration f = xyz + h(y,z) not yz

df/dy = xz + dh/dy = xz +z

h = yz + g(z)

f= xyz + yz +g(z)

df/dz = xy+y +g ' (z) = xy + y -1

g(z) = -z

f= xyz + y z - z

You can always check by taking grad(f)