// Numbas version: exam_results_page_options {"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": {"y2": {"definition": "a+c", "templateType": "anything", "name": "y2", "description": "", "group": "Ungrouped variables"}, "b": {"definition": "random(-5..5 except [0,a,-a])", "templateType": "anything", "name": "b", "description": "", "group": "Ungrouped variables"}, "x2": {"definition": "random(-3..3 except -1..1)", "templateType": "anything", "name": "x2", "description": "", "group": "Ungrouped variables"}, "c": {"definition": "random(1..4)", "templateType": "anything", "name": "c", "description": "", "group": "Ungrouped variables"}, "ans": {"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))", "templateType": "anything", "name": "ans", "description": "", "group": "Ungrouped variables"}, "a": {"definition": "random(-4..5 except 0)", "templateType": "anything", "name": "a", "description": "", "group": "Ungrouped variables"}}, "extensions": ["jsxgraph"], "functions": {"eqnline": {"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;", "parameters": [["a", "number"], ["b", "number"], ["x2", "number"], ["y2", "number"]], "language": "javascript", "type": "html"}}, "statement": "

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

\n

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

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

Find the area under a porabola.

"}, "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}}$

", "variablesTest": {"maxRuns": "10000", "condition": "{a}>{b}\nand\n{y2}-1>{a}\nand {y2}<3*{a}"}, "preamble": {"js": "", "css": ""}, "tags": [], "parts": [{"variableReplacementStrategy": "originalfirst", "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.

", "showFeedbackIcon": true, "checkingaccuracy": "0.01", "marks": "1", "expectedvariablenames": [], "answersimplification": "all,fractionnumbers", "type": "jme", "checkingtype": "absdiff", "variableReplacements": [], "scripts": {}, "vsetrange": [0, 1], "showCorrectAnswer": true, "checkvariablenames": false, "showpreview": true, "vsetrangepoints": 5, "answer": "{ans}"}], "rulesets": {}, "ungrouped_variables": ["a", "x2", "b", "y2", "c", "ans"], "name": "Area under the curve - above x-axis", "type": "question", "contributors": [{"name": "Jean jinhua Mathias", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/353/"}]}]}], "contributors": [{"name": "Jean jinhua Mathias", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/353/"}]}