<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>3.6.4.2 Ireducible quadratic Task_Express partial fractions (copy)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise<br></p>
<p>Express as partial fractions:</p>
<p>\[\dfrac{{@expNum1@}}{({@exp1@})({@exp2@})}\]</p>
<p>Please pretend that the quadratic factor cannot be factorised further, it can be, but I can't change the question now. Let's imagine a brighter world where the rest of this makes sense.&nbsp;</p><p><span style="font-size: 0.9375rem;">In our brighter world we have</span><br></p>
\[\dfrac{{@expNum1@}}{({@exp1@})({@exp2@})}=\dfrac{{@var2*var+var3@}}{{@exp1@}}+\dfrac{{@var4@}}{{@exp2@}}\]
<p>First multiply both sides by \(({@exp1@})({@exp2@})\):</p>
<p>\({@expNum1@}=\) [[input:ans1]] [[validation:ans1]][[feedback:prt1]]</p>
<p>Evaluate \({@var4@}\):</p>
<p>\({@var4@}=\) [[input:ans2]] [[validation:ans2]][[feedback:prt2]]</p>
<p>Equate coefficients of \({@var@}^2\) and hence find \({@var2@}\), and then substitute any other value for \({@var@}\) (or equate coefficients of \({@var@}\)) to find \({@var3@}\):</p>
<p>\({@var2@}=\) [[input:ans3]] [[validation:ans3]]</p>
<p>\({@var3@}=\) [[input:ans4]] [[validation:ans4]][[feedback:prt4]]</p>
<p>Finally express in partial fractions:</p>
<p>\(\dfrac{{@expNum1@}}{({@exp1@})({@exp2@})}=\) [[input:ans5]] [[validation:ans5]][[feedback:prt5]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>The rational function is proper since the degree of the numerator is \(2\), and this is less than the degree of the denominator which is \(3\). The denominator is the product of a linear and (what we pretend to be) an irreducible quadratic. This lets
    use determine the antz and the problem is then to find constants \(A,\,B\) and \(C\) so that<br>\[\dfrac{{@expNum1@}}{({@exp1@})({@exp2@})}=\dfrac{{@var2*var+var3@}}{{@exp1@}}+\dfrac{{@var4@}}{{@exp2@}}.\]<br>
 </p><p>We bring everything over a common denominator by multiplying both sides by \(({@exp1@})({@exp2@})\). This gives:<br>\[{@expNum1@}={@ta11@}.\]<br>
</p><p>The easiest first step is to choose \({@var@}\) so that the linear factor \({@exp2@}=0\), i.e. we take \(\displaystyle{{@var@}={@(rand3*rand4-1)/rand4@}}\).
 By substituting this in both sides of the equation we find \({@var4@}={@ta12@}\).</p>
<p>Since there are no linear factors there are no real values we can substitute to eliminate all but one of the unknown constants. We can equate the coefficients
    of \({@var@}^2\) easily enough however, and we find \({@diff(diff(expNum1,x),x)/2@}={@ratsimp(diff(diff(ta11,x),x)/2)@}\). We already have that&nbsp;\({@var4@}={@ta12@}\) and substitution gives&nbsp;\({@var2@}={@ta13@}\).<br><br>If we substitute any
    other value for \({@var@}\), an easy option may be&nbsp;\({@var@}=0\)&nbsp; which is the same as&nbsp; equating the constant of the left and right side of the equation. In that case we find \({@ratsimp(expNum1 + var^2*diff(diff(expNum1,x),x)/2 - var*diff(expNum1,x))@}={@ratsimp(ta11
    + x^2*diff(diff(ta11,x),x)/2 - x*diff(ta11,x))@}\). Using the values we found already this simplifies further to give&nbsp;\({@var3@}={@ta14@}\).&nbsp;<br><br>We can piece everything together to see that \[\dfrac{{@expNum1@}}{({@exp1@})({@exp2@})}={@ta15@}.\]<br><br>I
    should note that since the quadratic is not irreducible we should go another step to write the term with the quadratic denominator in partial fractions. There's nothing wrong with the solution in this way, but one would never simplify in two stages.
    Assume the quadratic was irreducible and this is all fine.<br></p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021072200</text>
    </stackversion>
    <questionvariables>
      <text>/*Need to have an irreducible quadratic at the denominator*/

var:x;      /* define variables*/
var2:A;
var3:B;
var4:C;

expA:rand_with_prohib(-4,4,[0]);
expB:rand_with_prohib(-4,4,[0,A]);
expC:rand_with_prohib(-4,4,[0,A,B]);

rand1:rand_with_prohib(-3,3,[0]);
rand2:rand_with_step(1,4,1);
rand3:rand(2)+2;
exp1: expand(rand3*(var-rand1)^2+rand2);    /*irreducible quadratic: |c|*(x-a)^2+|b| */

rand4:rand_with_step(1,4,1);
rand5:rand_with_prohib(-2,2,[0]);
exp2:rand4*var-(rand3*rand4-1);          /*linear factor */

expDenom1:(exp1)*(exp2);              /*denominator*/

ta11:(var2*var+var3)*exp2+var4*exp1;
expNum1:expand((expA*var+expB)*exp2+expC*exp1);   /*numerator*/

ta12:expC;
ta13:expA;
ta14:expB;
ta15:(expA*var+expB)/exp1+expC/exp2;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\({@expNum1/expDenom1@} \quad A = {@ta13@}, B= {@ta14@}, C= {@ta12@} \)</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>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>ta11</tans>
      <boxsize>20</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>ta12</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>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans3</name>
      <type>algebraic</type>
      <tans>ta13</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>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans4</name>
      <type>algebraic</type>
      <tans>ta14</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>0</mustverify>
      <showvalidation>0</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans5</name>
      <type>algebraic</type>
      <tans>ta15</tans>
      <boxsize>20</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>ta11</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</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>ta12</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">The valuew of \(C\) is incorrect. You can choose a value of \(x\) so that the linear factor \({@exp2@}=0.\)</p>]]></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>ans3</sans>
        <tans>ta13</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>1</truenextnode>
        <trueanswernote>prt4-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>prt4-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans4</sans>
        <tans>ta14</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt4-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt4-2-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>ParFrS1:(ans3*var+expB)/exp1+expC/exp2;
ParFrS2:(expA*var+ans4)/exp1+expC/exp2;
ParFrS3:(expA*var+expB)/exp1+ans2/exp2;
ParFrS:(ans3*var+ans4)/exp1+ans2/exp2;

ta15:(expA*var+expB)/exp1+expC/exp2;</text>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans5</sans>
        <tans>ta15</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt5-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>prt5-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans5</sans>
        <tans>ParFrS1</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt5-2-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You calculated wrong values for \(A\) but wrote the partial fraction in the desired form.&nbsp;</p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>2</falsenextnode>
        <falseanswernote>prt5-2-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>2</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans5</sans>
        <tans>ParFrS2</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt5-3-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You calculated wrong values for \(B\) but wrote the partial fraction in the desired form.&nbsp;<br></p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>3</falsenextnode>
        <falseanswernote>prt5-3-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>3</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans5</sans>
        <tans>ParFrS3</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt5-4-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You calculated wrong values for \(C\) but wrote the partial fraction in the desired form.&nbsp;<br></p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>4</falsenextnode>
        <falseanswernote>prt5-4-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>4</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans5</sans>
        <tans>ParFrS</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt5-5-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You calculated wrong values for \(A,B,C\) but wrote the partial fraction in the desired form.&nbsp;<br></p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt5-5-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1048083066</deployedseed>
    <deployedseed>1590289386</deployedseed>
    <deployedseed>495709525</deployedseed>
    <deployedseed>1715145198</deployedseed>
    <deployedseed>169373009</deployedseed>
    <deployedseed>586083354</deployedseed>
    <deployedseed>778194670</deployedseed>
    <deployedseed>580461904</deployedseed>
    <deployedseed>1763838837</deployedseed>
    <deployedseed>910605622</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta11</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta12</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta13</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>ta14</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>ta15</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>prt4</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt4-2-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(ta11+2,simp)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ev(ta12+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ev(ta13+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>ev(ta14+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>ev(ta15+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>prt4</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt4-2-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt5-5-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta11</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ev(ta12+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ev(ta13+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>ev(ta14+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>(ev(ta13+1,simp)*var+ev(ta14+1,simp))/exp1+ev(ta12+1,simp)/exp2;</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>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt4-2-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt5-5-T</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
