6. (20 points) Let f be a real valued continuous function defined on [-a, a] such that ƒ (-a) = ƒ (a) = 0. The n-th mome
Posted: Mon Jun 06, 2022 2:29 pm
6. (20 points) Let f be a real valued continuous function defined on [-a, a] such that ƒ (-a) = ƒ (a) = 0. The n-th moment of ƒ about 0 is defined as a Jang Mn = (x) dx -a Write a function moment(f,a,n) with output mn, where ƒ is an function object representing a real valued continuous function defined on [-a, a] such that f(-a) = f (a) = 0. Use the quad function to evaluate the integrals. (b) Use the moment function in (a) to write a code which prints the moments of f(x) = sin x defined on [-T, π] for n where 0 ≤ n ≤ 9 in a for loop