##DESCRIPTION ## Volume of revolution of parabolic region around x-axis ## Student must setup the integral, entering limits and integrand, ## then give the numerical value. ## Limits weighted 20%, integrand and answer weighted 50/30. ## These percentages can be adjusted if desired. ##ENDDESCRIPTION ## DBsubject(Calculus - single variable) ## DBchapter(Applications of integration) ## DBsection(Volumes by disks) ## Institution(Agnes Scott College) ## Author(Larry Riddle) ## Answer boxes for limits of integration Coding in PG - Nathan Wallach (CSS based formatting work and more) ## Answer boxes for limits of integration Coding in PGML - Glenn Rice ## https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4767#p14157 ## Level(2) ## MO(1) ## TitleText1('APEX Calculus') ## AuthorText1('Hartman') ## EditionText1('4.0') ## Section1('7.2') ## Problem1('4') DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl", "weightedGrader.pl", "contextFraction.pl", "answerHints.pl", "PGcourse.pl" ); install_weighted_grader(); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $refreshCachedImages=1; Context("Numeric")->flags->set( formatStudentAnswer => parsed, reduceConstantFunctions => 0,); $a = random(4,16); $xlow = ($a==4 or $a==9 or $a==16) ? Real(-sqrt($a)) : Formula("-sqrt($a)"); $xhigh = ($a==4 or $a==9 or $a==16) ? Real(sqrt($a)) : Formula("sqrt($a)"); $s = sqrt($a); $f = Formula("$a-x^2"); $integrand = Formula("pi*($a-x^2)^2"); $ans = Compute("16/15*pi*$a^(5/2)"); $rans = Real("16/15*pi*$a^(5/2)"); $xmin = floor(-sqrt($a))-1; $xmax = ceil(sqrt($a))+1; $ymin = -1; $ymax = $a+1; $gr = init_graph($xmin,$ymin,$xmax,$ymax,axes=>[0,0], ticks=>[$xmax-$xmin,$ymax-$ymin], size=>[400,400]); $gr->lb('reset'); $gr->new_color("lightblue", 214,230,244); # RGB $gr->new_color("darkblue", 100,100,255); add_functions($gr, "$f for x in [-$s,$s] using color:darkblue and weight:2"); $gr->moveTo($xmin,0); $gr->lineTo($xmax,0,"darkblue",1); $gr->fillRegion([0.5,0.5,"lightblue"]); $i = 0; # Number the axes do { $xtick = $i; $labelx1 = new Label($xtick,-0.2, "$xtick",'black','center'); $labelx2 = new Label(-$xtick,-0.2, "-$xtick",'black','center'); if ($xtick!=0) { $gr->lb($labelx1); $gr->lb($labelx2); } $i =$i+1; } while ($i<($xmax-$xmin)-1); $i = 0; do { $ytick = $i; $labely = new Label(-0.2,$ytick, "$ytick",'black', 'right','middle'); if ($ytick!=0) {$gr->lb($labely);} $i =$i+1; } while ($i<($ymax-$ymin)-1); # Code to format the answer boxes for integration limits TEXT( MODES( HTML=>" ", TeX=>"" )); # =============================================================== # Display the answer blanks properly in different modes Context()->texStrings; if ($displayMode eq 'TeX') { $integral1 = join("", ( '\( \displaystyle \text{Volume = } \int_{ ', $xlow->ans_rule(5), ' }^{ ', $xhigh->ans_rule(5), '}\)', $xhigh->ans_rule(30), '\(\, dx \)' )); } else { $integral1 = join("", ( openDiv( { "class" => "divOnLineWithIntegrationLimits" } ), '\( \displaystyle \quad\quad \text{Volume = } \int \)', closeDiv(), openDiv( { "class" => "gridForPairOfIntegrationBounds" } ), openDiv( { "class" => "lowerIntegrationBoundOfPair" } ), $xlow->ans_rule(8), closeDiv(), openDiv( { "class" => "upperIntegrationBoundOfPair" } ), $xhigh->ans_rule(8), closeDiv(), closeDiv(), openDiv( { "class" => "divIntegrand" } ), $integrand->ans_rule(15), '\( \, dx \)', closeDiv(), ) ); } Context()->normalStrings; BEGIN_PGML >>[@ image(insertGraph($gr),width=>300, height=>300, tex_size=>400) @]*<< >>[`\quad`]Graph of [`y = [$a] - x^2`]<< a) A region of the Cartesian plane is shaded, as shown in the figure above. Use the Disk/Washer Method to set up an integral that gives the volume of the solid of revolution formed by revolving the region around the [`x`]-axis. [`\;`] [@ openDiv() . $integral1 . closeDiv() @]* b) Compute the volume of the solid. [_______________] END_PGML WEIGHTED_ANS( $xlow->cmp,10 ); WEIGHTED_ANS( $xhigh->cmp ,10); WEIGHTED_ANS( $integrand->cmp->withPostFilter(AnswerHints( Formula("$f") => "This looks like you are finding the area of the region, not the volume of the solid of revolution.", [Formula("pi*$f"),Formula("($f)^2")] => "This is almost correct. What is the formula for the area of a circle?", )),50 ); WEIGHTED_ANS( $rans->cmp,30 ); Context("Fraction")->flags->set(reduceConstantFunctions => 0,); $a2 = $a*$a; $a3 = Fraction(2*$a,3); $c1 = Fraction(1,5); $c2 = Fraction(8,15); $c3 = Fraction(16,15); if ($a==4 or $a==9 or $a==16) { $w1 = $c2*sqrt($a)**5; $w2 = $c3*sqrt($a)**5; $c2 = ""; $c3 = ""; } else { $w1 = "($a)^{5/2}"; $w2 = "($a)^{5/2}"; } BEGIN_PGML_SOLUTION The curve [`y = [$f]`] intersects the [`x`]-axis where [`[$f]=0`], so at [`x = [$xlow]`] and [`x = [$xhigh]`]. A slice of the region rotated around the [`x`]-axis forms a disk of radius [`R(x) = [$f]`]. The cross-sectional area of the slice is [`\pi R(x)^2 = \pi([$f])^2`]. The volume is therefore given by the integral [``\int_{[$xlow]}^{[$xhigh]}\pi R(x)^2\;dx = \int_{[$xlow]}^{[$xhigh]}\pi([$f])^2\;dx \approx [$ans]``] Here is the calculation with the antidifferentiation carried out. [``\begin{aligned} \int_{[$xlow]}^{[$xhigh]}\pi([$f])^2\;dx &= \pi \int_{[$xlow]}^{[$xhigh]} \left([$a2]-[$a*2]x^2 + x^4\right)\;dx \\ \\ &= \pi \left([$a2]x - [$a3]x^3 + [$c1]x^5\right)\bigg|_{[$xlow]}^{[$xhigh]} \\ \\ &= \pi \left([$c2][$w1] - (-[$c2][$w1]\right) = [$c3][$w2]\pi \end{aligned} ``] END_PGML_SOLUTION COMMENT('Randomization provides 13 different possible versions of this question.'); ENDDOCUMENT();