<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>27.1.5.6 Special Cases of Double Integrals Exercise</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<ol class="HELM_parts">
    <li><p> Evaluate the integral \(I_1= \displaystyle \int_{@aa@}^{@bb@}\displaystyle\int_{@cc@}^{@dd@} x^3y \, \mathrm{d}y \mathrm{d}x = \) [[input:ans1]] [[validation:ans1]] [[feedback:prt1]]</p>
        <p>If your answer is not an integer, leave it in rational form e.g. <code>23/5</code>.</p>
    </li>

    <li><p> Which of the following integrals gives the same value as \(I_1\)? [[input:ans2]] [[validation:ans2]] [[feedback:prt2]]</p>
    </li>
    <p> \( (i) \quad \displaystyle \int_{@cc@}^{@dd@}\displaystyle\int_{@aa@}^{@bb@} x^3y \, \mathrm{d}y \mathrm{d}x \)</p>
    <p> \( (ii) \quad\displaystyle \int_{@aa@}^{@bb@}\displaystyle\int_{@cc@}^{@dd@} x^3y \, \mathrm{d}x \mathrm{d}y \)</p>
    <p> \( (iii)\quad\displaystyle \int_{@cc@}^{@dd@}\displaystyle\int_{@aa@}^{@bb@} x^3y \, \mathrm{d}x \mathrm{d}y \)</p>
    <p>\( (iv) \quad\displaystyle - \int_{@cc@}^{@dd@}\displaystyle\int_{@aa@}^{@bb@} x^3y \, \mathrm{d}y \mathrm{d}x \)</p>
    <p>\( (v) \quad\displaystyle - \int_{@aa@}^{@bb@}\displaystyle\int_{@cc@}^{@dd@} x^3y \, \mathrm{d}x \mathrm{d}y \)</p>

