Let f(x,y) be any function of two variables and assume that x and y are themselves functions of some variable, t. Then we could write f as a function of the single variable t and, by the chain rule, [itex]df/dt= (\partial f/\partial x) dx/dt+ (\partial f/\partial y)dy/dt[/itex]. In terms of "differentials" that is [itex]df= (\partial f/\partial x)dx+ (\partial f/\partial y)dy[/itex].
An expression of the form [itex]M(x,y)dx+ N(x,y)dy[/itex] is an "exact differential" if and only if there exist a function f such that [itex]\partial f/\partial x= M(x, y)[/itex] and [itex]\partial f/\partial y= N(x, y)[/itex]. Of course, if that is true, we have [itex]\partial M/\partial y= \partial^2 f/\partial x\partial y[/itex] and [itex]\partial N/\partial x= \partial^2 f/\partial y\partial x[/itex]. But those "mixed second partial derivatives" must be equal so to be an "exact differential" we must have [itex]\partial M/\partial y= \partial N/\partial x[/itex]
Here, [itex]N= x^2- y^2[/itex] so that [itex]\partial N/\partial x= 2x[/itex]. We must have [itex]\partial M/\partial y= 2x[/itex] so that, integrating with respect to y while holding x constant, we have [itex]M= 2xy+ f(x)[/itex]. "f(x)" is the constant of integration- since we integrate with respect to y while holding x constant, that "constant of integration" can be any function of x.