Examples when differentiation under the integral sign fails A particular version of Feynman's trick for integration is as follows:

Let $f(x, t)$ be a function such that both $f(x, t)$ and its partial
derivative $f_x(x, t)$ are continuous in $t$ and $x$ in some region of
the $(x, t)$-plane, including $a ≤ t ≤ b$, $x_0 ≤ x ≤ x_1$. Then, for
$x_0 ≤ x ≤ x_1$, $${\frac {d}{dx}}\left(\int _{a}^{b}f(x,t)\,dt\right)
 =\int _{a}^{b}{\frac {\partial }{\partial x}}f(x,t)\,dt. \tag{1}
$$

A more general version is in this article. I have seen lots of interesting examples solved by this technique. See for instance here.
I am curious about "counterexamples" when assumptions of this theorem are not fully satisfied. Specifically, can one come up with an example that both sides of (1) exist but the equal sign is not true?
 A: Thanks to José Carlos Santos's comment, I find this interesting related question on MathOverflow: Counterexamples to differentiation under integral sign?.
The following are two examples from two answers there.

Consider $$f(x,y) = \cases{ \text{sgn}(x) \dfrac{x^2-y^2}{x^2} & for $0 < |y| < |x|$  \cr 0 & otherwise
}$$
Then $\displaystyle \int_{-1}^1 f(x,y)\ dy = 4 x/3$ for $-1 \le x \le 1$, so $\displaystyle \frac{\partial}{\partial x} \int_{-1}^1 f(x,y)\ dy = 4/3$,
but $\dfrac{\partial f}{\partial x} (0,y) = 0$ so $\displaystyle \int_{-1}^1 \frac{\partial f}{\partial x}(0,y)\ dy = 0$.

Set
$$
f(x,y) = \begin{cases}
\frac{x^3y}{(x^2+y^2)^2}, & {\rm if} \ x \not= 0 \ {\rm or } \ y \not= 0, \\
0, & {\rm if } \ x = 0 \ {\rm and } \ y = 0, 
\end{cases}
$$
Then the integral
$$
F(x) = \int_0^1 f(x,y)\,{\rm d}y
$$
can be computed to equal $\frac{x}{2(1+x^2)}$ for all $x$ (check $x = 0$ separately). This is a differentiable function for all $x$, with
$$
F'(x) = \frac{1-x^2}{2(1+x^2)^2}.
$$
In particular, $F'(0) = 1/2$. However,
$$
\frac{\partial}{\partial x}f(x,y) = \begin{cases}
\frac{x^2y(3y^2-x^2)}{(x^2+y^2)^3}, & {\rm if } \ y \not= 0, \\
0, & {\rm if } \ y = 0, 
\end{cases}
$$
so $f_x(0,y) = 0$. Therefore the "equation"
$$
\frac{\rm d}{{\rm d}x}\int_0^1 f(x,y)\,{\rm d}y = \int_0^1 \frac{\partial}{\partial x}f(x,y)\,{\rm d}y
$$
is invalid at $x = 0$, where the left side is $1/2$ and the right side is $0$. A problem is that $f_x(x,y)$ is not a continuous function of two variables: along the line $y = x$ we have $f_x(x,y) = f_x(x,x) = 1/(4x)$ for $x \not= 0$, which does not converge as $x \rightarrow 0$ even though $f_x(0,0) = 0$ is defined.
