<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>27.2.5.5 Polar Coordinates Exercise</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Integrate the function \(f(x,y) = x^3 + x y^2\) over the quadrant \(x \ge 0\), \(y \ge 0\), \(x^2 + y^2 \le 1\).</p>
<p>\(I =\) [[input:ans1]] [[validation:ans1]]</p>]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[<p> We are asked to integrate the function \(f(x,y) = x^3 + x y^2\) over the quadrant \(x \ge 0\), \(y \ge 0\), \(x^2 + y^2 \le 1\).</p>
<p> The quadrant is shown below </p>
[[jsxgraph]]
        var board = JXG.JSXGraph.initBoard(divid, { // STACK: when moving to STACK change 'jxgboard' for divid
            boundingbox: [-0.5, 1.5, 1.5, -0.5],
            keepaspectratio: true,
            axis: true,
            showCopyright: false,
			showNavigation: false,
			grid: false
		});
		
		// Create quadrant
                var p1 = board.create('point', [0,0], {fixed: true, withLabel:false, visible: false});
                var p2 = board.create('point', [0,1], {fixed: true, withLabel:false, visible: false});
                var p3 = board.create('point', [1,0], {fixed: true, withLabel:false, visible: false});

               var quadrant = board.create('minorsector', [p1, p2, p3]);


[[/jsxgraph]]

<p>Since the region of integration is the quarter of the unit circle in the first quadrant, it makes sense to use polar coordinates. </p>
<p> So, we have \(0 \le r \le 1\), and \(0 \le \theta \le \dfrac{\pi}{2}\), and therefore the integral may be written (remembering that \(x = r\cos \theta\) and \(y = r \sin \theta\)), </p>
<p> \(\begin{align}
\qquad \displaystyle I &= \int_{0}^{\frac{\pi}{2}} \int_{0}^{1} \left[(r\cos\theta)^3 + r\cos\theta \times (r\sin\theta)^2 \right] \, r\, \mathrm{d}r\, \mathrm{d}\theta \\
&= \int_{0}^{\frac{\pi}{2}} \int_{0}^{1} r^4\cos\theta \left(\cos^2\theta + \sin^2\theta\right) \, \mathrm{d}r\, \mathrm{d}\theta\\
&= \int_{0}^{\frac{\pi}{2}} \int_{0}^{1} r^4\cos\theta \, \mathrm{d}r\, \mathrm{d}\theta
\end{align}\) </p>
<p> Which can be rewritten as </p>
<p> \(\begin{align}
\qquad \displaystyle I &= \int_{0}^{\frac{\pi}{2}} \cos\theta \, \mathrm{d}\theta \times  \int_{0}^{1} r^4 \mathrm{d}r \\
&= \left[\sin\theta\right]_{0}^{\frac{\pi}{2}} \times \left[\dfrac{1}{5} r^5\right]_{0}^{1} \\
&= \left(\sin\dfrac{\pi}{2} - \sin0\right) \times \left(\dfrac{1}{5}(1)^5 - 0\right) \\
&= 1 \times \dfrac{1}{5} \\
&= \dfrac{1}{5}. \end{align}\) </p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025040100</text>
    </stackversion>
    <questionvariables>
      <text>ta1:1/5;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text>[[feedback:prt1]]</text>
    </specificfeedback>
    <questionnote format="html">
      <text>{@ta1@}</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>5</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>
    <qtest>
      <testcase>1</testcase>
      <description>Test case assuming the teacher's input gets full marks.</description>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1+1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
    </qtest>
    <tags>
      <tag><text>jsxgraph_solution</text>
</tag>
    </tags>
  </question>
</quiz>
