<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>Diagnostic_ALG-IPF_1</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Express \[{@f@},\] as a sum of partial fractions. [[input:ans1]]</p>
<p>[[validation:ans1]]</p>
<p>&nbsp;</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>Below are the rules of partial fractions.[[facts:alg_partial_fractions]]<br></p><p><br></p><p>We note that the numerator \[{@num@}\] is cubic and that the denominator \[{@den@}={@expden@}\] is quadratic. Dividing {@num@} by {@expden@} we obtain a linear term of the form {@p@} and a linear remainder of the form {@q@} and \[{@num@} = ({@expden@})({@p@})+{@q@}.\] Expanding out the brackets we find \[{@num@} = {@denp@}+{@q@}.\] Matching coefficients we see that \(g={@gval@}\) and that \(h={@xsquaredcoeff@}-{@twolg@}={@xsquaredcoeff@}-{@twolgval@}={@hval@}\). Also \[\begin{array}{rcl}\displaystyle h+m+{@gl2@}={@hval@} + m + {@gvall2@}&amp;\displaystyle =&amp;\displaystyle {@xcoeff@}\mbox{,}\\ {@hl2@}+n={@hvall2@}+n&amp;\displaystyle =&amp;\displaystyle {@constcoeff@}\mbox{.} \end{array}\] Therefore \(m={@mval@}\) and \(n={@nval@}\). The quotient is \({@p@}={@pval@}\) and the remainder is \({@q@}={@qval@}\). As a sum of partial fractions \[ {@fq@}=\frac{A}{@rootden@}+\frac{B}{@den@}\mbox{.}\]</p>
<p>Multiplying both sides through by {@den@} we find:</p>
<p>\[{@qval@}= {@Arootden@} + B\mbox{.}\]</p>
<p>Matching coefficients we see that \(A={@Aval@}\) and setting \(x={@minusl@}\) we find that \(B={@Bval@}\) so</p>
<p>\[ {@fq@}=\frac{@Aval@}{@rootden@}+\frac{@Bval@}{@den@}\mbox{.}\] Therefore \[{@f@}={@answer@}\mbox{.}\]</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2018080600</text>
    </stackversion>
    <questionvariables>
      <text>mag_l:rand(4)+2;
sign_l:2*rand(2)-1;
l:mag_l * sign_l;
minusl:-l;
l2:l**2;
hl2:h*l2;
hx:h * x;
gval:rand(8) + 2;
gl2:g*l2;
gvall2:gval * l2;
mag_h:rand(4)+2;
sign_h:2*rand(2)-1;
hval:mag_h*sign_h;
hvalx:hval * x;
hvall2:hval*l2;
mval:rand(8) + 2;
mag_n:rand(4)+2;
sign_n:2*rand(2)-1;
nval:mag_n*sign_n;
twol:2*l;
twolg:twol*g;
twolgval:twol*gval;
rootden:x + l;
Arootden:A * rootden;
den:rootden^2;
expden:expand(den);
num:expand(expden * (gval*x + hval)) + mval*x + nval;
xsquaredcoeff:coeff(num,x,2);
xcoeff:coeff(num,x);
constcoeff:coeff(num,x,0);
f:num/den;
p:g*x+h;
pval:gval*x + hval;
q:m*x+n;
qval:mval*x + nval;
Bval:mval*minusl + nval;
Aval:(nval - Bval)/l;
fq:qval/den;
denp:expand(den*p);
answer:partfrac(f,x);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text><![CDATA[<p>[[feedback:Result]]</p>]]></text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[{@f@}={@answer@}\mbox{.}\]</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <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>answer</tans>
      <boxsize>20</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords>divide</forbidwords>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>1</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>1</showvalidation>
      <options/>
    </input>
    <prt>
      <name>Result</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>EqualComAss</answertest>
        <sans>ans1</sans>
        <tans>answer</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>ALG-IPF-TRUE</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>ALG-IPF-FALSE</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>711606399</deployedseed>
    <deployedseed>1561275729</deployedseed>
    <deployedseed>1342278190</deployedseed>
    <deployedseed>615955604</deployedseed>
    <deployedseed>1828463762</deployedseed>
    <deployedseed>1475368116</deployedseed>
    <deployedseed>504193998</deployedseed>
    <deployedseed>1364184837</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>answer</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>ALG-IPF-TRUE</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>f</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>ALG-IPF-FALSE</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
