##DESCRIPTION ##KEYWORDS('integrals', 'theory', 'Riemann sums') ## sbrummel tagged and PAID on 2-20-2004 ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('Arnie Pizer') ## Institution('rochester') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('11,12,15,17') ## Approximate and integral using Midpoint Rule ##This is setIntegrals0Theory/sc5_2_5.pg slightly cleaned up ##Zig Fiedorowicz ##ENDDESCRIPTION DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $a= random(-10, 10, 1); if ($a == 0) {$a++;} $b= random(-10, 10, 1); if ($b == 0) {$b--;} $e= random(-10, 10, 1); $add= random(4, 10, 1); $f=$e+$add; BEGIN_TEXT Use the Midpoint Rule to approximate the integral \[ \int_{$e}^{$f}($a x+$b x^2)dx \] with n=3. $BR \{ans_rule(20)\} $PAR END_TEXT $piece1=($a*(5*$e+$f)/6 + $b*((5*$e+$f)/6)**2)*$add/3; $piece2=($a*($e+$f)/2 + $b*(($e+$f)/2)**2)*$add/3; $piece3=($a*(5*$f+$e)/6 + $b*((5*$f+$e)/6)**2)*$add/3; $answer=$piece1+$piece2+$piece3; ANS(num_cmp($answer)); ##set $PG_environment{'textbook'} in webworkCourse.ph if (defined($textbook)) { if ($textbook eq "EllisGulick5") { BEGIN_TEXT This is similar to Problems 29 and 31 of Section 5.2 of the text. END_TEXT } } ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation',) ##DESCRIPTION ## Approximate an integral with Trapezoid rule, Simpon's Rule, and Midpoint ## rule ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('11') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $a = random(2,6,1); $trapezoidal = "(1/8)*(1+2*e^(-$a/16)+2*e^(-$a/4)+2*e^(-$a*9/16)+e^(-$a))"; $midpoint = "(1/4)*(e^(-$a/64)+e^(-$a*9/64)+e^(-$a*25/64)+e^(-$a*49/64))"; $showPartialCorrectAnswers = 1; BEGIN_TEXT Given the following integral and value of n, approximate the following integral using the methods indicated (round your answers to six decimal places): $BR$BR \[ \int_{0}^{1} e^{-$a x^2} dx , n=4 \] $BR $BBOLD(a) $EBOLD Trapezoidal Rule $BR \{ans_rule( 55) \} $BR$BR $BBOLD (b) $EBOLD Midpoint Rule $BR \{ans_rule(55)\} $BR$BR END_TEXT ANS(num_cmp($trapezoidal)); ANS(num_cmp($midpoint)); ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation', 'Simpson') ##DESCRIPTION ## Use Simpon's Rule to approximate an integral. ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('33') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $y0=random(-9,9,1); $y1=random(-9,9,1); $y2=random(-9,9,1); $y3=random(-9,9,1); $y4=random(-9,9,1); $y5=random(-9,9,1); $y6=random(-9,9,1); $a0 =random(-19,29,1); $a1 = $a0+1; $a2 = $a0+2; $a3 = $a0+3; $a4 = $a0+4; $a5 = $a0+5; $a6 = $a0+6; @row_1 = ("\($a0\)", "\($a1\)", "\($a2\)", "\($a3\)", "\($a4\)", "\($a5\)", "\($a6\)"); @row_2 = ("\($y0\)", "\($y1\)", "\($y2\)", "\($y3\)", "\($y4\)", "\($y5\)", "\($y6\)"); BEGIN_TEXT Use the Trapezoidal Rule and all the data in the following table to estimate the value of \(\int_{$a0}^{$a6}y\,dx\). $BR$BR \{begintable(scalar(@row_1)+1)\} \{row(" \(x\) ", @row_1)\} \{row(" \(y\) ",@row_2)\} \{endtable()\} $BR$BR Answer: \{ans_rule( 45 )\} END_TEXT $ans = "(1/2)*($y0 + 2*$y1 + 2*$y2 + 2*$y3 + 2*$y4 + 2*$y5 + $y6)"; ANS(num_cmp($ans)); ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation', 'Simpson') ##DESCRIPTION ## Use Simpon's Rule to approximate an integral. ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('33') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $y0=random(-9,9,1); $y1=random(-9,9,1); $y2=random(-9,9,1); $y3=random(-9,9,1); $y4=random(-9,9,1); $y5=random(-9,9,1); $y6=random(-9,9,1); $a0 =random(-19,29,1); $b0 =random(3,8,1); $a1 = $a0+$b0; $a2 = $a0+2*$b0; $a3 = $a0+3*$b0; $a4 = $a0+4*$b0; $a5 = $a0+5*$b0; $a6 = $a0+6*$b0; @row_1 = ("\($a0\)", "\($a1\)", "\($a2\)", "\($a3\)", "\($a4\)", "\($a5\)", "\($a6\)"); @row_2 = ("\($y0\)", "\($y1\)", "\($y2\)", "\($y3\)", "\($y4\)", "\($y5\)", "\($y6\)"); BEGIN_TEXT Use the Trapezoidal Rule and all the data in the following table to estimate the value of \(\int_{$a0}^{$a6}y\,dx\). $BR$BR \{begintable(scalar(@row_1)+1)\} \{row(" \(x\) ", @row_1)\} \{row(" \(y\) ",@row_2)\} \{endtable()\} $BR$BR Answer: \{ans_rule( 45 )\} END_TEXT $ans = "($b0/2)*($y0 + 2*$y1 + 2*$y2 + 2*$y3 + 2*$y4 + 2*$y5 + $y6)"; ANS(num_cmp($ans)); ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation',) ##DESCRIPTION ## Approximate an integral with Trapezoid rule, Simpon's Rule, and Midpoint ## rule ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('11') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $a = random(2,6,1); $b = random(2,6,1); $trapezoidal = "($a/12)*(1/$b+2/($b+($a/6)**3)+2/($b+($a/3)**3)+2/($b+($a/2)**3)+2/($b+(2*$a/3)**3)+2/($b+(5*$a/6)**3)+1/($b+$a**3))"; $midpoint = "($a/6)*(1/($b+($a/12)**3)+1/($b+($a/4)**3)+1/($b+(5*$a/12)**3)+1/($b+(7*$a/12)**3)+1/($b+(3*$a/4)**3)+1/($b+(11*$a/12)**3))"; $showPartialCorrectAnswers = 1; BEGIN_TEXT Given the following integral and value of n, approximate the following integral using the methods indicated (round your answers to six decimal places): $BR$BR \[ \int_{0}^{$a} \frac{dt}{$b+t^3} , \ n=6 \] $BR $BBOLD(a) $EBOLD Trapezoidal Rule $BR \{ans_rule( 55) \} $BR$BR $BBOLD (b) $EBOLD Midpoint Rule $BR \{ans_rule(55)\} $BR$BR END_TEXT ANS(num_cmp($trapezoidal)); ANS(num_cmp($midpoint)); ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation',) ##DESCRIPTION ## Approximate an integral with Trapezoid rule, Simpon's Rule, and Midpoint ## rule ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('11') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $a = random(2,6,1); $trapezoidal = "(1/4)*($a**0.5+2*($a+0.5**0.5)**0.5+2*($a+1)**0.5+2*($a+1.5**0.5)**0.5+2*($a+2**0.5)**0.5+2*($a+2.5**0.5)**0.5+2*($a+3**0.5)**0.5+2*($a+3.5**0.5)**0.5+($a+2)**0.5)"; $midpoint = "(1/2)*(($a+0.25**0.5)**0.5+($a+0.75**0.5)**0.5+($a+1.25**0.5)**0.5+($a+1.75**0.5)**0.5+($a+2.25**0.5)**0.5+($a+2.75**0.5)**0.5+($a+3.25**0.5)**0.5+($a+3.75**0.5)**0.5)"; $showPartialCorrectAnswers = 1; BEGIN_TEXT Given the following integral and value of n, approximate the following integral using the methods indicated (round your answers to six decimal places): $BR$BR \[ \int_{0}^{4} \sqrt{$a+\sqrt{x}} \ dx , \ n=8 \] $BR $BBOLD(a) $EBOLD Trapezoidal Rule $BR \{ans_rule( 55) \} $BR$BR $BBOLD (b) $EBOLD Midpoint Rule $BR \{ans_rule(55)\} $BR$BR END_TEXT ANS(num_cmp($trapezoidal)); ANS(num_cmp($midpoint)); ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation',) ##DESCRIPTION ## Approximate an integral with Trapezoid rule, Simpon's Rule, and Midpoint ## rule ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('11') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $a = random(2,6,1); $b = random(2,6,1); $n = "int(5/sqrt(3)*$b*$a**1.5+0.999999)"; BEGIN_TEXT What is the smallest \{ n \} to guarantee that the Trapezoidal Rule approximation to \[ \int_{0}^{$a} e^{-$b x} \ dx \] is accurate to within 0.01 (according to the Error Bounds Theorem of page 521)? $BR$BR \{ans_rule( 25) \} $BR$BR END_TEXT ANS(num_cmp($n)); ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation',) ##DESCRIPTION ## Approximate an integral with Trapezoid rule, Simpon's Rule, and Midpoint ## rule ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('11') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $a = random(2,6,1); $pi = arccos(-1); $n = "int(50*$pi**1.5/(3*$a)**0.5+0.999999)"; BEGIN_TEXT What is the smallest \{ n \} to guarantee that the Trapezoidal Rule approximation to \[ \int_{0}^{\pi/$a} \sin($a x) \ dx \] is accurate to within 0.0001 (according to the Error Bounds Theorem of page 521)? $BR$BR \{ans_rule( 25) \} $BR$BR END_TEXT ANS(num_cmp($n)); ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation',) ##DESCRIPTION ## Approximate an integral with Trapezoid rule, Simpon's Rule, and Midpoint ## rule ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('11') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $a = random(2,6,1); $b = random(2,6,1); $pi = arccos(-1); $et = "$b**2*$a**3/1200"; BEGIN_TEXT According to the Error Bounds formula of page 521, what is an upper bound on the error in estimating the given integral with the Trapezoidal Rule using the given value of n? $BR$BR \[ \int_{0}^{$a} e^{-$b x} \ dx , \ n=10 \] $BR$BR \( |E_T| \leq \) \{ans_rule( 25) \} $BR$BR END_TEXT ANS(num_cmp($et)); ENDDOCUMENT(); # This should be the last executable line in the problem. ________________________________________________________________________________ ##KEYWORDS('integrals', 'approximation',) ##DESCRIPTION ## Approximate an integral with Trapezoid rule, Simpon's Rule, and Midpoint ## rule ##ENDDESCRIPTION ## Shotwell cleaned ## DBsubject('Calculus') ## DBchapter('Techniques of Integration') ## DBsection('Approximate Integration') ## Date('6/3/2002') ## Author('') ## Institution('') ## TitleText1('Calculus Early Transcendentals') ## EditionText1('4') ## AuthorText1('Stewart') ## Section1('7.7') ## Problem1('11') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $a = random(2,6,1); $b = random(5,10,1); $pi = arccos(-1); $n = $a*$b; $et = "$pi**3/(12*$a**3*$b**2)"; BEGIN_TEXT According to the Error Bounds formula of page 521, what is an upper bound on the error in estimating the given integral with the Trapezoidal Rule using the given value of n? $BR$BR \[ \int_{0}^{\pi/$a} \sin($a x) \ dx , \ n=$n \] $BR$BR \( |E_T| \leq \) \{ans_rule( 25) \} $BR$BR END_TEXT ANS(num_cmp($et)); ENDDOCUMENT(); # This should be the last executable line in the problem.