Wirtinger's inequality for functions