// Numbas version: exam_results_page_options {"name": "Area under the curve - below x-axis", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "extensions": ["jsxgraph"], "ungrouped_variables": ["a", "x2", "b", "y2", "c", "ans"], "functions": {"eqnline": {"language": "javascript", "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;", "parameters": [["a", "number"], ["b", "number"], ["x2", "number"], ["y2", "number"]]}}, "metadata": {"description": "

Find the area under a curve. The step is given.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

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

\n

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

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

\n

Note that the area under the curve is always positive yet out answer here is negative, so we must remember to multiply our answer by $-1$

", "preamble": {"css": "", "js": ""}, "parts": [{"checkingtype": "absdiff", "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.

", "answersimplification": "all,fractionnumbers", "steps": [{"type": "information", "scripts": {}, "prompt": "

You need to find the integral of $\\simplify{y =-x^2+({a}+{b})x-{a}{b}}$, then the definite inegral by substituting $x=\\simplify{({a}+1)}$ to $x=\\simplify{{y2}}$.

\n

Remember the answer is negative because the area is below the x-axis. You need to give the positive answer.

", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "showFeedbackIcon": true}], "showpreview": true, "expectedvariablenames": [], "answer": "-{ans}", "marks": "1", "showFeedbackIcon": true, "type": "jme", "scripts": {}, "stepsPenalty": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "checkingaccuracy": "0.01", "checkvariablenames": false, "variableReplacements": [], "vsetrangepoints": 5, "vsetrange": [0, 1]}], "variables": {"x2": {"group": "Ungrouped variables", "name": "x2", "definition": "random(-3..3 except -1..1)", "templateType": "anything", "description": ""}, "ans": {"group": "Ungrouped variables", "name": "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", "description": ""}, "a": {"group": "Ungrouped variables", "name": "a", "definition": "random(-4..5 except 0)", "templateType": "anything", "description": ""}, "c": {"group": "Ungrouped variables", "name": "c", "definition": "random(1..4)", "templateType": "anything", "description": ""}, "y2": {"group": "Ungrouped variables", "name": "y2", "definition": "a+c", "templateType": "anything", "description": ""}, "b": {"group": "Ungrouped variables", "name": "b", "definition": "random(-5..5 except [0,a,-a])", "templateType": "anything", "description": ""}}, "variablesTest": {"maxRuns": "10000", "condition": "{a}>{b}\nand\n{y2}-1>{a}\nand {y2}<3*{a}"}, "tags": [], "name": "Area under the curve - below x-axis", "variable_groups": [], "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/"}]}