I know divergence of a vector function $v(x,y) = P(x,y)i + Q(x,y)j $ is given by $\frac{\delta P(x,y)}{\delta x} + \frac{\delta Q(x,y)}{\delta y}$. I am really confused by the fact that while calculating divergence we partially differentiate $P(x,y,x)$ with respect to $x$ and not with respect to $y$, even though it depends on $y$. Same goes for $Q(x,y)$ as it is partially differentiated with respect to $y$ and not with respect to $x$ even though it depends on it.
I got confused while watching the multivariable calculus series on KHAN ACADEMY where Grant(from 3blue1brown) talks about divergence in terms of the above formula.
The divergence is not concerned with how every component of the output vector depends on every component of the input vector. The divergence only cares how each component of the output depends on the corresponding component of the input, I.e. how P, the horizontal component of the output depends on x, the horizontal component of the input.
If an application requires that we know something about how the horizontal component depends on the vertical component, or something like that, then we need a different tool, the divergence doesn’t do that.