<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>10.3.28 (Given integral facts, evaluate others (using limits))</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Given that \(\displaystyle\int_{@a@}^{@b@}f(x)\,dx={@A@}\), \(\displaystyle\int_{@a@}^{@c@}f(x)\,dx={@B@}\), \(\displaystyle\int_{@a@}^{@b@}g(x)\,dx={@C@}\), and \(\displaystyle\int_{@b@}^{@c@}g(x)\,dx={@D@}\), which of the following can be evaluated?</p>
<p>(Enter the value if you can find it, otherwise enter <code>none</code>)</p>
<p></p>
<b>(a) </b>\( \displaystyle{@expr[1]@} =\) [[input:ans1]] [[validation:ans1]][[feedback:prt1]]
<p></p>
<b>(b)&nbsp;</b>\( \displaystyle{@expr[2]@} =\) [[input:ans2]][[validation:ans2]][[feedback:prt2]] 
<p></p>
<b>(c) </b>\( \displaystyle{@expr[3]@} = \)&nbsp;[[input:ans3]] [[validation:ans3]][[feedback:prt3]]
<p></p>
<b>(d) </b>\( \displaystyle{@expr[4]@} =\) [[input:ans4]] [[validation:ans4]][[feedback:prt4]]
<p></p>
<b>(e)&nbsp;</b>\( \displaystyle{@expr[5]@} =\) [[input:ans5]] [[validation:ans5]][[feedback:prt5]]
<p></p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p><b>(a)&nbsp;</b>\( \displaystyle{@(make_multsgn("dot"),expr[1])@} = {@working[1]@} {@continues[1]@} {@taworking[1]@}\).</p><p><b>(b)&nbsp;</b>\( \displaystyle{@expr[2]@} = {@working[2]@} {@continues[2]@} {@taworking[2]@}\).<br></p><p><b>(c) </b>\( \displaystyle{@expr[3]@} = {@working[3]@} {@continues[3]@} {@taworking[3]@}\).</p><p><b>(d) </b>\( \displaystyle{@expr[4]@} = {@working[4]@} {@continues[4]@} {@taworking[4]@}\).</p><p><b>(e) </b>\( \displaystyle{@expr[5]@} = {@working[5]@} {@continues[5]@} {@taworking[5]@}\).</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2022071300</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[simp:true;
a:rand_range(-4,-1);
b:rand_with_prohib(a+1,2,[0]);
c:rand_range(b+1,5);
A:rand_range(5,10);
B:rand_with_prohib(5,15,[A]);
C:rand_with_prohib(1,15,[A,B]);
D:rand_with_prohib(1,15,[A,B,D]);
n:rand_range(2,4);
m:rand_range(2,5);

/* this determines how we will shuffle the parts: */
reordering:random_permutation([1,2,3,4,5]);
simp:false;

/* a master list of the expressions and the answers, given as equations */
shorthand: 
[Fab='int(f(x),x,a,b),Fac='int(f(x),x,a,c),Gab='int(g(x),x,a,b),Gbc='int(g(x),x,b,c)];
expr_master:['int(f(x),x,b,c)=Fac-Fab, 'int((n*f(x)+m*g(x)),x,a,b)=n*Fab+m*Gab, 'int(f(x)-g(x),x,a,c)=Fac-(Gab+Gbc), 'int(x*f(x),x,a,b)=none,  'int(x*f(x),x,a,a)=0];

/* perform the reordering */

expr:makelist(lhs(expr_master[i]),i,reordering);
ta:maplist(rhs, makelist(ev(expr_master[i],[Fab=A,Fac=B,Gab=C,Gbc=D]),i,reordering));
taworking:map(lambda([ex],ex=ev(ex,simp)),ta); 

 /* produce lines of working */
ta:map(lambda([ex],ev(ex,simp)),ta);

 /* now simplify the final answers */
working:maplist(rhs, makelist(ev(expr_master[i],shorthand),i,reordering));

/* here we finesse the two unusual cases */

ans_zero:sublist_indices(ta, lambda ([ex], ex=0))[1];
ans_none:sublist_indices(ta, lambda ([ex], ex=none))[1];
taworking[ans_zero]:"";
taworking[ans_none]:"";
continues:["=","=","=","=","="];
continues[ans_zero]:"}\\), since the upper and lower limits of the definite integral are the same\\({";
continues[ans_none]:"}\\), since we don't have enough information about the integrand\\({";

ta1:ta[1];
ta2:ta[2];
ta3:ta[3];
ta4:ta[4];
ta5:ta[5];]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\(\displaystyle\int_{@a@}^{@b@}f(x)\,dx={@A@}\) and \(\displaystyle\int_{@a@}^{@b@}g(x)\,dx={@B@}\)</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>0</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>none</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>5</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>algebraic</type>
      <tans>ta2</tans>
      <boxsize>7</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>5</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans3</name>
      <type>algebraic</type>
      <tans>ta3</tans>
      <boxsize>7</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>5</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans4</name>
      <type>algebraic</type>
      <tans>ta4</tans>
      <boxsize>7</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>5</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans5</name>
      <type>algebraic</type>
      <tans>ta5</tans>
      <boxsize>7</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>5</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>0</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>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>
    <prt>
      <name>prt3</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>prt3-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt3-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt4</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans4</sans>
        <tans>ta4</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt4-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt4-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt5</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans5</sans>
        <tans>ta5</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt5-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt5-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>728444460</deployedseed>
    <deployedseed>1092881841</deployedseed>
    <deployedseed>575474519</deployedseed>
    <deployedseed>1463282803</deployedseed>
    <deployedseed>1167061583</deployedseed>
    <deployedseed>4877509</deployedseed>
    <deployedseed>2825889</deployedseed>
    <deployedseed>422245868</deployedseed>
    <deployedseed>963165978</deployedseed>
    <deployedseed>661507055</deployedseed>
    <deployedseed>1470149736</deployedseed>
    <deployedseed>283720586</deployedseed>
    <deployedseed>664353616</deployedseed>
    <deployedseed>476057388</deployedseed>
    <deployedseed>650955724</deployedseed>
    <deployedseed>152762238</deployedseed>
    <deployedseed>1027478224</deployedseed>
    <deployedseed>664798525</deployedseed>
    <deployedseed>1288887119</deployedseed>
    <deployedseed>1062927823</deployedseed>
    <deployedseed>294085323</deployedseed>
    <deployedseed>324451750</deployedseed>
    <deployedseed>1519816279</deployedseed>
    <deployedseed>690664596</deployedseed>
    <deployedseed>1920011997</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <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>
      <testinput>
        <name>ans4</name>
        <value>ta4</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>ta5</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>
      <expected>
        <name>prt3</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt3-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt4-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt5-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ev(ta1+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ev(ta2+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ev(ta3+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>ev(ta4+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>ev(ta5+1,simp)</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>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt4-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt5-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
