%% Find Integral of Anonymous Function
% Create the handle f to an anonymous function that evaluates the cubic polynomial x^3 +x^2 +x+1 for a given value of x.

f = @(x) x.^3 + x.^2 + x + 1;

% To find the integral of the anonymous function from 0 to 1, pass its handle to integral.

q = integral(f,0,1)

% Copyright 2019 The MathWorks, Inc.