// Numbas version: finer_feedback_settings {"name": "Integration: Setting up the integral to calculate the area under a graph", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "

For each graph, determine the integral that corresponds to the shaded areas.

", "variables": {"b3": {"name": "b3", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "a3+random(3..4)"}, "x42": {"name": "x42", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "b4"}, "c4": {"name": "c4", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "b4+2"}, "x11": {"name": "x11", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(1..2)"}, "x12": {"name": "x12", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(1..4) + x11"}, "a1": {"name": "a1", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "1"}, "x21": {"name": "x21", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(-4..-2)"}, "a2": {"name": "a2", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "1"}, "x22": {"name": "x22", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(1..4 except 2)+x21"}, "a3": {"name": "a3", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(-3..-1)"}, "x32": {"name": "x32", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "b3"}, "a4": {"name": "a4", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(-3..-2)"}, "x41": {"name": "x41", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "a4"}, "b4": {"name": "b4", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "a4+random(2..3)"}, "c2": {"name": "c2", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(1..2)"}, "x31": {"name": "x31", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "b3-random(2..3)"}, "b1": {"name": "b1", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(1..3)"}}, "ungrouped_variables": ["x11", "x12", "a1", "b1", "x21", "x22", "a2", "c2", "a3", "b3", "x31", "x32", "a4", "b4", "c4", "x41", "x42"], "advice": "

Here are the key notational facts needed to do this question:

\n

1) The numbers at the top and bottom of the integral symbol correspond to the maximum and minimum $x$-coordinates of the shaded regions.

\n

2) Integration treats certain areas as `negative areas'.  When this happens, you need to correct for this by taking the minus of the appropriate integral.

\n

3) Swapping the two numbers in the integral has the same effect as multiplying by -1.  E.g. $\\int^0_1 x \\, dx = -\\int^1_0 x \\, dx$.

", "extensions": ["jsxgraph"], "preamble": {"js": "", "css": ""}, "name": "Integration: Setting up the integral to calculate the area under a graph", "variable_groups": [], "functions": {"plotgraph": {"type": "html", "parameters": [["q", "number"], ["x1", "number"], ["x2", "number"], ["ymin", "number"], ["ymax", "number"], ["a", "number"], ["b", "number"], ["c", "number"]], "definition": "// Shading under a graph! This functions plots a graph of y = a(x-r1)(x-r2)\n// It creates the board, sets it up, then returns an\n// HTML div tag containing the board.\n\n\n// Max and min x and y values for the axis.\nvar xmin = -7;\nvar xmax = 7;\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '300px',\n '250px',\n {\n boundingBox: [xmin,ymax,xmax,ymin],\n axis: false,\n showNavigation: false,\n grid: true\n }\n);\n\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar brd = div.board; \n\n// create the x-axis.\nvar xaxis = brd.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = brd.create('ticks',[xaxis,1],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = brd.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\n/*var yticks = brd.create('ticks',[yaxis,1],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n*/\n\n\n// This function shades in the area below the graph of f\n// between the x values x1 and x2\n\nvar shade = function(f,x1,x2,colour) {\n var dataX1 = [x1,x1];\n var dataY1 = [0,f(x1)];\n\n var dataX2 = [];\n var dataY2 = [];\n for (var i = x1; i <= x2; i = i+0.1) {\n dataX2.push(i);\n dataY2.push(f(i));\n }\n\n var dataX3 = [x2,x2];\n var dataY3 = [f(x2),0];\n\n dataX = dataX1.concat(dataX2).concat(dataX3);\n dataY = dataY1.concat(dataY2).concat(dataY3);\n\nvar shading = brd.create('curve', [dataX,dataY],{strokeWidth:0, fillColor:colour, fillOpacity:0.2});\n\nreturn shading;\n}\n\n\n//Define your functions\nvar f1 = function(x) {\n return a*x+b;\n}\n\nvar f2 = function(x) {\n return a*x*x + c;\n}\n\nvar f3 = function(x) {\n return 0.5*(x-a)*(x-b);\n}\n\nvar f4 = function(x) {\n return 0.5*(x-a)*(x-b)*(x-c);\n}\n\n\n//Plot the graph and do shading\nswitch(q) {\n case 1:\n brd.create('functiongraph', [f1]);\n shade(f1,x1,x2, 'red');\n break;\n case 2:\n brd.create('functiongraph', [f2]);\n shade(f2,x1,x2,'red');\n shade(f2,x2,x2+2,'green');\n break;\n case 3:\n brd.create('functiongraph', [f3]);\n shade(f3,x1,x2,'red');\n shade(f3,x2,x2+2,'green');\n break;\n case 4:\n brd.create('functiongraph', [f4]);\n shade(f4,x1,x2,'red');\n shade(f4,x2,x2+2,'green');\n break\n}\n\n\n\nreturn div;", "language": "javascript"}}, "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Graphs are given with areas underneath them shaded. The student is asked to select or enter the correct integral which calculates its area.

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"gaps": [{"displayColumns": 0, "distractors": ["", "", "", ""], "variableReplacements": [], "type": "1_n_2", "minMarks": "1", "matrix": ["1", 0, 0, 0], "maxMarks": "1", "choices": ["

$\\int^{\\var{x12}}_{\\var{x11}}\\simplify{{a1}*x + {b1}} \\,dx$

", "

$\\int^{\\var{x11}}_{\\var{x12}}\\simplify{{b1}*x + {a1}} \\,dx$

", "

-$\\int^{\\var{x12}}_{\\var{x11}}\\simplify{{a1}*x + {b1}} \\,dx$

", "

$\\int \\simplify{{a1}*x + {b1}} \\,dx$

"], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "shuffleChoices": true, "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}}, {"displayColumns": 0, "distractors": ["", "", "", ""], "variableReplacements": [], "type": "1_n_2", "minMarks": "1", "matrix": ["1", 0, 0, 0], "maxMarks": "1", "choices": ["

$\\int^{\\var{x22}}_{\\var{x21}}\\simplify{{a2}*x^2 + {c2}} \\,dx$

", "

$\\int^{\\var{x22+2}}_{\\var{x22}}\\simplify{{a2}*x^2 + {c2}} \\,dx$

", "

$\\int^{\\var{x22+2}}_{\\var{x21}}\\simplify{{a2}*x^2 + {c2}} \\,dx$

", "

$\\int^{\\var{x21}}_{\\var{x22}} \\simplify{{a2}*x^2 + {c2}} \\,dx$

"], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "shuffleChoices": true, "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}}, {"displayColumns": 0, "distractors": ["", "", "", ""], "variableReplacements": [], "type": "1_n_2", "minMarks": "1", "matrix": ["0", "0", "1", 0], "maxMarks": "1", "choices": ["

$\\int^{\\var{x22}}_{\\var{x21}}\\simplify{{a2}*x^2 + {c2}} \\,dx$

", "

$\\int^{\\var{x22+2}}_{\\var{x22}}\\simplify{{a2}*x^2 + {c2}} \\,dx$

", "

$\\int^{\\var{x22+2}}_{\\var{x21}}\\simplify{{a2}*x^2 + {c2}} \\,dx$

", "

$\\int \\simplify{{a2}*x^2 + {c2}} \\,dx$

"], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "shuffleChoices": true, "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}}, {"displayColumns": 0, "distractors": ["", "", "", ""], "variableReplacements": [], "type": "1_n_2", "minMarks": "1", "matrix": ["1", 0, 0, "0"], "maxMarks": "1", "choices": ["

$-\\int^{\\var{x32}}_{\\var{x31}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$\\int^{\\var{x32}}_{\\var{x31}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$-\\int^{\\var{x32+2}}_{\\var{x32}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$\\int^{\\var{x32+2}}_{\\var{x32}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

"], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "shuffleChoices": true, "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}}, {"displayColumns": 0, "distractors": ["", "", "", ""], "variableReplacements": [], "type": "1_n_2", "minMarks": "1", "matrix": ["0", 0, "0", "1"], "maxMarks": "1", "choices": ["

$-\\int^{\\var{x32}}_{\\var{x31}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$\\int^{\\var{x31}}_{\\var{x32}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$\\int^{\\var{x32}}_{\\var{x31}}\\frac{-1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$\\int^{\\var{x32}}_{\\var{x31}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

"], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "shuffleChoices": true, "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}}, {"displayColumns": 0, "distractors": ["", "", "", ""], "variableReplacements": [], "type": "1_n_2", "minMarks": "1", "matrix": ["0", 0, "1", "0"], "maxMarks": "1", "choices": ["

$\\int^{\\var{x32+2}}_{\\var{x31}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$-\\int^{\\var{x32+2}}_{\\var{x31}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$\\int^{\\var{x32+2}}_{\\var{x32}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx -\\int^{\\var{x32}}_{\\var{x31}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

", "

$\\int^{\\var{x32+2}}_{\\var{x32}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx + \\int^{\\var{x32}}_{\\var{x31}}\\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})} \\,dx$

"], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "shuffleChoices": true, "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}}, {"displayColumns": 0, "distractors": ["", "", "", ""], "variableReplacements": [], "type": "1_n_2", "minMarks": "1", "matrix": ["1", 0, 0, "0"], "maxMarks": "1", "choices": ["

$-\\int^{\\var{x42+2}}_{\\var{x42}}f(x) \\,dx$

", "

$\\int^{\\var{x42+2}}_{\\var{x42}}f(x) \\,dx$

", "

$-\\int^{\\var{x42}}_{\\var{x41}}f(x) \\,dx$

", "

$\\int^{\\var{x42}}_{\\var{x41}}f(x) \\,dx$

"], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "shuffleChoices": true, "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}}, {"displayColumns": 0, "distractors": ["", "", "", ""], "variableReplacements": [], "type": "1_n_2", "minMarks": "1", "matrix": ["0", 0, 0, "1"], "maxMarks": "1", "choices": ["

$-\\int^{\\var{x42+2}}_{\\var{x42}}f(x) \\,dx$

", "

$\\int^{\\var{x42}}_{\\var{x41}}f(x) \\,dx$

", "

$\\int^{\\var{x42+2}}_{\\var{x41}}f(x) \\,dx$

", "

$\\int^{\\var{x42}}_{\\var{x41}}f(x) \\,dx - \\int^{\\var{x42+2}}_{\\var{x42}}f(x) \\,dx$

"], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "marks": 0, "shuffleChoices": true, "displayType": "radiogroup", "showFeedbackIcon": true, "scripts": {}}], "showCorrectAnswer": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "type": "gapfill", "marks": 0, "prompt": "

(i) {plotgraph(1,x11,x12,-1,10,a1,b1,0)}

\n

This is the graph of the function $f(x) = \\simplify{{a1}*x+{b1}}$.

\n

Which integral corresponds to the area of the shaded region? [[0]]

\n

\n

(ii) {plotgraph(2,x21,x22,-5,25,a2,0,c2)}

\n

This is the graph of the function $f(x) = \\simplify{{a2}*x^2+{c2}}$.

\n

Which integral will calculate the area of the red region? [[1]]

\n

Which integral gives the total area of both shaded regions? [[2]]

\n

\n

(iii) {plotgraph(3,x31,x32,-3,7,a3,b3,0)}

\n

This curve has equation $y = \\frac{1}{2}\\simplify{(x-{a3})*(x-{b3})}$.

\n

Which integral gives the area of the red region? [[3]]

\n

Which of these integrals does not give the area of the red region? [[4]]

\n

Which of these calculates the total area of the two shaded regions? [[5]]

\n

\n

(iv) {plotgraph(4,x41,x42,-3,7,a4,b4,c4)}

\n

This is the graph of some function $f(x)$. 

\n

Which integral gives the area of the green region? [[6]]

\n

Which of the following gives the total area bound by $f(x)$ and $x$-axis? [[7]]

\n

", "showFeedbackIcon": true, "scripts": {}}], "tags": [], "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}