// Numbas version: exam_results_page_options {"name": "Maria's copy of Integration: Calculating the area under a curve. Needs integration by parts.", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"plotgraph": {"parameters": [["q", "number"], ["x1", "number"], ["x2", "number"], ["ymin", "number"], ["ymax", "number"], ["a", "number"], ["b", "number"], ["c", "number"]], "type": "html", "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 = -1;\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 x*Math.exp(a*x);\n}\n\nvar f2 = function(x) {\n return a*x*x + c;\n}\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}\n\n\n\nreturn div;"}}, "parts": [{"type": "gapfill", "gaps": [{"answer": "{area1_exact}", "type": "jme", "customMarkingAlgorithm": "", "showCorrectAnswer": true, "showPreview": true, "showFeedbackIcon": true, "vsetRange": [0, 1], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "scripts": {}, "answerSimplification": "fractionNumbers", "checkingAccuracy": 0.001, "checkVariableNames": false, "failureRate": 1, "marks": "4", "unitTests": [], "extendBaseMarkingAlgorithm": true, "expectedVariableNames": [], "checkingType": "absdiff", "vsetRangePoints": 5}, {"correctAnswerStyle": "plain", "type": "numberentry", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "minValue": "siground({area1},3)", "scripts": {}, "maxValue": "siground({area1},3)", "correctAnswerFraction": false, "customMarkingAlgorithm": "", "marks": "2", "unitTests": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0}], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "prompt": "

{plotgraph(1,0,x1,-2,ymax1,a1,0,0)}

\n

This is the graph of the function $f(x) = \\simplify[fractionNumbers]{x*e^({a1}*x)}$.

\n

Calculate the area of the shaded region.

\n

(i) Give your answer exactly, in terms of $e$. [[0]]

\n

(ii) (Calculator). Give your answer to 3 s.f. [[1]]

\n

", "scripts": {}, "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "extendBaseMarkingAlgorithm": true, "sortAnswers": false}], "extensions": ["jsxgraph"], "tags": [], "statement": "

This is a mix of calculator and non-calculator questions.

", "name": "Maria's copy of Integration: Calculating the area under a curve. Needs integration by parts.", "advice": "

See 13.1, 13.2, 13.3 and 13.5 for background on definite integrals and areas.  See 14.1 and 14.2 for integration by parts.

\n

Remember to do estimates to check for big mistakes.

", "variable_groups": [{"name": "(a)", "variables": ["x1", "a1", "ymax1", "area1_exact", "area1"]}], "preamble": {"css": "", "js": ""}, "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Function $f(x) = xe^{ax}$ is sketched and area shaded. Question is to determine the area under graph, exactly and (calculator) to 3 s.f. Area is above x-axis.

"}, "ungrouped_variables": [], "variables": {"area1": {"name": "area1", "definition": "(x1/a1-1/a1^2)*e^(a1*x1)+1/a1^2", "templateType": "anything", "description": "", "group": "(a)"}, "x1": {"name": "x1", "definition": "random(2..4)", "templateType": "anything", "description": "", "group": "(a)"}, "ymax1": {"name": "ymax1", "definition": "x1*e^(a1*x1)+5", "templateType": "anything", "description": "", "group": "(a)"}, "area1_exact": {"name": "area1_exact", "definition": "expression((x1/a1-1/a1^2)+\"*e^(\"+a1*x1+\")+\"+1/a1^2)", "templateType": "anything", "description": "", "group": "(a)"}, "a1": {"name": "a1", "definition": "random([0.1,0.2,0.25,0.5])", "templateType": "anything", "description": "", "group": "(a)"}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"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": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}