# integration involving delta function

suppose I have two functions $f(x)$ and $g(y)$.I am interested in an integral $\int\int_{-\infty}^{+\infty}f(x)g(y)\frac{d}{dy}\delta(x-y)dxdy$ where $\delta(x-y)$ is the usual dirac-delta function encountered in physics.

while doing I am getting two different answers.

1. do integration by parts and transfer the derivative to $g(y)$ and neglecting the boundary terms,i get $-\int_{-\infty}^{+\infty}dxdy\delta(x-y)f(x)\frac{d}{dy}g(y)$ which is equal to $-\int_{-\infty}^{+\infty}dyf(y)\frac{d}{dy}g(y)$.

2.Since $y$ and $x$ are independant in the beginning I can transfer to $f(x)$ also right giving $\int\int_{-\infty}^{+\infty}\frac{d}{dy}(f(x)g(y))\delta(x-y)dxdy$.then apply the delta function I am getting $-\int_{-\infty}^{+\infty}dy\frac{d}{dy}(f(y)g(y))$.Here also I am neglecting the boundary terms.

Please correct me if I am doing anything stupid in both calculations.

The value obtained from $\frac{\partial}{\partial y}\left( f(x) g(y) \right)$ by plugging in $y$ for $x$ is not $\frac{\partial}{\partial y}\left( f(y) g(y) \right)$.