I have a function $f(x,y)$, where both $x$ and $y$ are $n$-dimensional vectors, $n\ge 2$. I know that this function has the following property: $$ \frac{\partial}{\partial x_j} \frac{\partial}{\partial y_k} f = a_j(x,y) b_k(x,y) $$ This can be expressed saying that the $n\times n$ block of the Hessian, out of diagonal, is a diadyc matrix. Examples of such a $f$ are: $$ f(x,y) = A(x)B(y) + C(x) + D(y) $$ Actually, this example is similar to the form used in the "separation of variables" method for solving partial differential equations.
The second equation implies the first. My question is: is it also true that the first equation implies the second? Or a counter-example can be found?