# How to solve this partial differential equation for $f$?

I want Mathematica to solve for the function $$f$$.

$$f$$ satisfies the following constraints.

$$\frac{\partial}{\partial x} f(x,y) = y$$

$$\frac{\partial}{\partial y} f(x,y) = x$$

$$f(0,0)=0$$

It would seem obvious that $$f(x,y) = x y$$

Yet I cannot coax Mathematica into returning this result.

Here is my attempt. Mathematica just returns it unevaluated. What am I missing?

DSolve[
{
x == D[f[x, y] , y]
, y == D[f[x, y] , x]
, f[0, 0] == 0
}

, {f[x, y], f[x, y]}
, {x, y}
]

• A partial differential equations needs more than a pointwise condition f[0,0]==0 I think. But Mathematica can't solve with modified conditions f[x,0]==0,f[0,y]==0either. – Ulrich Neumann Aug 19 at 8:58
• The following does the trick: DSolve[Grad[f[x, y], {x, y}] == {y, x}, f[x, y], {x, y}] - It seems that DSolve wants a single differential equation instead of separate ones, even if that "single" differential equation is just one with several components – Lukas Lang Aug 19 at 9:18
• Alternative DSolve[{1 == Derivative[1, 1][f][x, y] }, f[x, y], {x, y}] – Ulrich Neumann Aug 19 at 9:21

Strangely the solver works when the derivative is on the left hand side of the equals sign.

DSolve[
{
D[f[x, y] , y] == x
, D[f[x, y] , x] == y
}

, {f[x, y], f[x, y]}
, {x, y}
]


Although I am rather partial to @Lukas Lang's gradient form which I am also pasting here for my future self's convenience.

DSolve[

Grad[f[x, y], {x, y}] == {y, x}

,f[x, y]
, {x, y}
]

• Interestingly, DSolve[{y, x} == Grad[f[x, y], {x, y}], f[x, y], {x, y}] also returns unevaluated. DSolve seems particularly fickle, when attempting to solve pairs of linear, inhomogeneous PDEs. – bbgodfrey Aug 19 at 18:01