## DBsubject(Calculus - multivariable) ## DBchapter(Integration of multivariable functions) ## DBsection(Change of order of integration) ## Author(Lydia Peres, Nathan Wallach) # Problem design - Lydia Peres # Coding in PG - Nathan Wallach (CSS based formatting work and more) # Coding in PGML - Glenn Rice ## KEYWORDS('calculus') DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "PGML.pl", "PGcourse.pl" ); SET_PROBLEM_LANGUAGE("en-US"); SET_PROBLEM_TEXTDIRECTION("ltr"); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $showPartialCredit = 1; ################################ # Setup Context("Numeric"); Context()->variables->are(x =>'Real', y =>'Real'); Context()->flags->set( tolerance => 0.00000001, tolType => "absolute", ); # =============================================================== # Generate Parameters $m = random(2,5,1); #Define the rest of the parameters. # =============================================================== $xlow = Compute(" (y-1) / $m "); $xhigh = Compute(" sqrt( 1 - y ) "); $ylow = Real(0); $yhigh = Real(1); # =============================================================== # Code to format the answer boxes for integration limits # The settings for specific answer boxes are for the regular # non-MathQuill input boxes, and much the lower bound down a bit # and set a smaller font / input box height. Since the input boxes # are not inside the grid layout, much of the code to relocate # the boxes and control their width is not needed any more. # The class based formatting handles the grid layout, and putting # the series of DIVs all on one line. TEXT( MODES( HTML=>" ", TeX=>"" )); # =============================================================== # Display the answer blanks properly in different modes if ($displayMode eq 'TeX') { $integral1 = join("", ( '\( \displaystyle = \int_{ ', $ylow->ans_rule(5), ' }^{ ', $yhigh->ans_rule(5), '} dy \int_{ ', $xlow->ans_rule(5), ' }^{ ', $xhigh->ans_rule(5), '} f(x,y) \, dx \)' )); } else { $integral1 = join("", ( openDiv( { "class" => "divOnLineWithIntegrationLimits" } ), '\( \displaystyle = \int \)', closeDiv(), openDiv( { "class" => "gridForPairOfIntegrationBounds" } ), openDiv( { "class" => "lowerIntegrationBoundOfPair" } ), $ylow->ans_rule(5), closeDiv(), openDiv( { "class" => "upperIntegrationBoundOfPair" } ), $yhigh->ans_rule(5), closeDiv(), closeDiv(), openDiv( { "class" => "divOnLineWithIntegrationLimits" } ). '\( dy \)', closeDiv(), openDiv( { "class" => "divOnLineWithIntegrationLimits" } ), '\( \displaystyle \int \)', closeDiv(), openDiv( { "class" => "gridForPairOfIntegrationBounds" } ), openDiv( { "class" => "lowerIntegrationBoundOfPair" } ), $xlow->ans_rule(14), closeDiv(), openDiv( { "class" => "upperIntegrationBoundOfPair" } ), $xhigh->ans_rule(14), closeDiv(), closeDiv(), openDiv( { "class" => "divOnLineWithIntegrationLimits" } ), '\( f(x,y) \, dx \)', closeDiv(), ) ); } # =============================================================== # Main text BEGIN_PGML Change the order of integration in the following integral. >> [@ openDiv() @]* [` \displaystyle \int_{ -1 / [$m] }^{ 0 } \, dx \int_{ 0 }^{ 1 + [$m] x } f \left( x, y \right) \, dy + \int_{ 0 }^{ 1 } \, dx \int_{ 0 }^{ 1 - x^2 } f \left( x, y \right) \, dy `] [@ closeDiv() @]* << >>[@ openDiv() . $integral1 . closeDiv() @]*<< END_PGML # =============================================================== # Answer Evaluation ANS( $ylow->cmp ); ANS( $yhigh->cmp ); ANS( $xlow->cmp ); ANS( $xhigh->cmp ); ENDDOCUMENT();