Required textbook:
Extra (non-book) notes will be posted here as they become available throughout the course.
Right-click and "save as"; in MatLab, change directory to wherever you saved the files; then, at the MatLab prompt (>>) type trapzd(@(x) x.*cos(3*x)./(1+x.^2),[0,pi],123) to estimate the integral of xcos(3x)/(1+x^2) over the interval [0,pi] with N=123.
Some details of MatLab syntax: note the use of .* ./ and .^ to multiply, divide and exponentiate functions of x; you can use any variable name (rather than x) -- the name of the variable is given in the parentheses after the @ symbol; change "trapzd" to "midpt" or "smpsn" as desired -- the rest of the syntax is the same.
Type ezplot(@(x) x.*cos(3*x)./(1+x.^2),[0,pi]) to see a plot of the function.
Official CU policy information: