<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>5.1.2 Find trig coefficients (copy)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p></p>
<p>Find the values of \(a\) and \(b\) if the function \(f(x) = a \cos(x) + b \sin(x)\) satisfies \(f\left({@A@}\right) = {@C@}\) and \(f\left({@B@}\right) = {@D@}\).</p>
<p>\(a = \) [[input:ans1]]; [[validation:ans1]]</p>
<p>\(b =\)&nbsp;[[input:ans2]]. [[validation:ans2]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>The information given implies that\begin{align*}f\left({@A@}\right)&amp; = a\cos\left({@A@}\right) + b \sin\left({@A@}\right) = {@C@} \ \text{and}\\ f\left({@B@}\right) &amp;= a\cos\left({@B@}\right) + b \sin\left({@B@}\right)= {@D@}.\end{align*}Using the exact values of the trigonometric functions\begin{align*}\sin\left({@A@}\right) &amp;= {@sin(A)@}\\ \cos\left({@A@}\right) &amp; = {@cos(A)@} \\ \sin\left({@B@}\right) &amp; = {@sin(B)@} \ \text{and} \\ \cos\left({@B@}\right) &amp; = {@cos(B)@},\end{align*} we get the&nbsp; two simultaneous equations\begin{align*}{@eq1@}&amp; = {@C@}\\ {@eq2@}&amp; = {@D@}.\end{align*}&nbsp; The solutions to these are \(a= {@ta1@}\) and \(b = {@ta2@}\).<br></p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020081700</text>
    </stackversion>
    <questionvariables>
      <text>A:rand([-%pi,0,%pi]);
pm:rand([-1,1]);
Bmod:rand([%pi/6, %pi/4, %pi/3, %pi/2]);
B:pm*Bmod;
C:2+rand(4);
D:2+rand(4);
f:a*cos(x)+b*sin(x);
eq1:ev(f,x=A) ;
eq2:ev(f,x=B) ;
ta1:C/cos(A);
ta2:expand((D-ta1*cos(B))/sin(B));</text>
    </questionvariables>
    <specificfeedback format="html">
      <text>[[feedback:prt1]]</text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>{@eq1@} and {@eq2@} have solutions \(a= {@ta1@}\) and \(b= {@ta2@}\).</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>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>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>algebraic</type>
      <tans>ta2</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>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text>seq1: ans1*cos(A) + ans2*sin(A)
seq2: ans1*cos(B) + ans2*sin(B)
seq:abs(seq1-C)+abs(seq2-D);</text>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>seq</sans>
        <tans>0</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>0.1</falsepenalty>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>seq1</sans>
        <tans>C</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>2</truenextnode>
        <trueanswernote>prt1-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty>0.1</falsepenalty>
        <falsenextnode>2</falsenextnode>
        <falseanswernote>prt1-2-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>Your solutions do not satisfy the equation evaluated at \(x={@A@}\).</p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>2</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>seq2</sans>
        <tans>D</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-3-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-3-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>Your solutions do not satisfy the equation evaluated at \(x={@B@}\).<br></p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>784525964</deployedseed>
    <deployedseed>2040372985</deployedseed>
    <deployedseed>255838758</deployedseed>
    <deployedseed>2032492988</deployedseed>
    <deployedseed>743652843</deployedseed>
    <deployedseed>629409604</deployedseed>
    <deployedseed>366264562</deployedseed>
    <deployedseed>1381703111</deployedseed>
    <deployedseed>655377958</deployedseed>
    <deployedseed>1055625922</deployedseed>
    <deployedseed>1410503370</deployedseed>
    <deployedseed>1929740601</deployedseed>
    <deployedseed>1352663591</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2+1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.5000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-3-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1+1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-3-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
