// Numbas version: exam_results_page_options {"name": "Maria's copy of Integration: Area bounded by the graph of a cubic", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"unitTests": [], "showCorrectAnswer": true, "prompt": "

{plotgraph(4,xmin,xmax,-10,10,a,b,c)}

\n

This is the graph of the function $f(x)=\\simplify{{a}x^3+{b}x^2+{c}x}$. 

\n

\n

What is the area bounded by the graph and the $x$-axis (i.e. the total area of the shaded regions)? [[0]]

\n

Hint: you need to determine the $x$-intercepts before you can do any integration.

", "extendBaseMarkingAlgorithm": true, "gaps": [{"unitTests": [], "notationStyles": ["plain", "en", "si-en"], "strictPrecision": false, "mustBeReducedPC": 0, "precisionType": "sigfig", "type": "numberentry", "showPrecisionHint": true, "customMarkingAlgorithm": "", "scripts": {}, "allowFractions": false, "precision": "3", "correctAnswerFraction": false, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "precisionPartialCredit": 0, "marks": "6", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showFeedbackIcon": true, "minValue": "{area_total}", "precisionMessage": "You have not given your answer to the correct precision.", "correctAnswerStyle": "plain", "mustBeReduced": false, "maxValue": "{area_total}"}], "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "sortAnswers": false, "variableReplacements": [], "type": "gapfill", "marks": 0, "scripts": {}}], "advice": "

See 12.3, 13.1, and 13.3 for background on the areas, integration and definite integration. See previous lectures for differentiation and integration.

\n

\n

\n

\n

As this is a particularly tricky question, here is some detailed advice:

\n

1) Remember that first, you should find an approximation for the answer.

\n

\n

\n

2) To find the minimum and maximum $x$-coordinates of the regions, you need to solve to $f(x)=0$. See Maths 1 for background on this.  One of the solutions is 0 and the other roots are $\\var{xmax}$ and $\\var{xmin}$.

\n

I label these numbers $a$ and $b$ (so I don't have to keep writing them).

\n

\n

\n

3) I then set up the appropriate integral(s) to calculate the area:

\n

Area $ = \\displaystyle \\int_{b}^0 \\simplify{{a}x^3+{b}x^2+{c}x} \\, dx - \\int^{a}_0 \\simplify{{a}x^3+{b}x^2+{c}x} \\, dx$

\n

\n

\n

4) After doing the integration and plugging-in the numbers, you should get $\\var{area_total2}$, which is $\\var{area_total}$, to 3.s.f.

", "ungrouped_variables": ["a", "b", "c", "xmax", "xmin", "area1", "area2", "area_total", "test", "area_total2"], "tags": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Question is to calculate the area bounded by a cubic and the $x$-axis. Requires finding the roots by solving a cubic equation. Calculator question

"}, "variablesTest": {"condition": "test=1", "maxRuns": 100}, "statement": "

This is a calculator question.

", "name": "Maria's copy of Integration: Area bounded by the graph of a cubic", "functions": {"plotgraph": {"language": "javascript", "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 = -4;\nvar xmax = 4;\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 });\nvar yticks = brd.create('ticks',[yaxis,1],{\ndrawLabels: true,\nlabel: {offset: [-20, 0.5]},\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 a*x*x*x+b*x*x+c*x;\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,0,'red');\n shade(f4,0,x2,'green');\n break\n}\n\n\n\nreturn div;", "type": "html"}}, "preamble": {"js": "", "css": ""}, "variables": {"test": {"description": "", "group": "Ungrouped variables", "name": "test", "definition": "if(mod(xmax,1)=0,0,\n if(mod(xmin,1)=0,0,\n if(area_total>15,0,\n if(min(xmax,abs(xmin))<0.5,0,1))))", "templateType": "anything"}, "c": {"description": "", "group": "Ungrouped variables", "name": "c", "definition": "random(-5..-1#0.1)", "templateType": "anything"}, "xmax": {"description": "", "group": "Ungrouped variables", "name": "xmax", "definition": "(-b + sqrt(b*b-4*a*c))/(2*a)", "templateType": "anything"}, "area2": {"description": "", "group": "Ungrouped variables", "name": "area2", "definition": "-(1/4*a*xmax^4+1/3*b*xmax^3+1/2*c*xmax^2)", "templateType": "anything"}, "xmin": {"description": "", "group": "Ungrouped variables", "name": "xmin", "definition": "(-b - sqrt(b*b-4*a*c))/(2*a)", "templateType": "anything"}, "area1": {"description": "", "group": "Ungrouped variables", "name": "area1", "definition": "-(1/4*a*xmin^4+1/3*b*xmin^3+1/2*c*xmin^2)", "templateType": "anything"}, "area_total2": {"description": "", "group": "Ungrouped variables", "name": "area_total2", "definition": "area1+area2", "templateType": "anything"}, "area_total": {"description": "", "group": "Ungrouped variables", "name": "area_total", "definition": "siground(area1+area2,3)", "templateType": "anything"}, "a": {"description": "", "group": "Ungrouped variables", "name": "a", "definition": "random(1..3)", "templateType": "anything"}, "b": {"description": "", "group": "Ungrouped variables", "name": "b", "definition": "random(-5..5 except 0)", "templateType": "anything"}}, "variable_groups": [], "extensions": ["jsxgraph"], "rulesets": {}, "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/"}]}