Using the symbolic function int, find the indefinite integral of the function 4x2 + 3, and the definite integral of this function from x = -1 to x = 3. Also, approximate this using the trapz function
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:14| Question number:37.14
All Answers
total answers (1)
Ch14Ex37.m
% Find integrals
x = sym('x');
f = 4*x^2 + 3;
%Indefinite integral
int(f)
%Definite integral from x = -1 to x = 3
int(f,-1,3)
%Approximation
f = sym2poly(f);
x = -1:0.1:3;
y = polyval(f,x);
need an explanation for this answer? contact us directly to get an explanation for this answer