// Numbas version: finer_feedback_settings {"name": "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": [{"name": "Integration: Area bounded by the graph of a cubic", "tags": [], "metadata": {"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
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "This is a calculator question.
\n--------------------------
", "advice": "See 13.3, 14.1, and 14.3 for background on areas and (in)definite integration. See previous lectures for differentiation and integration.
\n\n\n\nAs this is a trickier question, here is some detailed advice:
\n1) Remember to estimate the answer, to help detect errors.
\n\n\n2) 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}$.
\nI label these numbers $a$ and $b$ (so I don't have to keep writing them). Also, use your calculator's memory abilities so you don't have to type the numbers over and over again.
\n\n\n3) I then set up the appropriate integral(s) to calculate the area:
\nArea $ = \\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\n4) After doing the integration and plugging-in the numbers, you should get $\\var{area_total2}$, which is $\\var{area_total}$, to 3.s.f.
", "rulesets": {}, "extensions": ["jsxgraph"], "variables": {"area_total": {"name": "area_total", "group": "Ungrouped variables", "definition": "siground(area1+area2,3)", "description": "", "templateType": "anything"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-5..-1#0.1)", "description": "", "templateType": "anything"}, "test": {"name": "test", "group": "Ungrouped variables", "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))))", "description": "", "templateType": "anything"}, "area_total2": {"name": "area_total2", "group": "Ungrouped variables", "definition": "area1+area2", "description": "", "templateType": "anything"}, "xmax": {"name": "xmax", "group": "Ungrouped variables", "definition": "(-b + sqrt(b*b-4*a*c))/(2*a)", "description": "", "templateType": "anything"}, "area1": {"name": "area1", "group": "Ungrouped variables", "definition": "-(1/4*a*xmin^4+1/3*b*xmin^3+1/2*c*xmin^2)", "description": "", "templateType": "anything"}, "xmin": {"name": "xmin", "group": "Ungrouped variables", "definition": "(-b - sqrt(b*b-4*a*c))/(2*a)", "description": "", "templateType": "anything"}, "area2": {"name": "area2", "group": "Ungrouped variables", "definition": "-(1/4*a*xmax^4+1/3*b*xmax^3+1/2*c*xmax^2)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1..3)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "test=1", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "xmax", "xmin", "area1", "area2", "area_total", "test", "area_total2"], "variable_groups": [], "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 = -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;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "{plotgraph(4,xmin,xmax,-10,10,a,b,c)}
\nThis is the graph of the function $f(x)=\\simplify{{a}x^3+{b}x^2+{c}x}$.
\n\nWhat is the area bounded by the graph and the $x$-axis (i.e. the total area of the shaded regions)? [[0]]
\nHint: you need to determine the $x$-intercepts before you can do any integration.
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "4", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "{area_total}", "maxValue": "{area_total}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "sigfig", "precision": "3", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "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/"}]}