// Numbas version: exam_results_page_options {"name": "Anna's copy of Maria's copy of Integration: Calculating the area under a curve", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"extensions": ["jsxgraph"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Two quadratic graphs are sketched with some area beneath them shaded. Question is to determine the area of shaded regions using integration. The first graph's area is all above the $x$-axis. The second graph has some area above and some below the $x$-axis.

"}, "statement": "

This is a non-calculator question.

", "functions": {"plotgraph": {"type": "html", "parameters": [["q", "number"], ["x1", "number"], ["x2", "number"], ["ymin", "number"], ["ymax", "number"], ["a", "number"], ["b", "number"], ["c", "number"]], "language": "javascript", "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 '500px',\n '500px',\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 });\nyticks = brd.create('ticks',[yaxis,5],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 4\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 (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 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;"}}, "rulesets": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"x22": {"templateType": "anything", "name": "x22", "description": "", "group": "b) quadratic. no neg region", "definition": "random(3..5)+x21"}, "b3": {"templateType": "anything", "name": "b3", "description": "", "group": "c quadratic. neg region", "definition": "a3+random(3..4)"}, "b1": {"templateType": "anything", "name": "b1", "description": "", "group": "linear graph (not used)", "definition": "random(1..3)"}, "x33": {"templateType": "anything", "name": "x33", "description": "", "group": "c quadratic. neg region", "definition": "x32+2"}, "c2": {"templateType": "anything", "name": "c2", "description": "", "group": "b) quadratic. no neg region", "definition": "random(1..4)"}, "x42": {"templateType": "anything", "name": "x42", "description": "", "group": "Ungrouped variables", "definition": "b4"}, "x32": {"templateType": "anything", "name": "x32", "description": "", "group": "c quadratic. neg region", "definition": "b3"}, "b4": {"templateType": "anything", "name": "b4", "description": "", "group": "Ungrouped variables", "definition": "a4+random(2..3)"}, "x21": {"templateType": "anything", "name": "x21", "description": "", "group": "b) quadratic. no neg region", "definition": "random(-4..-2)"}, "a2": {"templateType": "anything", "name": "a2", "description": "", "group": "b) quadratic. no neg region", "definition": "1"}, "x41": {"templateType": "anything", "name": "x41", "description": "", "group": "Ungrouped variables", "definition": "a4"}, "a1": {"templateType": "anything", "name": "a1", "description": "", "group": "linear graph (not used)", "definition": "1"}, "a4": {"templateType": "anything", "name": "a4", "description": "", "group": "Ungrouped variables", "definition": "random(-3..-2)"}, "x12": {"templateType": "anything", "name": "x12", "description": "", "group": "linear graph (not used)", "definition": "random(1..4) + x11"}, "c4": {"templateType": "anything", "name": "c4", "description": "", "group": "Ungrouped variables", "definition": "b4+2"}, "a3": {"templateType": "anything", "name": "a3", "description": "", "group": "c quadratic. neg region", "definition": "random(-3..-1)"}, "area2": {"templateType": "anything", "name": "area2", "description": "", "group": "b) quadratic. no neg region", "definition": "(a2*x22^3/3+c2*x22)-(a2*x21^3/3+c2*x21)"}, "area3": {"templateType": "anything", "name": "area3", "description": "", "group": "c quadratic. neg region", "definition": "(x33^3/3 - 0.5*(a3+b3)*x33^2+a3*b3*x33)-2*(x32^3/3 - 0.5*(a3+b3)*x32^2+a3*b3*x32)+(x31^3/3 - 0.5*(a3+b3)*x31^2+a3*b3*x31)"}, "x31": {"templateType": "anything", "name": "x31", "description": "", "group": "c quadratic. neg region", "definition": "b3-random(2..3)"}, "x11": {"templateType": "anything", "name": "x11", "description": "", "group": "linear graph (not used)", "definition": "random(1..2)"}}, "ungrouped_variables": ["a4", "b4", "c4", "x41", "x42"], "tags": [], "preamble": {"js": "", "css": ""}, "variable_groups": [{"name": "linear graph (not used)", "variables": ["x11", "x12", "a1", "b1"]}, {"name": "b) quadratic. no neg region", "variables": ["x21", "x22", "a2", "c2", "area2"]}, {"name": "c quadratic. neg region", "variables": ["a3", "b3", "x31", "x32", "x33", "area3"]}], "advice": "

See Lecture 13.3 and 13.5 for background knowledge and examples.  (You may need 13.1 and 12.3 for more background knowledge).

\n

Main advice is to go through the steps given in lectures: make an estimate, establish the integral(s) required, do the calculations, check your answer.

", "name": "Anna's copy of Maria's copy of Integration: Calculating the area under a curve", "parts": [{"gaps": [{"mustBeReducedPC": 0, "correctAnswerFraction": true, "maxValue": "area2", "showFeedbackIcon": true, "showCorrectAnswer": true, "showFractionHint": true, "marks": "2", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "minValue": "area2", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "scripts": {}, "customName": "", "correctAnswerStyle": "plain", "variableReplacements": [], "useCustomName": false, "allowFractions": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "unitTests": []}], "sortAnswers": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "marks": 0, "prompt": "

{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

Use integration to calculate the area of the shaded region. Give your answer without any rounding.

\n

[[0]]

", "variableReplacementStrategy": "originalfirst", "type": "gapfill", "scripts": {}, "customName": "", "variableReplacements": [], "useCustomName": false, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "unitTests": []}, {"stepsPenalty": 0, "gaps": [{"mustBeReducedPC": 0, "correctAnswerFraction": true, "maxValue": "area3", "showFeedbackIcon": true, "showCorrectAnswer": true, "showFractionHint": true, "marks": "4", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "minValue": "area3", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "scripts": {}, "customName": "", "correctAnswerStyle": "plain", "variableReplacements": [], "useCustomName": false, "allowFractions": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "unitTests": []}], "sortAnswers": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "marks": 0, "prompt": "

{plotgraph(3,x31,x32,-6,15,a3,b3,0)}

\n

This curve has equation $y = \\simplify{x^2-{a3+b3}*x + {a3*b3}}$.

\n

\n

Calculate the total area of the shaded regions. Give your answer without any rounding.

\n

$A = $[[0]]

\n

\n

", "variableReplacementStrategy": "originalfirst", "type": "gapfill", "scripts": {}, "customName": "", "variableReplacements": [], "useCustomName": false, "extendBaseMarkingAlgorithm": true, "steps": [{"showFeedbackIcon": true, "showCorrectAnswer": true, "marks": 0, "variableReplacementStrategy": "originalfirst", "type": "information", "scripts": {}, "customName": "", "variableReplacements": [], "useCustomName": false, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "unitTests": []}], "customMarkingAlgorithm": "", "unitTests": []}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Anna Strzelecka", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2945/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Anna Strzelecka", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2945/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}