> f:= x -> sin(x^2);
> plot(f(x),x=0 .. Pi, filled=true, color=grey);
What happens if we try to antidifferentiate sin(x^2) using Maple?
> int(f(x),x);
Okay, what if we tried to find the area between a and b using Maple?
> int(f(x),x=-2*Pi/3 .. Pi/4);
In neither case did we get a result we understand.
So ... we want to approximate the area.
1 (a) Is f monotone?
f is not monotone , so we can not use Theorem 1 to find the error bounds when approximating using left, right, or trapezoidal sum.
1 (b) How closely will L_500 approximate I? R_500?
Notice that we are not asked to actually *find* L_500 or R_500!
Use Theorem 2:
|I-L_n| <= K1*(b-a)^2/(2n)
n=500,
b=Pi,
a=0.
We need to find K1.
K1 is any number greater than or equal to the maximum of the slope of f.
> fprime:= x -> 2*x*cos(x^2);
Choose a value for K1 by looking at the graph of |f'(x)|:
> plot([abs(fprime(x)), 7], x=0..Pi, color=[black, green]);
We'll use K1=7. (Note that we could try to get K1 closer to the actual maximumof |f'(x)|.
Calculate the error bound:
> 7*(Pi-0)^2/(2*500);
> evalf(%);
Thus L_500 and R_500 are within .0691 of I.
Notice I can not say that L_500 and R_500 are within .069 of I!
1(c) Use L_n to approximate I within .001 of its actual value.
We want the actual error, |I-L_n|, to be less than or equal to .01. If we make the error bound be less than or equal to .001, then |I-L_n| is sure to be as well.
So we need to find n so that K1*(b-a)^2/(2n) <= .01.
a=0,
b=Pi
K1=7
n=?
I need to find n so that 7*(Pi - 0)^2/(2*n) <= .01.
> solve(7*(Pi)^2/(2*n) <= .01,n);
It looks like n=3,455 will do it, but let me check:
> evalf(7*(Pi)^2/(2*3455));
>
Sure enough!
Thus
> Ln := (Pi/3455)*Sum(sin((i*Pi/3455)^2),i=0..3454);
approximates the integral to within .001.
Let's see if Maple can do it.
> evalf(%);
It takes Maple a while, but Maple can do it!
2.
> f:= x -> -2*ln(1+x^2);
> plot(f(x),x=-1..2);
2a) Is f monotone over [-1,2]?
f is not monotone and so Thm 1 does not apply.
2b) How closely will R500 approximate I?
Using Thm 2, the error using R500 will be less than:
K1*(b-a)^2/(2n).
b=2
a=-1
n=500
What's K1? Any upper bound on |f ' (x)|.
Look at graph of f ' (x):
> fprime := x -> -2*(1/(x^2+1))*2*x;
> plot([2,abs(fprime(x))], x=-1..2);
It looks like the maximum is actually 2. To check this I would need to zoom in or take the derivative. Time is pressing, so I'll use K1=2.1 to be sure.
Thus the error using R500 is
> 2.1*(2+1)^2/(2*500);
Thus the error is less than .019 when we use R500.
2c) Use Rn to approximate I to within .01.
K1=2.1
a=-1
b=2
n=?
> solve(2.1*(3)^2/(2*n)<=.01,n);
check:
> 2.1*9/(2*945);
> Rn:= (3/945)*Sum(-2*ln(1+(3*i/945)^2), i=1..945);
> evalf(%);
>