I have a question about this integral with a Dirac delta
$$ \displaystyle \int_{-\infty}^{+\infty} \delta'(x-3)e^{x^2}dx $$
by integration by parts I get;
$$ \displaystyle \delta(x-3)e^{x^2}\biggr\rvert_{-\infty}^{+\infty} – 2\int_{-\infty}^{+\infty} \delta(x-3)xe^{x^2}dx = -2(3e^{3^2})= -6e^{9}$$
My question is:
Why is the first term $= 0$?
What I Think is $\delta(\infty)= 0$, but $\delta(\infty)\cdot e^{\infty}=$ ?
PRIMER ON THE DIRAC DELTA AS A GENERALIZED FUNCTION
The Dirac Delta and the Unit Doublet (the so-called “derivative” of the Dirac Delta) are not functions. Rather, they are Generalized Functions, also known as Distributions.
Distributions are linear Functionals that map test functions (smooth functions) into numbers, whereas a function maps numbers into numbers. For the Dirac Delta, the functional definition is given as
$$\langle f,\delta_a\rangle =f(a) \tag 1$$
where $f$ is a suitable test function.
Now, in practice, we often write the functional notation in $(1)$ formally as
$$\langle f,\delta_a\rangle=\int_{-\infty}^{\infty}f(x)\delta(x-a)\,dx \tag 2$$
But the object on the right-hand side of $(2)$ is actually not an integral. And the evaluation of $\delta (x-a)$ as a function is meaningless. In practice, we often see the Dirac Delta defined at points by
$$\delta(x)=\begin{cases}0&,x\ne 0\\\\\infty&,x=0\end{cases}$$
but this is obvious nonsense. Rather, the interpretation here can be made physical through a regularization of the Dirac Delta wherein there is a family of functions $\delta_n(x)$ for which
$$\lim_{n\to \infty}\delta_n(x)=
\begin{cases}
0&, x\ne 0\\\\
\infty&,x=0\end{cases}$$
and
$$\lim_{n\to \infty}\int_{-\infty}^\infty f(x)\delta_n(x-a)\,dx=f(a)$$
for all suitable test functions $f$. We can formally write this regularization of the delta function as
$$\delta(x)\sim\lim_{n\to \infty}\delta_n(x)$$
Therefore, we interpret the integral notation for the functional relationship in $(2)$ as
$$\int_{-\infty}^{\infty} f(x) \delta(x-a)\,dx=\lim_{n\to \infty}\int_{-\infty}^\infty f(x)\delta_n(x-a)\,dx$$
For more on the Dirac Delta, see THIS ANSWER, THIS ONE, THIS ONE, and THIS ONE.
THE UNIT DOUBLET AS A GENERALIZED FUNCTION
The Unit Doublet $\delta’$ is defined as in terms of the Dirac Delta as
$$\langle f,\delta_a’\rangle=-\langle f’,\delta_a\rangle=-f'(a)$$
It is, therefore, a functional that maps a test function $f$ into $-f’$. We can formally, write
$$\langle f,\delta_a’\rangle=\int_{-\infty}^{\infty}f(x)\delta'(x-a)\,dx=-\int_{-\infty}^{\infty}f'(x)\delta(x-a)\,dx=-f'(a)$$
and proceed heuristically as with the Dirac Delta. Note that if $f(x)=e^{x^2}$ and $a=3$, we have immediately that
$$\langle e^{x^2},\delta’_3\rangle =-\left.\frac{de^{x^2}}{dx}\right|_{x=3}=-6e^9$$
Using the shifting property $f(x) \, \delta(x-a) = f(a) \, \delta(x-a)$ then
\begin{align}
\int \delta^{\prime}(x-a) \, f(x) \, dx &= \left[ f(x) \, \delta(x-a) \right] – \int \delta(x-a) \, f^{\prime}(x) \, dx \\
&= \left[ f(a) \, \delta(x-a) \right] – f^{\prime}(a)
\end{align}
For the case of $f(x) = e^{x^2}$ then $f^{\prime}(x) = 2 \, x \, e^{x^2}$. For the limits $(-\infty, \infty)$ the $\delta$ function is zero at the end points being evaluated. Now,
\begin{align}
\int_{-\infty}^{\infty} \delta^{\prime}(x-a) \, e^{x^{2}} \, dx &= \left[ e^{a^{2}} \, \delta(x-a) \right]_{-\infty}^{\infty} – 2 \, a \, e^{a^{2}} \\
&= – 2 \, a \, e^{a^{2}}.
\end{align}
Shifting property:
$$ \int \delta(x-a) \, f(x) \, dx = f(a) = \int f(a) \, \delta(x-a) \, dx $$
or
$$ \int \left[ f(x) \, \delta(x-a) – f(a) \, \delta(x-a) \right] \, dx = 0.$$
In order for the general integral to have a zero result then the integrand must be zero which leads to
$$f(x) \, \delta(x-a) = f(a) \, \delta(x-a)$$
The best way to study the Dirac function is in the context of measures or distributions, but if you are willing to accept as a definition for $\delta $ the functional equation
$\tag1\int_{x_{0}-\epsilon}^{x_{0}+\epsilon}f(x)\delta (x-x_{0})dx=f(x_{0}),\quad \forall \epsilon>0$ then it follows easily that
$\tag2\int_{-\infty}^{\infty}f(x)\delta’ (x-x_{0})dx=-\int_{-\infty}^{\infty}\frac{d f(x)}{d x}\delta (x-x_{0})dx$
so with $f(x)=e^{x^{2}}$, you get, using $(1)$ and $(2)$,
$\tag3\displaystyle \int_{-\infty}^{+\infty} \delta'(x-3)e^{x^2}dx=-6e^9$
The simple answer is that the $\delta(x-3)$ and all its derivatives are supported at $x=3$. Even if the integral were
$$
\begin{align}
\int_2^4\delta'(x-3)e^{x^2}\,\mathrm{d}x
&=\left[\delta(x-3)e^{x^2}\right]_2^4-\int_2^4\delta(x-3)2xe^{x^2}\,\mathrm{d}x\\
&=0-6e^9
\end{align}
$$
the boundary terms vanish. That is, away from $x=3$, $\delta(x-3)$ can be represented by the zero function.
From Comments
A.S. mentions that $e^{x^2}$ does not have the proper decay at $\infty$ to be a standard test function. However, $\delta’$ has compact support, i.e. $\{0\}$, and a test function applied to such a distribution can be modified outside the compact support and not alter the value obtained.
So to be technically correct, we should write the integral as
$$
\int_{-\infty}^\infty\varphi(x-3)\delta'(x-3)e^{x^2}\,\mathrm{d}x
$$
where $\varphi\in C_C^\infty$, $\varphi(x)=1$ on a neighborhood of $\{0\}$. Then $\varphi(x-3)\delta'(x-3)=\delta'(x-3)$. Furthermore, $\varphi(x-3)e^{x^2}$ is a standard test function.
The expression written is ill-defined, but look at the improper integral as the limit
$$
\int_{-\infty}^{\infty} \delta ‘(x-3) e^{x^2} dx = \lim_{L, \Lambda \to \infty}\int_{-\Lambda}^{L}
\delta ‘(x-3)e^{x^2} dx \\ =\lim_{L, \Lambda \to \infty}\left( \delta (x-3) e^{x^2}\biggr\rvert_{-\Lambda}^{+L} – 2 \int_{-\Lambda}^{L} \delta (x-3)xe^{x^2}dx \right) = -6e^{9}
$$
And for $L$ large enough, $L>3$, we can be sure that the first term vanishes when evaluated on the limits, before taking the limits, hence the result you have follows from the remaining term
Here is a brief comment on the previous answers: Let $X \subset \Bbb{R}^d$ be open. Then
Distributions are elements of $\mathcal{D}'(X)$, where $\mathcal{D}'(X)$ is the dual of $C_c^{\infty}(X)$ equipped with a suitable topology.
$\mathcal{E}'(X)$ is the dual of $C^{\infty}(X)$ equipped with a suitable topology.
There is a natural way of identifying $\mathcal{E}'(X)$ as the space of compactly supported distributions. Consequently, people are often sloppy about making a clear distinction between these two notions.
In this problem, derivatives of $\delta$ are compactly supported and thus the problem leads us to two different interpretation:
The problem does not make sense when $\delta’$ is understood merely as distribution.
It does make sense when $\delta’$ is understood as an element of $\mathcal{E}'(\Bbb{R})$. Then the integral can be computed as @robjohn pointed out: introduce any cut-off function $\varphi \in C_c(\Bbb{R})$ such that $\varphi \equiv 1$ near $3$ and then replace $e^{x^2}$ by $e^{x^2}\varphi(x)$.