// Numbas version: finer_feedback_settings {"name": "Pedro A.'s copy of 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": [{"functions": {}, "ungrouped_variables": [], "name": "Pedro A.'s copy of Find the value from the derivatives", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

Alternatively, 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}.\\]

", "rulesets": {}, "parts": [{"stepsPenalty": "0.1", "prompt": "

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

", "allowFractions": false, "variableReplacements": [], "maxValue": "valueA", "minValue": "valueA", "variableReplacementStrategy": "originalfirst", "steps": [{"vsetrangepoints": 5, "prompt": "

As you are being asked for a cubic, your function is of the form $p(x)=a x^3+b x^2+c x+ d$. You may compute the formal derivative $p'(x)$ of $p(x)$ and then evaluate it in the given points. 

\n

What is the expression of $p'(x)$?

", "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "3*a*x^2+2*b*x+c", "marks": "0.1", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "prompt": "

Now you can compute the second derivative of $p(x)=a x^3+b x^2+c x+ d$.

\n

What is $p''(x)$?

", "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "6*a*x+2*b", "marks": "0.1", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "prompt": "

Now you can compute the third derivative of $p(x)=a x^3+b x^2+c x+ d$.

\n

What is $p^{(3)}(x)$?

", "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "6*a", "marks": "0.1", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "prompt": "

We now start computing the actual values of the coefficients of $p(x)=a x^3+b x^2+c x+ d$. Since you know $p^{(3)}(x)$ and $p^{(3)}(\\var{pointQ})$, you can compute $a$.

\n

What is $a$?

", "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{coeffs[3]}", "marks": "0.1", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "prompt": "

Then you can compute $b$ from the expression of $p''(x)$.

\n

What is $b$?

", "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{coeffs[2]}", "marks": "0.1", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "prompt": "

Next calculate $c$ from the value of $p'(x)$ at $\\var{pointQ}$.

\n

What is $c$?

", "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{coeffs[1]}", "marks": "0.1", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "prompt": "

Finally, compute $c$ from the value of $p(x)$ at $\\var{pointQ}$.

\n

What is $d$?

", "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{coeffs[0]}", "marks": "0.1", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "prompt": "

Now that you have all the coefficients of the polynomial $p(x)$, what is the value of $p(x)$ at $\\var{pointQ}$?

", "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{valueA}", "marks": "0.1", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "correctAnswerStyle": "plain"}], "extensions": [], "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*}\\]

", "variable_groups": [{"variables": ["coeffs"], "name": "Function"}, {"variables": ["pointA", "valueA"], "name": "Answer point"}, {"variables": ["pointQ", "derivs"], "name": "Question point"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"coeffs": {"definition": "repeat(random(-5..5 except 0),4)", "templateType": "anything", "group": "Function", "name": "coeffs", "description": ""}, "pointA": {"definition": "random(-5..5 except 0)", "templateType": "anything", "group": "Answer point", "name": "pointA", "description": ""}, "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", "group": "Question point", "name": "derivs", "description": ""}, "valueA": {"definition": "sum(map(coeffs[n]*pointA^n,n,0..length(coeffs)-1))", "templateType": "anything", "group": "Answer point", "name": "valueA", "description": ""}, "pointQ": {"definition": "random(-5..5 except [0,pointA])", "templateType": "anything", "group": "Question point", "name": "pointQ", "description": ""}}, "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"}, "type": "question", "contributors": [{"name": "Pedro A. Garc\u00eda-S\u00e1nchez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1217/"}]}]}], "contributors": [{"name": "Pedro A. Garc\u00eda-S\u00e1nchez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1217/"}]}