%
%  Numerische Integration mittels Trapez-Regel: 
%    >> f = trapezRegel( @f2, 1, 2 )
%
function f = trapezRegel( fun, a, b )
    f = 0;
    N = 1000;
    d = (b-a)/N;
    x = a:d:b;
    for( n=1:N )
       f = f + ( fun(x(n)) + fun(x(n+1)) ) * d / 2;
    end
