// Numbas version: finer_feedback_settings {"name": "Find the value from the derivatives", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"js": "", "css": ""}, "tags": [], "ungrouped_variables": [], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0, "name": ""}], "variable_groups": [{"variables": ["coeffs"], "name": "Function"}, {"variables": ["pointA", "valueA"], "name": "Answer point"}, {"variables": ["pointQ", "derivs"], "name": "Question point"}], "rulesets": {}, "type": "question", "advice": "

Having been given the derivatives at a point $a = \\var{pointQ}$, we can reconstruct the cubic function using Taylor's theorem: since

\n

\\[\\begin{align*}p(x) &= \\sum_{i=0}^3 \\frac{p^{(i)}(a)}{i!} (x-a)^i \\\\ &= \\frac{\\var{derivs[0]}}{0!}(\\simplify{x-{pointQ}})^0 + \\frac{\\var{derivs[1]}}{1!} (\\simplify{x-{pointQ}})^1 + \\frac{\\var{derivs[2]}}{2!} (\\simplify{x-{pointQ}})^2 + \\frac{\\var{derivs[3]}}{3!} (\\simplify{x-{pointQ}})^3 \\\\ &= \\simplify[all,!collectNumbers,!noLeadingMinus]{{derivs[0]} + {derivs[1]} (x-{pointQ}) + {derivs[2]}/2 (x-{pointQ})^2 + {derivs[3]}/6 (x-{pointQ})^3},\\end{align*}\\]

\n

into which we can then substitute $x = \\var{pointA}$ in order to find $p(\\var{pointA}) = \\var{valueA}$.

\n

If you expanded the brackets to find the function in its simplest form, you should have obtained

\n

\\[p(x) = \\simplify[all,!collectNumbers,!noLeadingMinus]{{coeffs[0]} + {coeffs[1]} x + {coeffs[2]} x^2 + {coeffs[3]} x^3}\\]

", "parts": [{"allowFractions": false, "variableReplacements": [], "prompt": "

What is $p(\\var{pointA})$?

", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "marks": 1, "showCorrectAnswer": true, "minValue": "valueA", "type": "numberentry", "scripts": {}, "maxValue": "valueA"}], "showQuestionGroupNames": false, "statement": "

I am thinking of a cubic function. Its derivatives at $a = \\var{pointQ}$ are the following:

\n

\\[\\begin{align*} p(\\var{pointQ}) &= \\var{derivs[0]}; \\\\ p^{(1)}(\\var{pointQ}) &= \\var{derivs[1]}; \\\\ p^{(2)}(\\var{pointQ}) &= \\var{derivs[2]}; \\text{ and} \\\\ p^{(3)}(\\var{pointQ}) &= \\var{derivs[3]}. \\end{align*}\\]

", "variables": {"pointQ": {"description": "", "group": "Question point", "name": "pointQ", "definition": "random(-5..5 except [0,pointA])", "templateType": "anything"}, "valueA": {"description": "", "group": "Answer point", "name": "valueA", "definition": "sum(map(coeffs[n]*pointA^n,n,0..length(coeffs)-1))", "templateType": "anything"}, "derivs": {"description": "", "group": "Question point", "name": "derivs", "definition": "map(sum(map(fact(k)*coeffs[k]*pointQ^(k-s)/fact(k-s),k,s..length(coeffs)-1)),s,0..length(coeffs)-1)", "templateType": "anything"}, "coeffs": {"description": "", "group": "Function", "name": "coeffs", "definition": "repeat(random(-5..5 except 0),4)", "templateType": "anything"}, "pointA": {"description": "", "group": "Answer point", "name": "pointA", "definition": "random(-5..5 except 0)", "templateType": "anything"}}, "metadata": {"description": "

Given the derivatives of a cubic function at a point, find the value of the function at another point.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "functions": {}, "extensions": [], "name": "Find the value from the derivatives", "contributors": [{"name": "Philip Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/362/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Philip Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/362/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}