everybody!
Could you, guys, please explain why the answer for the exact integration
quad( @(x)x.^3-2.*x,0,2)
is
-2.220446049250313e-016
istead of a zero, just like it should be?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
quadfunction computes the integral numerically, not symbolically.Even though most integration methods will compute the integral of a 3rd degree polynomial ‘exactly’ , that is only true if all the calculations are done exactly as well. When doing the calculation on a computer, round-off error still is a factor.