// Numbas version: exam_results_page_options {"name": "Sheet 2 Q12 - Product rule with custom feedback", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Sheet 2 Q12 - Product rule with custom feedback", "tags": [], "metadata": {"description": "Product rule question with feedback given for anticipated student errors.", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "

Differentiate the function $s=x+x^{\\var{n}} \\cos (\\var{a}x+\\var{b})$.

", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"n": {"name": "n", "group": "Ungrouped variables", "definition": "random(3..8)", "description": "

power on the x

", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2..8)", "description": "

multiple of x

", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1..8 except a)", "description": "

constant to be added

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "a", "b"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\displaystyle \\frac{ds}{dx}= $ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "malrules:\n [\n [\"x-{a}x^{n}*sin({a}x+{b})+{n}x^{n-1}*cos({a}x+{b})\",\"Almost there! Don't forget to differentiate the first term (the $x$) as well!\"],\n [\"1-{a*n}*x^{n-1}*sin({a}x+{b})\", \"Take a closer look at the function you are asked to differentiate. Whenever you have something to do with $x$ multiplied by something else to do with $x$, you need the product rule.\"],\n [\"1-{n}x^{n-1}*sin({a})\", \"There are two issues here. Firstly, take a closer look at the function you are asked to differentiate. Whenever you have something to do with $x$ multiplied by something else to do with $x$, you need the product rule. Secondly, remember that the angle of a trigonometric function never changes when you differentiate!\"],\n [\"-{a}(x+x^{n})*sin({a}x+{b})+(1+{n}x^{n-1})*cos({a}x+{b})\", \"Be very careful when using the product rule how you decide what $u$ and $v$ are. If $s=(x+x^{\\\\var{n}})\\\\cos (\\\\var{a}x+\\\\var{b})$, then $u=x+x^{\\\\var{n}}$ and $v=\\\\cos (\\\\var{a}x+\\\\var{b})$. However, here, $s=x+x^{\\\\var{n}} \\\\cos (\\\\var{a}x+\\\\var{b})$ (i.e. there are no brackets). Therefore, $u=x^{\\\\var{n}}$ and $v=\\\\cos (\\\\var{a}x+\\\\var{b})$. The $x$ being added at the start is differentiated separately.\"],\n [\"-{a}(1+{n}x^{n-1})*sin({a}x+{b})\", \"Take a closer look at the function you are asked to differentiate. Whenever you have something to do with $x$ multiplied by something else to do with $x$, you need the product rule.\"],\n [\"-(1+{n}x^{n-1})*sin({a})\", \"Take a closer look at the function you are asked to differentiate. Whenever you have something to do with $x$ multiplied by something else to do with $x$, you need the product rule. Also, remember that the angle of a trigonometric function never changes when you differentiate!\"],\n [\"1+{a}x^{n}*sin({a}x+{b})+{n}x^{n-1}*cos({a}x+{b})\", \"Almost there! Double check the rule for differentiating $\\\\cos x$.\"],\n [\"1-x^{n}*sin({a}x+{b})+{n}x^{n-1}*cos({a}x+{b})\", \"You have used the correct rule for differentiating $\\\\cos x$, but when the angle is more complicated than $x$, what extra step do you need to include?\"],\n [\"1-x^{n}*sin({a})+{n}x^{n-1}*cos({a}x+{b})\",\"Remember, the angle in a trigonometric function never changes when you differentiate!\"],\n [\"1+x^{n}*sin({a})+{n}x^{n-1}*cos({a}x+{b})\",\"Remember, the angle in a trigonometric function never changes when you differentiate! Also, double check the rule for differentiating $\\\\cos x$.\"] \n ]\n \nparsed_malrules: \n map(\n [\"expr\":parse(x[0]),\"feedback\":x[1]],\n x,\n malrules\n )\n\nagree_malrules (Do the student's answer and the expected answer agree on each of the sets of variable values?):\n map(\n len(filter(not x ,x,map(\n try(\n resultsEqual(unset(question_definitions,eval(studentexpr,vars)),unset(question_definitions,eval(malrule[\"expr\"],vars)),settings[\"checkingType\"],settings[\"checkingAccuracy\"]),\n message,\n false\n ),\n vars,\n vset\n )))