MATH/CMSC 206 - Introduction to Matlab
Announcements | Syllabus | Tutorial | Projects | Submitting |
Answers to Self-Test
1. Have MATLAB integrate the function f(x) = sqrt(x^2 + 3). Aren't you glad we didn't ask you to do this one by hand?
int(sqrt(x^2 + 3))
ans = (3*asinh((3^(1/2)*x)/3))/2 + (x*(x^2 + 3)^(1/2))/2
2. Have MATLAB compute the definite integral of that same function over the interval [2, 4]. Ouch.
int(sqrt(x^2 + 3), 2, 4)
ans = (3*log((4*3^(1/2))/3 + 57^(1/2)/3))/2 - (3*log((2*3^(1/2))/3 + 21^(1/2)/3))/2 - 7^(1/2) + 2*19^(1/2)