differentiation under the integral sign
The technique of differentiation^{} under the integral sign concerns the interchange of the operation^{} of differentiation with respect to a parameter with the operation of integration over some other variable:
$$\frac{\partial}{\partial x}{\int}_{\mathrm{\Omega}}f(x,\omega )\mathit{d}\omega ={\int}_{\mathrm{\Omega}}\frac{\partial}{\partial x}f(x,\omega )\mathit{d}\omega .$$ 
Intuitively, the rule ought to work because differentiation commutes with finite summation, and one may conjecture that it can also commute with infinite^{} summation (in the form of the integral^{}), at least in some cases.
The theorems below give some sufficient conditions, in increasing generality and sophistication, for which the swap of differentiation and integration is legal.
Formal statements
Theorem 1 (Elementary Calculus version).
Let $f\mathrm{:}\mathrm{[}a\mathrm{,}b\mathrm{]}\mathrm{\times}Y\mathrm{\to}\mathrm{R}$ be a function^{}, with $\mathrm{[}a\mathrm{,}b\mathrm{]}$ being a closed interval^{}, and $Y$ being a compact subset^{1}^{1}Assumed to be Jordanmeasurable if the Riemann integral is to be used. of ${\mathrm{R}}^{n}$. Suppose that both $f\mathit{}\mathrm{(}x\mathrm{,}y\mathrm{)}$ and $\mathrm{\partial}\mathit{}f\mathit{}\mathrm{(}x\mathrm{,}y\mathrm{)}\mathrm{/}\mathrm{\partial}\mathit{}x$ are continuous^{} in the variables $x$ and $y$ jointly. Then ${\mathrm{\int}}_{Y}f\mathrm{(}x\mathrm{.}y\mathrm{)}dy$ exists as a continuously differentiable function of $x$ on $\mathrm{[}a\mathrm{,}b\mathrm{]}$, with derivative^{}
$$\frac{d}{dx}{\int}_{Y}f(x,y)\mathit{d}y={\int}_{Y}\frac{\partial}{\partial x}f(x,y)\mathit{d}y.$$ 
Theorem 1 is the formulation of integration under the integral sign that usually appears in elementary Calculus texts. Unfortunately, its restriction^{} that $Y$ must be compact can be quite severe for applications: e.g. integrals over $(\mathrm{\infty},+\mathrm{\infty})$ are not included. Theorem 2 below addresses this problem and others:
Theorem 2 (Measure theory version).
Let $X$ be an open subset of $\mathrm{R}$, and $\mathrm{\Omega}$ be a measure space^{}. Suppose $f\mathrm{:}X\mathrm{\times}\mathrm{\Omega}\mathrm{\to}\mathrm{R}$ satisfies the following conditions:

1.
$f(x,\omega )$ is a Lebesgueintegrable function of $\omega $ for each $x\in X$.

2.
For almost all $\omega \in \mathrm{\Omega}$, the derivative $\partial f(x,\omega )/\partial x$ exists for all $x\in X$.

3.
There is an integrable function $\mathrm{\Theta}:\mathrm{\Omega}\to \mathbb{R}$ such that $\left\partial f(x,\omega )/\partial x\right\le \mathrm{\Theta}(\omega )$ for all $x\in X$.
Then for all $x\mathrm{\in}X$,
$$\frac{d}{dx}{\int}_{\mathrm{\Omega}}f(x,\omega )\mathit{d}\omega ={\int}_{\mathrm{\Omega}}\frac{\partial}{\partial x}f(x,\omega )\mathit{d}\omega .$$ 
Theorem 2 suffices for many applications, but using the Fundamental Theorem of Calculus for Lebesgue integration, we can weaken the hypotheses for differentiating under the integral sign even further:
Theorem 3.
Let $X$ be an open subset of $\mathrm{R}$, and $\mathrm{\Omega}$ be a measure space. Suppose that a function $f\mathrm{:}X\mathrm{\times}\mathrm{\Omega}\mathrm{\to}\mathrm{R}$ satisfies the following conditions:

1.
$f(x,\omega )$ is a measurable function^{} of $x$ and $\omega $ jointly, and is integrable over $\omega $, for almost all $x\in X$ held fixed.

2.
For almost all $\omega \in \mathrm{\Omega}$, $f(x,\omega )$ is an absolutely continuous function of $x$. (This guarantees that $\partial f(x,\omega )/\partial x$ exists almost everywhere.)

