<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>2nd-Order-ODE-1-real-distinct</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Solve \[{@n1@} \frac{d^2y}{dt^2} - {@bc@} \frac{dy}{dt} = {@cc@}y .\]  <br />\(y(t)\) = [[input:ans1]] [[validation:ans1]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>To solve the differential equation \[{@n1@} \frac{d^2y}{dt^2} - {@bc@} \frac{dy}{dt} = {@cc@} y. \] <br />First write this in standard form \[{@n1@} \frac{d^2y}{dt^2} - {@bc@} \frac{dy}{dt} - {@cc@} y = 0\]<br />Let \(y = e^{mt}\) and hence \(\frac{dy}{dt}=me^{mt}\) and \(\frac{d^2y}{dt^2} = m^2e^{mt}\). <br />Substituting for \(y\) gives \[{@n1@}m^2e^{mt} - {@bc@}me^{mt} - {@cc@}e^{mt} = 0\] and dividing throughout by \(e^{mt}\) and {@n1@} gives \[m^2 - {@bc/n1@}m - {@cc/n1@} = 0\] which can be solved to give {@m@}. The solution is then of the form \(y = A{@e^(m1*t)@}+B{@e^(m2*t)@}\).</p>]]></text>
    </generalfeedback>
    <defaultgrade>2</defaultgrade>
    <penalty>0</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text/>
    </stackversion>
    <questionvariables>
      <text>n1:rand(8)+2;
n2:rand(6)+6;
n3:rand(5)+1;
bc:n1*(n2-n3);
cc:n1*n2*n3;
m:solve(n1*m^2 - bc*m - cc = 0,m);
m1:rhs(m[1]);
m2:rhs(m[2]);
correctanswer:A*e^(m1*t)+B*e^(m2*t);
altanswer:B*e^(m1*t)+A*e^(m2*t);
wronganswer2:A*e^(m1*t);
q:n1*'diff(y(t),t,2)-bc*'diff(y(t),t)-cc*y(t);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text><![CDATA[<p>[[feedback:Result]]</p>]]></text>
    </specificfeedback>
    <questionnote format="html">
      <text>\({@n1@} \frac{d^2y}{dt^2} - {@bc@} \frac{dy}{dt} - {@cc@} y = 0\)  gives \(y = A{@e^(m1*t)@}+B{@e^(m2*t)@}\)</text>
    </questionnote>
    <questiondescription format="html">
      <text/>
    </questiondescription>
    <questionsimplify>1</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>0</assumereal>
    <prtcorrect format="html">
      <text><![CDATA[<p><span class="correct">Correct answer, well done.</span></p>]]></text>
    </prtcorrect>
    <prtpartiallycorrect format="html">
      <text><![CDATA[<p><span class="partially">Your answer is partially correct.</span></p>]]></text>
    </prtpartiallycorrect>
    <prtincorrect format="html">
      <text><![CDATA[<p><span class="incorrect">Incorrect answer.</span></p>]]></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>correctanswer</tans>
      <boxsize>20</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords>solve</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>p:ev(q,y(t)=ans1,nouns,fullratsimp);
l:setify(listofvars(ans1));
l:setdifference(l,set(t));
l:listify(l);
lv:length(l);
b1:ev(ans1,t=0,fullratsimp);
b2:ev(ans1,t=1,fullratsimp);
m:if not(b2=0) then fullratsimp(b1/b2) else 0;
m:float(m);
p2:ev(q,y(t)=subst(t,x,ans1),nouns,fullratsimp);</text>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>p</sans>
        <tans>0</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>1</truenextnode>
        <trueanswernote>Sat-ODE</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>3</falsenextnode>
        <falseanswernote>Does-Not-Sat-ODE </falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>Your answer should satisfy the differential equation, but in fact when we substitute your expression into the differential equation we get \[{@p@}\] which is not zero, so you must have done something wrong.</p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>lv</sans>
        <tans>2</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>2</truenextnode>
        <trueanswernote>Has-2-consts </trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.7500000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>Wrong-#-consts </falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>You should have a general solution, which includes unknown constants. Your answer satisfies the differential equation, but does not have the correct number of unknown constants.</p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>2</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>numberp(m)</sans>
        <tans>true</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>Sol-not-lin-ind </trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p>Your general solution should be a sum of two linearly independent components, but is not.</p>]]></text>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>1.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>Correct </falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>3</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>p2</sans>
        <tans>0</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>Result-4-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p>Actually, if we make the substitution \(x=t\) then it looks like your answer does satisfy the equation.  You have probably used the wrong variable in your answer!</p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>Result-4-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>258189496</deployedseed>
    <deployedseed>1454874554</deployedseed>
    <deployedseed>618666105</deployedseed>
    <deployedseed>1089015490</deployedseed>
    <deployedseed>976055893</deployedseed>
    <deployedseed>1539806997</deployedseed>
    <deployedseed>141387721</deployedseed>
    <deployedseed>1331542353</deployedseed>
    <deployedseed>1497396135</deployedseed>
    <deployedseed>410647422</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>correctanswer</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Correct</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>correctanswer-c</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Result-4-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>altanswer</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Correct</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>4</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>wronganswer2</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.7500000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Wrong-#-consts</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>5</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>A*e^(m2*t)+B*e^(m2*t)</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.5000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Sol-not-lin-ind</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>6</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ev(subst(x,t,correctanswer),simp)</value>
      </testinput>
      <expected>
        <name>Result</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>Result-4-T</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
