Absolute error in midpoint approximation is calculated as "\\frac{(b-a)^3k}{24n^2}" , where k is a max value of |f''(x)| on [a,b].
In this care a=0, b=2, f(x)=xcos(x), f'(x)=cos(x)-xsin(x), f''(x)=-sin(x)-sin(x)-xcos(x)=-2sin(x)-xcos(x), f'''(x)=-2cos(x)-cos(x)+xsin(x)=-3cos(x)+xsin(x), f''''(x)=3sin(x)+sin(x)-xcos(x)=4sin(x)+xcos(x).
-3cos(x)+xsin(x)=0
xsin(x)=3cos(x)
x=3cot(x). Using a numerical method, we get that x=1.1925 on [0,2].
|f''(0)|=|-2sin(0)-0|=0.
|f''(1.1925)|=|-2sin(1.1925)-1.1925cos(1.1925)|=2.299
|f''(2)||=|-2sin(2)-2cos(2)|=0.9863.
Therefore, a max value of |f''(x)| on [0,2] is 2.299
So, if absolute error is less than 0.001 then:
"\\frac{2^3\\cdot2.299}{24n^2}\\leq0.001\n\n\\newline\n\n\\newline\n\n\n24n^2\\cdot0.001\\geq2^3\\cdot2.299\n\n\\newline\n\nn^2\\geq\\frac{2^3\\cdot2.299}{24\\cdot0.001}\n\n\\newline \n\nn^2\\geq 766.33\n\n\\newline\n\nn\\geq \\sqrt{766.33}\n\n\\newline\n\nn\\geq 27.6827"
So n has to be at least 28.
Answer: n=28
Comments
Leave a comment