Is that really how you were taught? It will work but that "look for similar features" looks ambiguous to me.
In fact, in this particular problem, it is impossible to find such a \phi. It simply cannot exist.
Recall that (for "nice" functions, having continuous second derivatives as this does) the order of differentiation in mixed derivatives is irrelevant. That is \frac{\partial}{\partial x}\left(\frac{\partial\phi}{\partial z}\right)= \frac{\partial}{\partial z}\left(\frac{\partial\phi}{\partial x}\right)
But if \frac{\partial \phi}{\partial x}= yz then \frac{\partial}{\partial z}\left(\frac{\partial\phi}{\partial x}\right)= y while if \frac{\partial \phi}{\partial z}= xy+ 3x^2 then
\frac{\partial}{\partial x}\left(\frac{\partial\phi}{\partial z}\right)= y+ 6x.
Those are NOT the same so this is impossible. If that "3x^2" in the derivative with respect to z were "3z^2" then it would be possible.
Here's how I would do it.
From \dfrac{\partial \phi}{\partial x}= yz, yes we have \phi(x,y,z)= xyz+ u(y, z) where u(y,z) (your "C_x") is a function of y and z only (constant with respect to x). Differentiating that with respect to y we have
\dfrac{\partial\phi}{\partial y}= xz+ \dfrac{\partial u}{\partial y}
But we are told that \dfrac{\partial \phi}{\partial y}= xz so we must have xz+ \dfrac{\partial u}{\partial y}= xz. The "xz" terms cancel leaving \dfrac{\partial u}{\partial y}= 0 so that u does NOT, in fact, depend on y and we can write \phi(x, y, z)= xyz+ u(z). That is, we now know that u can only depend on z. Differentiating that with respect to z we get \frac{\partial\phi}{\partial z}= xy+ \frac{\partial u}{\partial z}.
But we are told that \dfrac{\partial \phi}{\partial z}= xy+ 3z^2. So we must have xy+ \frac{du}{dz}= xy+ 3z^2. The "xy" terms now cancel leaving \frac{du}{dz}= 3z^2. (I can now write "ordinary" derivatives because I know that u depends on z only.) That gives u(z)= z^3 so that \phi(x,y,z)= xyz+ u= xyz+ z^3.
If that "xy+ 3x^2" were, in fact, correct, here is what would happen. We would repeat everything up to the last paragraph which would now be:
" But we are told that \dfrac{\partial \phi}{\partial z}= xy+ 3x^2. So we must have xy+ \dfrac{du}{dz}= xy+ 3z^2. The "xy" terms now cancel leaving \dfrac{du}{dz}= 3x^2. That is impossible- if u is a function of z only, its derivative cannot be a function of x. There is no \phi(x,y,z) having those partial derivatives.