<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>29.1.2.10 scalar integral and closed path exercise</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<p>Consider the vector field \(\displaystyle \underline{F}={@aa@}x\underline{i}+(xz-{@bb@})\underline{j}+{@cc@}xy\underline{k}\) and two curves between \((0, 0, 0)\) and \((1, -1, 2)\) defined by
\[\begin{eqnarray*} 
C_1&:&x=t^2,\qquad y=-t,\qquad z=2t\qquad (0\leq t\leq 1).\\ 
C_2&:&x=t-1,\qquad y=1-t,\qquad z=2t-2\qquad (1\leq t\leq 2). 
\end{eqnarray*} \]</p>

<ol class="HELM_parts">
<li><p> Find \(\displaystyle \int_{C_1}\underline{F}\cdot\underline{dr}\), \(\displaystyle \int_{C_2} \underline{F} \cdot \underline{dr} \)</p>
<p>\(\displaystyle\int_{C_1}{\underline G}\cdot \underline{dr} =\)[[input:ans1]] [[validation:ans1]]</p>
<p>\(\displaystyle\int_{C_2}{\underline G}\cdot \underline{dr} =\)[[input:ans2]] [[validation:ans2]][[feedback:prt1]]</p></li>

<li><p>Find  \(\displaystyle\oint_C \underline{F} \cdot  \underline{dr}\) where \(C\) is the closed path from \((0, 0, 0)\) to \((1, -1, 2)\) along \(C_1\) and back to \((0, 0, 0)\) along \(C_2\). </p>
<p>\(\displaystyle\oint_C \underline{G} \cdot  \underline{dr} =\)[[input:ans3]] [[validation:ans3]][[feedback:prt2]]</p></li>
</ol>]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[<ol class="HELM_parts">
<li>
<p>The path \(C_1\) is given in terms of the parameter \(t\) by \(x=t^2\), \(y=-t\) and \(z=2t\). Hence 
\[\begin{aligned}
\underline{r} &= t^2\underline{i}-t\underline{j}+2t\underline{k}\\
\frac{\mathrm{d}\underline{r}}{\mathrm{d}t} &= 2t\underline{i}-\underline{j} + 2\underline{k}\\
\underline{F} &= {@aa@}t^2\underline{i} + (2t^3-{@bb@})\underline{j} - {@cc@}t^3\underline{k}\\
\underline{F} \cdot \frac{\mathrm{d}\underline{r}}{\mathrm{d}t} &= {@2*aa@}t^3 + {@bb@} -2t^3 - {@2*cc@}t^3 \\
&= {@2*aa-2-2*cc@}t^3+{@bb@}
\end{aligned}\]</p>
<p>Therefore we can evaluate the scalar integral as follows:
\[\begin{aligned}
\int_{C_1}\underline{F}\cdot\underline{dr} &= \int^1_0 {@2*aa-2-2*cc@}t^3+{@bb@} \mathrm{d}t\\
&= \left[{@(aa-1-cc)/2@}t^4+{@bb@}t\right]^1_0 \\
&={@(aa-1-cc)/2+bb@}
\end{aligned}\]
</p>

<p>The path \(C_2\) is given in terms of the parameter \(t\) by \(x=t-1\), \(y=1-t\) and \(z=2t-2\). Hence
\[\begin{aligned}
\underline{r} &= (t-1)\underline{i}+(1-t)\underline{j}+(2t-2)\underline{k}\\
\frac{\mathrm{d}\underline{r}}{\mathrm{d}t} &= \underline{i}-\underline{j} + 2\underline{k}\\
\underline{F} &= {@aa@}(t-1)\underline{i} + ((t-1)(2t-2)-{@bb@})\underline{j} - {@cc@}(t-1)^2\underline{k}\\
&= {@aa@}(t-1)\underline{i} + (2t^2-4t+2-{@bb@})\underline{j} - {@cc@}(t-1)^2\underline{k}\\
\underline{F} \cdot \frac{\mathrm{d}\underline{r}}{\mathrm{d}t} &= {@aa@}(t-1) + -(2t^2-4t+2-{@bb@})- {@2*cc@}(t-1)^2 \\
&= {@aa@}t - {@aa@} + -2t^2 + 4t - 2 + {@bb@} - {@2*cc@}t^2 + {@4*cc@}t - {@2*cc@} \\
&= {@-2-2*cc@}t^2+{@aa+4+4*cc@}t + ({@-aa-2+bb-2*cc@})
\end{aligned}\]</p>
<p>Therefore we can evaluate the scalar integral as follows:
\[\begin{aligned}
\int_{C_2}\underline{F}\cdot\underline{dr} &= \int^2_1 {@-2-2*cc@}t^2+{@aa+4+4*cc@}t + ({@-aa-2+bb-2*cc@}) \mathrm{d}t\\
&= \left[{@(-2-2*cc)/3@}t^3+{@(aa+4+4*cc)/2@}t^2 + {@-aa-2+bb-2*cc@}t\right]^2_1 \\
&=\left({@(-2-2*cc)/3@}(2)^3+{@(aa+4+4*cc)/2@}(2)^2 + {@-aa-2+bb-2*cc@}(2)\right) - \left({@(-2-2*cc)/3@}(1)^3+{@(aa+4+4*cc)/2@}(1)^2 + {@-aa-2+bb-2*cc@}(1)\right) \\
&= {@((-2-2*cc)/3)*8 + (aa+4+4*cc)*2 + (-aa-2+bb-2*cc)*2 - ((-2-2*cc)/3+(aa+4+4*cc)/2 -aa-2+bb-2*cc)@}
\end{aligned}\]
</p></li>

<li><p>For the closed path \(C\) \[\begin{aligned}
\displaystyle\oint_C\underline{F}\cdot\underline{d r} &=\displaystyle\int_{C_1}\underline{F}\cdot\underline{d r}\displaystyle\int_{C_2}\underline{F}\cdot\underline{d r}\\
&={@(aa-1-cc)/2+bb@}-{@((-2-2*cc)/3)*8 + (aa+4+4*cc)*2 + (-aa-2+bb-2*cc)*2 - ((-2-2*cc)/3+(aa+4+4*cc)/2 -aa-2+bb-2*cc)@}\\
&={@ta1-ta2@}
\end{aligned}\]
</p></li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025073100</text>
    </stackversion>
    <questionvariables>
      <text>aa:rand(4)+2;
bb:rand(4)+2;
cc:rand(4)+1;

ta1:(aa-1-cc)/2+bb;
ta2:((-2-2*cc)/3)*8 + (aa+4+4*cc)*2 + (-aa-2+bb-2*cc)*2 - ((-2-2*cc)/3+(aa+4+4*cc)/2 -aa-2+bb-2*cc);
ta3:ta1-ta2;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="html">
      <text>\(\displaystyle \underline{F}={@aa@}x\underline{i}+(xz-{@bb@})\underline{j}+{@cc@}xy\underline{k}, \quad \displaystyle\int_{C_1}{\underline G}\cdot \underline{dr} ={@ta1@} ,\quad
\displaystyle\int_{C_2}{\underline G}\cdot \underline{dr} = {@ta2@}, \quad 
\displaystyle\oint_C \underline{G} \cdot  \underline{dr} ={@ta3@} \)</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>15</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>algebraic</type>
      <tans>ta2</tans>
      <boxsize>15</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>ans3</name>
      <type>algebraic</type>
      <tans>ta3</tans>
      <boxsize>15</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>0.5</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>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans2</sans>
        <tans>ta2</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-2-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>ans3</sans>
        <tans>ta3</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>11771757</deployedseed>
    <deployedseed>1338082070</deployedseed>
    <deployedseed>2146606579</deployedseed>
    <deployedseed>1505632629</deployedseed>
    <deployedseed>419373270</deployedseed>
    <deployedseed>940338638</deployedseed>
    <deployedseed>1106825472</deployedseed>
    <deployedseed>1029060311</deployedseed>
    <deployedseed>217764624</deployedseed>
    <deployedseed>177682887</deployedseed>
    <deployedseed>244349571</deployedseed>
    <deployedseed>168297617</deployedseed>
    <deployedseed>269452577</deployedseed>
    <deployedseed>506731900</deployedseed>
    <deployedseed>928687882</deployedseed>
    <deployedseed>1710880518</deployedseed>
    <deployedseed>1958182289</deployedseed>
    <deployedseed>929481643</deployedseed>
    <deployedseed>1016043545</deployedseed>
    <deployedseed>1301410707</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description>Test case assuming the teacher's input gets full marks.</description>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta3</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-2-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</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2+4</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta3+3</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.5000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-2-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
