<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>29.1.4.20 vector line integral exercise</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Evaluate the vector line integral \(\displaystyle\int_C(\underline{\nabla} \cdot \underline{F} )\ \underline{\mathrm{d}r}\) in the case where \(\underline{F} = x\underline{i} + xy\underline{j} + xy2\underline{k}\) and \(C\) is the contour described by \(x = {@aa@}t\), \(y = t^2\), \(z = {@bb@} − t\) for \(t\) starting at \(t = 0\) and going to \(t = 1\).</p>

<p>\(\displaystyle\int_C(\underline{\nabla} \cdot \underline{F} )\ \underline{\mathrm{d}r} =\)[[input:ans1]]\(\underline{i} +\)[[input:ans2]]\(\underline{j} +\)[[input:ans3]]\(\underline{k}\) [[validation:ans1]] [[validation:ans2]] [[validation:ans3]]</p>]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[<p>We know that \(\underline{F} = x\underline{i} + xy\underline{j} + xy2\underline{k}\), and C is the contour defined by \(x = {@aa@}t\), \(y = t^2\), \(z = {@bb@} − t\) for \(t\) starting at \(t = 0\) and going to \(t = 1\). We aim to find \(\displaystyle \int_C(\underline{\nabla} \cdot \underline{F} ) \underline{\mathrm{d}r}\), and start by calculating \(\underline{\nabla} \cdot \underline{F}\):</p>
\[\begin{aligned}
\underline{\nabla} \cdot \underline{F} &= \frac{\partial}{\partial x}(x) + \frac{\partial}{\partial y}(xy) + \frac{\partial}{\partial z}(xy^2)\\
&= 1 + x\\
&=1 + 2t
\end{aligned}\]
<p>We now rewrite \(\underline{\mathrm{d}r}\) in terms of \(t\):</p>
\[\begin{aligned}
\underline{\mathrm{d}r} &= \mathrm{d}x\underline{i} + \mathrm{d}y\underline{j} + \mathrm{d}z\underline{k}\\
&= \frac{\mathrm{d}x}{\mathrm{d}t}\mathrm{d}t\underline{i} + \frac{\mathrm{d}y}{\mathrm{d}t}\mathrm{d}t\underline{j} + \frac{\mathrm{d}z}{\mathrm{d}t}\mathrm{d}t\underline{k}\\
&= {@aa@}\mathrm{d}t\underline{i} + 2t\mathrm{d}t\underline{j} -\mathrm{d}t\underline{k}
\end{aligned}\]
<p>Finally we solve as follows:</p>
\[\begin{aligned}
\int_C(\underline{\nabla} \cdot \underline{F} ) \underline{\mathrm{d}r} &= \int_C(1 + 2t ) ({@aa@}\mathrm{d}t\underline{i} + 2t\mathrm{d}t\underline{j} -\mathrm{d}t\underline{k})\\
&= \int^1_0 ({@aa@}+{@2*aa@}t)\underline{i} + (2t+4t^2)\underline{j} + (-1-2t)\underline{k}\ \underline{\mathrm{d}t}\\
&=\left[({@aa@}t+{@aa@}t^2)\underline{i} + (t^2+\frac{4}{3}t^3)\underline{j} + (-t-t^2)\underline{k}\right]^1_0\\
&= {@2*aa@}\underline{i} + \frac{7}{3}\underline{j} -2\underline{k}
\end{aligned}\]]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025073100</text>
    </stackversion>
    <questionvariables>
      <text>aa:rand(5)+2
bb:rand(5)+2

ta1i:2*aa;
ta1j:7/3;
ta1k:-2;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text>[[feedback:prt1]]</text>
    </specificfeedback>
    <questionnote format="html">
      <text>\(x = {@aa@}t\), \(y = t^2\), \(z = {@bb@} − t\)</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>ta1i</tans>
      <boxsize>10</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>ta1j</tans>
      <boxsize>10</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>ta1k</tans>
      <boxsize>10</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>ta1i</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0</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>ta1j</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0</truescore>
        <truepenalty/>
        <truenextnode>2</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>
      <node>
        <name>2</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans3</sans>
        <tans>ta1k</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-3-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-3-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1754665881</deployedseed>
    <deployedseed>1601835154</deployedseed>
    <deployedseed>776771943</deployedseed>
    <deployedseed>333863718</deployedseed>
    <deployedseed>1055219659</deployedseed>
    <deployedseed>1070088511</deployedseed>
    <deployedseed>157725376</deployedseed>
    <deployedseed>1405980379</deployedseed>
    <deployedseed>652188730</deployedseed>
    <deployedseed>1413389793</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description>Test case assuming the teacher's input gets full marks.</description>
      <testinput>
        <name>ans1</name>
        <value>ta1i</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta1j</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta1k</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-3-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1i</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta1j</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta1k+9</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-3-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
