# How to move differentation before the integral?

I have quite a lot expressions that need to be integrated after switching the integral sign with differentation operator. The additional problem is that the bounds are dependent to one of the variables. So I need to use:

$\int_{a(y)} ^{b(y)} {\frac{\partial f(x,y)}{\partial y}}=\frac{\partial}{\partial y} \int_{a(y)} ^{b(y)} f(x,y) dx- \frac{db}{dy}f(x=b,y)+\frac{da}{dy}f(x=a,y)$

How do I achieve this in Mathematica? For now Mathmatica just writes output:

Integrate[D[f[x, y], y], {x, a[y], b[y]}]


in the symbolic form. How do I workaround this? Of course I can write my own function, but I wonder iw Mathematica has some built in functionality I require.

Regards

-
Does a replacement rule work? (your expression) /. HoldPattern[Integrate[D[e_, y_], {x_,a_,b_}]]:>D[Integrate[e,{x,a,b}],y]-D[b,y](e/.x->b)+D[a,y](e/.x->a) –  celtschk Sep 14 '12 at 9:26
Probably it does. I just wondered if there is some kind of function implementing this theorem. –  Misery Sep 14 '12 at 10:01
I am not sure if this is relevant to your question,but Mma does use the Leibniz rule: when you evaluate D[Integrate[f[x, y], {x, a[y], b[y]}], y] you get Integrate[Derivative[0, 1][f][x, y], {x, a[y], b[y]}] - f[a[y], y]*Derivative[1][a][y] + f[b[y], y]*Derivative[1][b][y]. –  kguler Sep 14 '12 at 10:41
Well, it looks like my doesn't :] Or better... sometimes it does tometimes it doesn't <?> Ok, now I get it, it does so only in one direction. –  Misery Sep 14 '12 at 10:49