Integration counter-examples : Witch's hat functions
What is this ?
The functions f_n are continuous, converge pointwise almost everywhere to 0 as n goes to infinity and their integral is constant, equal to 1. So you cannot swap lim and integral when calculating the limit of the integral of f_n.
Animated GIF
![Animated GIF](https://beta.geogebra.org/resource/dxkhrbtj/IHGSgiiRHKWYMMVA/material-dxkhrbtj.png)
Animated GIF version 2. Here the peak is not always in zero, but in 2/n. So the pointwise convergence of f_n to zero is for every point.
![Animated GIF version 2. Here the peak is not always in zero, but in 2/n. So the pointwise convergence of f_n to zero is for every point.](https://beta.geogebra.org/resource/wr4ggvmq/qFExuQKUMrKwrYzw/material-wr4ggvmq.png)
Version 2 with a moving peak in 2/n instead of 0.
You can use the same idea to construct a continuous non negative function whose integral converges although the function does not converge to zero. Here it was made so that there is a triangular bump for each positive integer n which has an area of 1/n².
![You can use the same idea to construct a continuous non negative function whose integral converges although the function does not converge to zero. Here it was made so that there is a triangular bump for each positive integer n which has an area of 1/n².](https://beta.geogebra.org/resource/yb3vzknm/B2Yg6bZ5FWyAdHMB/material-yb3vzknm.png)
GIF animation of infinitely smooth functions fn converging pointwise to 0 (as all its derivatives) with integrals equal to 1 for all n.
![GIF animation of infinitely smooth functions fn converging pointwise to 0 (as all its derivatives) with integrals equal to 1 for all n.](https://beta.geogebra.org/resource/vzvwnvh2/2wG8cteQUnFUX0qm/material-vzvwnvh2.png)