<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>18.3.4.5 Identify and classify stationary points 4 (copy)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Given that \(f(x) = {@exp@}\), identify the stationary point for this function.</p>
<p> Classify the stationary point as either a local minimum, local maximum or a saddle point.
</p>

<p>\(\dfrac{\partial f}{\partial x} = \dfrac{\partial f}{\partial y} = 0\) at \((x, y)\) = [[input:ans1]] [[validation:ans1]]</p>
<p>This point is a: [[input:ans2]] [[validation:ans2]]</p>
<p>[[feedback:prt2]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p></p>
<p>We are asked to find the stationary points of the function \( f(x,y) = {@exp@}.\)</p>
<p>First, find the partial derivatives of \(f(x,y):\)</p>\(f_x={@partialx@} \\ f_y={@partialy@}\)
<p></p>
<p>Now we solve the equations \(f_x = 0\) and \(f_y= 0:\)</p>
<p>\(f_x = 0 \Rightarrow {@partialx@} = 0 .\)</p>
<p>\(f_y = 0 \Rightarrow {@partialy@} = 0 .\)<br></p>
<p>Solving the system of equations we find that the stationary point is \( (-1, 3) .\)</p>
<p>Then we calculate \( f_{xx}, \, f_{yy}, \, f_{xy} \, \text{and} \, D:\)</p>
<p>\( f_{xx} = {@f_xx@} \)</p>
<p>\( f_{yy} = {@f_yy@} \)</p>
<p>\( f_{xy} = {@f_xy@} \)</p>
<p>\( D = f_{xx}f_{yy}- (f_{xy})^2 = {@D@} \)</p>
<p></p>
<p>We have \(D&lt;0 \) so the stationary point is a saddle point.</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021120900</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[exp: 2*x^2+y^2+3*x*y-3*y-5*x+8;
partialx: diff(exp, x);
partialy: diff(exp, y);
a:solve(partialx = 0, x);
b:solve(partialy = 0, y);
tacoords1:matrix([-1, 3]); 
ta1: [["local minimum", false], ["local maximum", false], ["saddle point", true]];

/* Calclulate second derivatives and D*/
f_xx: diff(partialx,x);                              
f_yy: expand(diff(partialy,y));
f_xy: diff(partialy,x);
D: f_xx*f_yy-(f_xy)^2;]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>{{@tacoords1@}, {@ta1@}}</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>1</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>1</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>matrix</type>
      <tans>tacoords1</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>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>dropdown</type>
      <tans>ta1</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>
    <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>ans1</sans>
        <tans>tacoords1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.5000000</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/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans2</sans>
        <tans>first(mcq_correct(ta1))</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-2-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You found the correct stationary point, but not its correct nature.<br></p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>tacoords1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_correct(ta1))</value>
      </testinput>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ev(matrix([0, 0]),simp)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_incorrect(ta1))</value>
      </testinput>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>tacoords1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>first(mcq_incorrect(ta1))</value>
      </testinput>
      <expected>
        <name>prt2</name>
        <expectedscore>0.5000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-2-F</expectedanswernote>
      </expected>
    </qtest>
    <hint format="html">
      <text>(Hint: you need to simplify sin(t^3 + 1))</text>
    </hint>
  </question>
</quiz>