</ol>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p> (a) We are asked to evaluate the integral \(I_1 = \displaystyle \int_{@aa@}^{@bb@}\displaystyle\int_{@cc@}^{@dd@} x^3y \, \mathrm{d}y \mathrm{d}x, \)</p>
<p> The area of integration for which is shown below.</p>
[[jsxgraph]] 
        var board = JXG.JSXGraph.initBoard(divid, {
            boundingbox: [{#xmin#}, {#ymax#}, {#xmax#}, {#ymin#}],
            keepaspectratio: true,
            axis: true,
            showCopyright: false,
			showNavigation: false,
			grid: false
		});
		
		// Hide tick labels and ticks on x-axis but label it
		board.defaultAxes.x.setAttribute({
		  ticks: {
			drawLabels: false, // hide numbers
			majorHeight: 0,
			minorHeight: 0
		  },
		  name: 'x',
		  withLabel: true,
		  label: {
			position: 'rt',
			offset: [1, -10]
		  }
		});

		// Hide tick labels and ticks on y-axis but label it
		board.defaultAxes.y.setAttribute({
		  ticks: {
			drawLabels: false,
			majorHeight: 0,
			minorHeight: 0
		  },
		  name: 'y',
		  withLabel: true,
		  label: {
			position: 'rt',
			offset: [-15, 0]
		  }
		});
		
		
		// Create points and rectangle
		var bl = board.create('point', [{#aa#},{#cc#}], {fixed: true, withLabel:false, visible: true, showInfobox: false, size: 3, face: 'o', fillColor: 'black', strokeColor: 'black'});
		var br = board.create('point', [{#bb#},{#cc#}], {fixed: true, withLabel:false, visible: true, showInfobox: false, size: 3, face: 'o', fillColor: 'black', strokeColor: 'black'})
		var tr = board.create('point', [{#bb#},{#dd#}], {fixed: true, withLabel:false, visible: true, showInfobox: false, size: 3, face: 'o', fillColor: 'black', strokeColor: 'black'});
		var tl = board.create('point', [{#aa#},{#dd#}], {fixed: true, withLabel:false, visible: true, showInfobox: false, size: 3, face: 'o', fillColor: 'black', strokeColor: 'black'});
		var rectangle = board.create('polygon', [bl, br, tr, tl],{name:"Rectangle",withLabel:false, color: 'white'});
		
		// Set all edges (borders) to black
		rectangle.borders.forEach(line => {
			line.setAttribute({strokeColor: 'darkblue'});
		});
		
		// Label coordinates dynamically
		[bl, br, tr, tl].forEach((pt) => {
			board.create('text', [
				() => pt.X() + 0.1,
				() => pt.Y() + 0.1,
				() => `(${pt.X()}, ${pt.Y()})`
			], {
				fontSize: 12,
				fixed: true,
				highlight: false
			});
		});
[[/jsxgraph]]

<p> We first evaluate the inner integral. </p>
<p> \(\begin{align}
\text{Inner Integral} &amp;=\displaystyle \int_{@cc@}^{@dd@} x^3y \, \mathrm{d}y \\
&amp;= \left[ \dfrac{x^3y^2}{2}\right]_{@cc@}^{@dd@} \\
&amp;= \dfrac{{@dd@}^2 x^3}{2} - \dfrac{({@cc@})^2 x^3}{2} \\
&amp;= {@ee@}x^3. \end{align} \) </p>

<p> Substituting this into the outer integral, we get </p>
<p> \(\begin{align}
I_1 &amp;= \displaystyle \int_{@aa@}^{@bb@} {@ee@}x^3 \, \mathrm{d}x \\
&amp;= \left[{@ee/4@}x^4\right]_{@aa@}^{@bb@} \\
&amp;= {@ee/4@}({@bb@})^4 - \left( {@ee/4@}({@aa@})^4\right) \\
&amp;= {@ee/4*(bb)^4 - ee/4*(aa)^4@}.
\end{align} \) </p>
<br>

<p>(b) The correct answer is \((iii)\). Since this is an integration over a rectangular area, we can change the order of integration and we will get the same answer. This is done by swapping the order of both the limits and the corresponding \(\mathrm{d}x\) and \(\mathrm{d}y\) terms.</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025073100</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[aa: rand_with_step(-2,0,1);
bb: rand_with_step(1,3,1);
cc: rand_with_prohib(-2,0,[aa]);
dd: rand_with_prohib(1,3,[bb]);
xmax: bb + 1;
xmin: aa - 1;
ymax: dd + 1;
ymin: cc - 1;
ee: (dd^2)/2 - (cc^2)/2;
ff: (bb^4)/4 - (aa^4)/4;
exp: (x^3)*y;
inn: int(exp,y,cc,dd);
ta1: int(inn,x,aa,bb);
ta2:[["(i)",false],["(ii)",false],["(iii)",true],["(iv)",false], ["(v)", false]];
wrong_inn: int(exp,y,aa,bb);
wrong_answer: int(wrong_inn,x,cc,dd);]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="html">
      <text><![CDATA[<p>\[I_1=\int_{@aa@}^{@bb@}\int_{@cc@}^{@dd@}\left( x^3y\right) \,\mathrm{d}y \mathrm{d}x =  {@ev(ta1, simp)@}\]</p>]]></text>
    </questionnote>
    <questiondescription format="html">
      <text/>
    </questiondescription>
    <questionsimplify>1</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>0</assumereal>
    <prtcorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:green;"><i class="fa fa-check"></i></span> Correct answer, well done.]]></text>
    </prtcorrect>
    <prtpartiallycorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:orange;"><i class="fa fa-adjust"></i></span> Your answer is partially correct.]]></text>
    </prtpartiallycorrect>
    <prtincorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:red;"><i class="fa fa-times"></i></span> Incorrect answer.]]></text>
    </prtincorrect>
    <decimals>.</decimals>
    <scientificnotation>*10</scientificnotation>
    <multiplicationsign>dot</multiplicationsign>
    <sqrtsign>1</sqrtsign>
    <complexno>i</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed/>
    <input>
      <name>ans1</name>
      <type>algebraic</type>
      <tans>ta1</tans>
      <boxsize>7</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>dropdown</type>
      <tans>ta2</tans>
      <boxsize>7</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1</sans>
        <tans>ta1</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt2</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>[ans2]</sans>
        <tans>mcq_correct(ta2)</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1065233816</deployedseed>
    <deployedseed>2139454545</deployedseed>
    <deployedseed>608558401</deployedseed>
    <deployedseed>1151353353</deployedseed>
    <deployedseed>1750350977</deployedseed>
    <deployedseed>1367075877</deployedseed>
    <deployedseed>179917902</deployedseed>
    <deployedseed>60458336</deployedseed>
    <deployedseed>688109004</deployedseed>
    <deployedseed>1070124327</deployedseed>
    <deployedseed>969704689</deployedseed>
    <deployedseed>1368452992</deployedseed>
    <deployedseed>2145623146</deployedseed>
    <deployedseed>1117417188</deployedseed>
    <deployedseed>847690053</deployedseed>
    <deployedseed>2108825583</deployedseed>
    <deployedseed>1023603832</deployedseed>
    <deployedseed>2004755892</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_correct(ta2))</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1+1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_incorrect(ta2))</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>wrong_answer</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_correct(ta2))</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>4</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>0</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_correct(ta2))</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
    </qtest>
    <tags>
      <tag><text>jsxgraph_solution</text>
</tag>
    </tags>
  </question>
</quiz>
