// Numbas version: finer_feedback_settings {"name": "Area under the curve - above x-axis", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"b": {"templateType": "anything", "name": "b", "description": "", "definition": "random(-5..5 except [0,a,-a])", "group": "Ungrouped variables"}, "c": {"templateType": "anything", "name": "c", "description": "", "definition": "random(1..4)", "group": "Ungrouped variables"}, "ans": {"templateType": "anything", "name": "ans", "description": "", "definition": "(({y2})^3/3-({a}+{b})({y2})^2/2+{a}*{b}*({y2}))-(({a}+1)^3/3-({a}+{b})({a}+1)^2/2+{a}*{b}*({a}+1))", "group": "Ungrouped variables"}, "a": {"templateType": "anything", "name": "a", "description": "", "definition": "random(-4..5 except 0)", "group": "Ungrouped variables"}, "y2": {"templateType": "anything", "name": "y2", "description": "", "definition": "a+c", "group": "Ungrouped variables"}, "x2": {"templateType": "anything", "name": "x2", "description": "", "definition": "random(-3..3 except -1..1)", "group": "Ungrouped variables"}}, "statement": "

{eqnline(a,b,x2,y2)}

\n

You are given a quadratic graph of $\\simplify{y = x^2-({a}+{b})x+{a}{b}}$

", "name": "Area under the curve - above x-axis", "parts": [{"vsetRangePoints": 5, "customMarkingAlgorithm": "", "showPreview": true, "extendBaseMarkingAlgorithm": true, "customName": "", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "failureRate": 1, "valuegenerators": [], "showFeedbackIcon": true, "prompt": "

Find the area under the curve from $x=\\simplify{({a}+1)}$ to $x=\\simplify{{y2}}$

\n

Give your answer accurate to 2 decimal places.

", "marks": "1", "checkVariableNames": false, "answerSimplification": "all,fractionnumbers", "vsetRange": [0, 1], "checkingAccuracy": "0.01", "answer": "{ans}", "showCorrectAnswer": true, "scripts": {}, "type": "jme", "unitTests": [], "useCustomName": false, "variableReplacements": []}], "functions": {"eqnline": {"language": "javascript", "parameters": [["a", "number"], ["b", "number"], ["x2", "number"], ["y2", "number"]], "type": "html", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n \n// The line is described by the equation \n// y = a*x + b\n\n// This function takes as its parameters the coefficients a and b,\n// and the coordinates (x2,y2) of a point on the line.\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n{boundingBox: [-13,22,13,-22],\n axis: false,\n showNavigation: false,\n grid: true\n});\n \n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,2],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,2],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n// mark the two given points - one on the y-axis, and one at (x2,y2)\n\n\n\n\nboard.create('functiongraph',[function(x){ return (x-a)*(x-b);},-13,13]);\n\nboard.create('segment',[[a+1,0],[a+1,a+1-b]]);\nboard.create('segment',[[y2,0],[y2,y2*y2-y2*b-y2*a+a*b]]);\n\n\n\nreturn div;"}}, "rulesets": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "tags": [], "variablesTest": {"maxRuns": "10000", "condition": "{a}>{b}\nand\n{y2}-1>{a}\nand {y2}<3*{a}"}, "extensions": ["jsxgraph"], "ungrouped_variables": ["a", "x2", "b", "y2", "c", "ans"], "advice": "

Recall that the area under a curve $f(x)$ between $x=a$ and $x=b$ is given by $\\int^b_a f(x) \\mathrm{d}x$

\n

Hence we calculate $\\int^\\var{y2}_\\simplify{{a}+1} (\\simplify{-x^2+({a}+{b})x-{a}{b}}) \\mathrm{d}x = \\simplify[all,fractionnumbers]{(({y2})^3/3-({a}+{b})({y2})^2/2+{a}{b}({y2}))-(({a}+1)^3/3-({a}+{b})({a}+1)^2/2+{a}{b}({a}+1))={ans}}$

", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Find the area under a porabola.

"}, "type": "question", "contributors": [{"name": "Jinhua Mathias", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/353/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Jinhua Mathias", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/353/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}