%% Improper Integral of Oscillatory Function
% Create the function f(x) = x^{5} e^{-x} \sin x.

fun = @(x)x.^5.*exp(-x).*sin(x);

%
% Evaluate the integral from x=0 to x=Inf , adjusting the absolute and relative tolerances.

format long
q = integral(fun,0,Inf,'RelTol',1e-8,'AbsTol',1e-13)

% Copyright 2012 The MathWorks, Inc.