3.
$\partial f/\partial x$ is “locally integrable” — that is, for all compact intervals $[a,b]$ contained in $X$:
$$
Then ${\mathrm{\int}}_{\mathrm{\Omega}}f\mathit{}\mathrm{(}x\mathrm{,}\omega \mathrm{)}\mathit{}\mathit{d}\omega $ is an absolutely continuous function of $x$, and for almost every $x\mathrm{\in}X$, its derivative exists and is given by
$$\frac{d}{dx}{\int}_{\mathrm{\Omega}}f(x,\omega )\mathit{d}\omega ={\int}_{\mathrm{\Omega}}\frac{\partial}{\partial x}f(x,\omega )\mathit{d}\omega .$$ 
If the KurzweilHenstock integral — which has a stronger Fundamental Theorem of Calculus^{} (http://planetmath.org/FundamentalTheoremOfCalculusForKurzweilHenstockIntegral) — is used in place of the Lebesgue integral, Theorem 3 can be generalized to a formulation that provides also the necessary conditions for differentiation under the integral sign. See [Talvila] for the full details.
Yet this is not the end of the story. There are some applications in which the integrand is too “irregular”, or the integral of the differentiated integrand becomes divergent, and neither Theorem 2 or Theorem 3 would apply. However, if we use generalized functions (all of which can be differentiated at will), then we can extend the technique of differentiation under the integral sign further, and make sense of any “irregular” integrals that may result:
Theorem 4 (Distribution theory version).
Let $X$ be an open set in ${\mathrm{R}}^{m}$, and $\mathrm{\Omega}$ be a measure space. Given $f\mathit{}\mathrm{(}x\mathrm{,}\omega \mathrm{)}$, for each $\omega \mathrm{\in}\mathrm{\Omega}$, a generalized function of $x\mathrm{\in}X$ (in the sense of Schwartz’s theory of distributions^{}), define:
$$\u27e8{\int}_{\mathrm{\Omega}}f(\cdot ,\omega )\mathit{d}\omega ,\varphi \u27e9:={\int}_{\mathrm{\Omega}}\u27e8f(\cdot ,\omega ),\varphi \u27e9\mathit{d}\omega ,\varphi \in \mathcal{D}(X).$$ 
Assume the above integral is welldefined and gives a distribution. Then
$$\frac{\partial}{\partial {x}_{i}}{\int}_{\mathrm{\Omega}}f(x,\omega )\mathit{d}\omega ={\int}_{\mathrm{\Omega}}\frac{\partial}{\partial {x}_{i}}f(x,\omega )\mathit{d}\omega .$$ 
where $\mathrm{\partial}\mathrm{/}\mathrm{\partial}\mathit{}{x}_{i}$ refers to the generalized derivative of generalized functions on both sides of the equation.
For an absolutely continuous function, the generalized derivative coincides with the ordinary derivative, so Theorem 4 indeed generalizes Theorem 3. On the other hand, there are cases where the integrand is not absolutely continuous^{} — and so has a generalized derivative different from the ordinary derivative — yet its integral has a classical derivative that is represented by the final equation of Theorem 4. For instance, the integrand may involve a step function^{}, and its derivative would thus involve a Dirac delta distribution, that when integrated, yields an ordinary locallyintegrable function (of the parameter $x$).
Other variations
There are other frequentlyused variations of the theorems above.
Moving domains of integration. Not only can the integrand vary with the parameter, we can consider domains of integration, subsets of ${\mathbb{R}}^{n}$, that vary with the parameter.
In the onedimensional case, for continuously differentiable functions $\alpha :[a,b]\to \mathbb{R}$, $\beta :[a,b]\to \mathbb{R}$, and $f:[a,b]\times \mathbb{R}\to \mathbb{R}$, we have:
$$\frac{d}{dx}{\int}_{\alpha (x)}^{\beta (x)}f(x,y)\mathit{d}y={\int}_{\alpha (x)}^{\beta (x)}\frac{\partial f(x,y)}{\partial x}\mathit{d}y+\frac{d\beta (x)}{dx}f(x,\beta (x))\frac{d\alpha (x)}{dx}f(x,\alpha (x)).$$ 
This result can be extrapolated from Theorem 1, with the help of the Fundamental Theorem of Calculus and the multivariate chain rule^{} (http://planetmath.org/ChainRuleSeveralVariables).
Generalizations^{} to varying smooth surfaces or volumes — or, more generally, $k$dimensional differentiable manifolds in ${\mathbb{R}}^{n}$ — can be obtained by using integrals of differential forms^{} on chains (http://planetmath.org/NChain), and Stokes’ Theorem. Details can be found in [Flanders].
Different types of integrals. The differentiation can also be taken under integrals other than of the standard Riemann type, such as the line integrals^{} and surface integrals of vector calculus, or complex contour integrals. (Actually, these kinds of integrals can be reformulated as Lebesgue integrals, so Theorem 2 applies to them.)
Complex variables. Other applications require differentiating holomorphic functions^{} with respect to a complex variable, and Theorem 2 generalizes directly to this situation, without requiring differentiation with respect to real variables as an intermediary.
References
 Flanders Harley Flanders. “Differentiation under the Integral Sign”. American Mathematical Monthly, vol. 80 (JuneJuly 1973), p. 615627.
 Folland Gerald B. Folland. Real Analysis: Modern Techniques and Their Applications, second ed. WileyInterscience, 1999.
 Jones D. S. Jones. The Theory of Generalized Functions, second ed. Cambridge University Press, 1982.
 Munkres James R. Munkres. Analysis on Manifolds. Westview Press, 1991.
 Schwartz Laurent Schwartz. Théorie des Distributions, vol. I. Hermann, 1957.
 Talvila Erik Talvila. “http://www.math.ualberta.ca/ etalvila/papers/difffinal.pdfNecessary and Sufficient Conditions for Differentiating Under the Integral Sign”. American Mathematical Monthly, vol. 108 (JuneJuly 2001), p. 544548.
The author of this entry has also written an exposition, “http://goldsaucer.afraid.org/math/diffint/diffint.pdfDifferentiation under the Integral Sign using Weak Derivatives”, containing a proof of Theorem 4 along with detailed computational examples.
Title  differentiation under the integral sign 
Canonical name  DifferentiationUnderTheIntegralSign 
Date of creation  20130322 16:26:37 
Last modified on  20130322 16:26:37 
Owner  stevecheng (10074) 
Last modified by  stevecheng (10074) 
Numerical id  16 
Author  stevecheng (10074) 
Entry type  Topic 
Classification  msc 46F10 
Classification  msc 28A25 
Classification  msc 26B15 
Classification  msc 26A24 
Synonym  Leibniz’s rule 
Related topic  DerivativeOfRiemannIntegral 
Related topic  IntegrationUnderIntegralSign 
Related topic  HolomorphicFunctionAssociatedWithContinuousFunction 