// Numbas version: finer_feedback_settings {"name": "Integration: calculating areas in graphs using definite integration.", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "
Three graphs are given with areas underneath them shaded. The student is asked to calculate their areas, using integration. Q1 has a polynomial. Q2 has exponentials and fractional functions. Q3 requires solving a trig equation and integration by parts.
"}, "preamble": {"css": "", "js": ""}, "advice": "(i) Area $ = -\\int_{\\var{x11}}^0 \\simplify{{a1}*x^2+{b1}*x+{c1}} \\, dx +\\int^{\\var{x12}}_0 \\simplify{{a1}*x^2+{b1}*x+{c1}} \\, dx$
\n$ = -\\left[ \\simplify{ {a1}/3*x^3 + {b1}/2*x^2 + {c1}*x } \\right]_{\\var{x11}}^0 + \\left[\\simplify{ {a1}/3*x^3 + {b1}/2*x^2 + {c1}*x } \\right]^{\\var{x12}}_0 $
\n$ =-\\left[ (0) - (\\simplify{{a1}/3{x11}^3 +{b1}/2{x11}^2 +{c1}{x11}} ) \\right] + \\left[(\\simplify{{a1}/3({x12})^3 +{b1}/2({x12})^2 +{c1}{x12}}) -(0) \\right] $
\n$ = \\var{area1}$, to 3.s.f.
\n\n\n\n\n\n\n(ii) Area $ = \\int_{\\var{x21}}^{\\var{x22}} \\simplify{{a2}e^({b2}*x-3)+1/({c2}+x)} \\, dx$
\n$ = \\left[ \\simplify{{a2}/{b2}*e^({b2}*x-3) + ln(x+{c2}) } \\right]_{\\var{x21}}^{\\var{x22}}$
\n$ = \\var{area2}$, to 3.s.f.
\n\n\n\n\n\n\n(iii) First we need to work out the minimum and maximum $x$-values. The minimum can be read from the graph, it is $0$. The maximum is found by solving an equation:
\n$\\simplify{{a3}*x*sin(x/{b3})} =0$
\n$\\sin(\\frac{x}{\\var{b3}}) = 0 $
\n$\\simplify{x/{b3}} =\\ldots,-2\\pi, -\\pi,0,\\pi,2\\pi,3\\pi,\\ldots$, (obtained by looking at the graph of $\\sin(x)$)
\n$ x = \\ldots, -\\var{2*b3} \\pi, -\\var{b3}\\pi, 0 , \\var{b3}\\pi,\\var{2*b3}\\pi,\\var{2*b3}\\pi, \\ldots$. (These values were obtained by multiplying the previous line by $\\var{b3}$.)
\nWe need the smallest positive value, which is $\\var{b3}\\pi$.
\n\n\nNow we can set-up the integral:
\nArea $ = \\int^{\\var{b3}\\pi}_0 \\simplify{{a3}*x*sin(x/{b3})} \\, dx$.
\nTo integrate one can use integration by parts. First we let $u = x$ and $\\frac{dv}{dx}=\\simplify{{a3}sin(x/{b3})}$.
\nDifferentiating $u$ gives $\\frac{du}{dx} = 1$ and integrating gives $v = \\simplify{-{a3*b3}cos(x/{b3})}$.
\nHence, using the integration by parts formula we get:
\nArea $= \\left[ x \\times \\simplify{-{a3*b3}cos(x/{b3})} \\right]^{\\var{b3}\\pi}_0 - \\int^{\\var{b3}\\pi}_0 1 \\times \\simplify{-{a3*b3}cos(x/{b3})} \\, dx$
\n$ =\\left[ \\simplify{-{a3*b3}*x*cos(x/{b3})} \\right]^{\\var{b3}\\pi}_0 + \\left[ \\simplify{{a3*b3*b3}sin(x/{b3}) }\\right]^{\\var{b3}\\pi}_0 $
\n$ = [( -\\var{a3*b3*b3}\\pi \\times \\cos(\\pi)) - (0) ] + [\\var{a3*b3*b3}\\sin(\\pi) -\\var{a3*b3*b3}\\sin(0)]$
\n$ = [ -\\var{b3*a3*b3}\\pi \\times -1] + [0 -0]$
\n$ = \\var{a3*b3*b3} \\pi$.
", "rulesets": {}, "extensions": ["jsxgraph"], "name": "Integration: calculating areas in graphs using definite integration.", "ungrouped_variables": ["a1", "b1", "c1", "x12", "x11", "ymax1", "area1", "a2", "b2", "c2", "x21", "x22", "ymax2", "area2", "a3", "b3", "x31", "x32", "area3"], "functions": {"plotgraph": {"type": "html", "definition": "// Shading under a graph! This function plots one of three graphs\n// depending on the value of q. It shades the area between the\n// graph and x-axis depending between x1 and x2\n\n\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: true,\n grid: false\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('axis',\t[ [0,0],[1,0] ]);\nxaxis.removeAllTicks();\nbrd.create('ticks',[xaxis,1],{\n strokeColor:'#ccc',\n majorHeight:-1,\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n\n// create the y-axis\nswitch(q) {\n case 1:\n var yaxis = brd.create('axis',\t[ [0,0],[0,1] ]);\n yaxis.removeAllTicks();\n brd.create('ticks', [yaxis, 10*Math.round(ymax/60)], {\n\t strokeColor:'#ccc',\n\t majorHeight:-1, // Need this because the JXG.Options one doesn't apply\n\t drawLabels:true, // Only works for equidistant ticks\n\t label: {offset: [7, -2]},\n\t minorTicks:1, // The NUMBER of small ticks between each Major tick\n\t drawZero:false\n }\n );\n break;\n case 2:\n var yaxis = brd.create('axis',\t[ [0,0],[0,1] ]);\n yaxis.removeAllTicks();\n brd.create('ticks', [yaxis, Math.round(ymax/10)], {\n\t strokeColor:'#ccc',\n\t majorHeight:-1, // Need this because the JXG.Options one doesn't apply\n\t drawLabels:true, // Only works for equidistant ticks\n\t label: {offset: [7, -2]},\n\t minorTicks:1, // The NUMBER of small ticks between each Major tick\n\t drawZero:false\n }\n );\n break;\n case 3:\n var yaxis = brd.create('axis',\t[ [0,0],[0,1] ]);\n yaxis.removeAllTicks();\n brd.create('ticks', [yaxis, Math.round(ymax/10)], {\n\t strokeColor:'#ccc',\n\t majorHeight:-1, // Need this because the JXG.Options one doesn't apply\n\t drawLabels:true, // Only works for equidistant ticks\n\t label: {offset: [7, -2]},\n\t minorTicks:1, // The NUMBER of small ticks between each Major tick\n\t drawZero:false\n }\n );\n break;\n}\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*x+b*x+c;\n}\n\nvar f2 = function(x) {\n return a*Math.exp(b*x-3) + 1/(x+c);\n}\n\nvar f3 = function(x) {\n return a*x*Math.sin(x/b);\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 break;\n}\n\n\n\nreturn div;", "language": "javascript", "parameters": [["q", "number"], ["x1", "number"], ["x2", "number"], ["a", "number"], ["b", "number"], ["c", "number"], ["xmin", "number"], ["xmax", "number"], ["ymin", "number"], ["ymax", "number"]]}}, "tags": [], "variablesTest": {"condition": "AND(ymax2<100, 10(i) {plotgraph(1,x11,x12,a1,b1,c1,{x11-2},{x12+1},-3*ymax1/10,ymax1*1.1)}
\nThis is the graph of the function $f(x) = \\simplify{{a1}*x^2+{b1}*x+{c1}}$.
\nWhat is the total area of the shaded region? (In case it is unclear, the minimum $x$-value of the region is {x11}).
\n[[0]]
\n\n\n(ii) {plotgraph(2,x21,x22,a2,b2,c2,x21-1,x22+1,-3*ymax2/10,ymax2*1.1)}
\nThis is the graph of the function $f(x) = \\simplify{{a2}e^({b2}*x-3)+1/({c2}+x)}$.
\nFind the area of the shaded region. (In case it is unclear, the minimum $x$-value of the region is {x21}).
\n[[1]]
\n\n\n(iii) {plotgraph(3,x31,x32,a3,b3,0,-1,x32+1,-4,x32*a3/1.4)}
\nThis curve has equation $y = \\simplify{{a3}*x*sin(x/{b3})}$.
\nFind the area of the shaded region. Provide the exact answer - it will be a multiple of $\\pi$. To enter $\\pi$ in the answer box, you type `pi'.
\n[[2]]
\n\n", "scripts": {}, "useCustomName": false, "showCorrectAnswer": true, "unitTests": [], "variableReplacements": [], "extendBaseMarkingAlgorithm": true}], "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}