// Numbas version: exam_results_page_options {"name": "Area between 2 graphs by Double Integral (Advanced)", "extensions": ["geogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Area between 2 graphs by Double Integral (Advanced)", "tags": [], "metadata": {"description": "

Calculating the area enclosed between a linear function and a quadratic function by integration. The limits (points of intersection) are not given in the question and must be calculated.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Find the area enclosed by $\\simplify{y={m}x+{c_1}}$ and $\\simplify{y=x^2+{b}x+{c_2}}$ using a double integral.

\n

\n

{geogebra_applet('https://www.geogebra.org/m/fyxr2fqj',defs)}

", "advice": "

a)

\n

To find the points of intersection, we will solve the given eqautions simultaneously. We equate the two and solve for $x$ first:

\n

\\[ \\begin{split} \\simplify{x^2+{b}x+{c_2}} &\\,= \\simplify{{m}x+{c_1}}, \\\\ \\simplify{x^2+{b-m}x+{c_2-c_1}} &\\,=0, \\\\ \\simplify{(x-{cp1})(x-{cp2})}&\\,=0. \\end{split} \\]

\n

Therefore, the points of intersection are when $\\simplify{x1={cp1}}$ and $\\simplify{x2={cp2}}$.

\n

Now by pluging-in these values into $\\simplify{y={m}x+{c_1}}$ we get $\\simplify{y_1 = {y1}}$ and $\\simplify{y_2 = {y2}}$.

\n

\n

b) 

\n

We are asked to integrate $y$ first. So, $x$ can vary freely in the range we found above, and $y$ will vary depending on $x$. So the relevant boundaries of the variables are 

\n

\\[ \\var{x1} < x < \\var{x2} \\quad \\mbox{ and }\\quad  \\simplify{x^2+{b}x+{c_2}} < y < \\simplify{{m}x+{c_1}}\\simplify{x^2+{b}x+{c_2}}.\\]

\n

Then the integral 

\n

\\[\\int_{\\var{x1}}^{\\var{x2}} \\int_{\\simplify{x^2+{b}x+{c_2}}}^{\\simplify{{m}x+{c_1}}}\\, \\mathrm{d}y\\, \\mathrm{d}x\\] 

\n

can be used to compute the shaded area.

\n

\n

c)

\n

We start with the inner integral first

\n

\\[\\int_{\\simplify{x^2+{b}x+{c_2}}}^{\\simplify{{m}x+{c_1}}}\\, \\mathrm{d}y = y|_{\\simplify{x^2+{b}x+{c_2}}}^{\\simplify{{m}x+{c_1}}} =  \\simplify{{m}x+{c_1}} - (\\simplify{x^2+{b}x+{c_2}}) = \\simplify{-x^2 + {m-b}x  + {c_1-c_2}}.\\]

\n

\n

Then we get 

\n

\\[\\int_{\\var{x1}}^{\\var{x2}} \\int_{\\simplify{x^2+{b}x+{c_2}}}^{\\simplify{{m}x+{c_1}}}\\, \\mathrm{d}y\\, \\mathrm{d}x =\\] {advice}

\n

\n

 

\n

\n

", "rulesets": {}, "extensions": ["geogebra"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-6..6)", "description": "", "templateType": "anything", "can_override": false}, "c_1": {"name": "c_1", "group": "Ungrouped variables", "definition": "random(-6..6 except 0)", "description": "", "templateType": "anything", "can_override": false}, "cp1": {"name": "cp1", "group": "Ungrouped variables", "definition": "(-(b-m)-sqrt(dis))/2", "description": "", "templateType": "anything", "can_override": false}, "cp2": {"name": "cp2", "group": "Ungrouped variables", "definition": "(-(b-m)+sqrt(dis))/2", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "c_2": {"name": "c_2", "group": "Ungrouped variables", "definition": "random(-8..8 except [0,c_1])", "description": "", "templateType": "anything", "can_override": false}, "dis": {"name": "dis", "group": "Ungrouped variables", "definition": "(b-m)^2-4*(c_2-c_1)", "description": "", "templateType": "anything", "can_override": false}, "sol": {"name": "sol", "group": "Ungrouped variables", "definition": "-(cp2^3/3)+(m-b)cp2^2/2+(c_1-c_2)*cp2+(cp1)^3/3-(m-b)cp1^2/2-(c_1-c_2)*cp1", "description": "", "templateType": "anything", "can_override": false}, "sol2dp": {"name": "sol2dp", "group": "Ungrouped variables", "definition": "precround(sol,2)", "description": "", "templateType": "anything", "can_override": false}, "advice": {"name": "advice", "group": "Ungrouped variables", "definition": "if(sol=round(sol),'{simplified}',advice2)", "description": "", "templateType": "anything", "can_override": false}, "simplified": {"name": "simplified", "group": "Ungrouped variables", "definition": "\"

\\\\[ \\\\begin{split}\\\\simplify[all, !noLeadingMinus]{defint(-x^2+{m-b}x+{c_1-c_2},x,{cp1},{cp2})} &\\\\,= \\\\left[\\\\simplify[all, !noLeadingMinus]{-x^3/3+{m-b}x^2/2+{c_1-c_2}x} \\\\right]_\\\\var{cp1}^\\\\var{cp2},\\\\\\\\ &\\\\,=\\\\left[\\\\simplify[all, !collectNumbers,fractionNumbers,!noLeadingMinus]{-{cp2^3/3}+{(m-b)*cp2^2/2}+{(c_1-c_2)*cp2}}\\\\right]-\\\\left[\\\\simplify[all, !collectNumbers,fractionNumbers,!noLeadingMinus]{-{cp1^3/3}+{(m-b)*cp1^2/2}+{(c_1-c_2)*cp1}}\\\\right]\\\\\\\\ &\\\\,= \\\\left(\\\\simplify[all, fractionNumbers]{{-(cp2^3/3)+(m-b)cp2^2/2+(c_1-c_2)*cp2}}\\\\right)-\\\\left(\\\\simplify[all, fractionNumbers]{{-(cp1)^3/3+(m-b)cp1^2/2+(c_1-c_2)*cp1}}\\\\right)\\\\\\\\ &\\\\,=\\\\simplify[all, fractionNumbers]{{-(cp2^3/3)+(m-b)cp2^2/2+(c_1-c_2)*cp2+(cp1)^3/3-(m-b)cp1^2/2-(c_1-c_2)*cp1}}. \\\\end{split} \\\\]

\"", "description": "", "templateType": "long string", "can_override": false}, "simplify": {"name": "simplify", "group": "Ungrouped variables", "definition": "safe(\"

\\\\[ \\\\begin{split}\\\\simplify[all, !noLeadingMinus]{defint(-x^2+{m-b}x+{c_1-c_2},x,{cp1},{cp2})} &\\\\,= \\\\left[\\\\simplify[all, !noLeadingMinus]{-x^3/3+{m-b}x^2/2+{c_1-c_2}x} \\\\right]_\\\\var{cp1}^\\\\var{cp2},\\\\\\\\ &\\\\,=\\\\left[\\\\simplify[all, !collectNumbers,fractionNumbers,!noLeadingMinus]{-{cp2^3/3}+{(m-b)*cp2^2/2}+{(c_1-c_2)*cp2}}\\\\right]-\\\\left[\\\\simplify[all, !collectNumbers,fractionNumbers,!noLeadingMinus]{-{cp1^3/3}+{(m-b)*cp1^2/2}+{(c_1-c_2)*cp1}}\\\\right]\\\\\\\\ &\\\\,= \\\\left(\\\\simplify[all, fractionNumbers]{{-(cp2^3/3)+(m-b)cp2^2/2+(c_1-c_2)*cp2}}\\\\right)-\\\\left(\\\\simplify[all, fractionNumbers]{{-(cp1)^3/3+(m-b)cp1^2/2+(c_1-c_2)*cp1}}\\\\right)\\\\\\\\ &\\\\,=\\\\simplify[all, fractionNumbers]{{-(cp2^3/3)+(m-b)cp2^2/2+(c_1-c_2)*cp2+(cp1)^3/3-(m-b)cp1^2/2-(c_1-c_2)*cp1}}\\\\\\\\ &\\\\,=\\\\var{sol2dp} \\\\,\\\\text{(2dp)}. \\\\end{split} \\\\]

\")", "description": "", "templateType": "long string", "can_override": false}, "advice2": {"name": "advice2", "group": "Ungrouped variables", "definition": "if(sol=sol2dp,'{simplifyy}','{simplify}')", "description": "", "templateType": "anything", "can_override": false}, "simplifyy": {"name": "simplifyy", "group": "Ungrouped variables", "definition": "\"

\\\\[ \\\\begin{split}\\\\simplify[all,!noLeadingMinus]{defint(-x^2+{m-b}x+{c_1-c_2},x,{cp1},{cp2})} &\\\\,= \\\\left[\\\\simplify[all,!noLeadingMinus]{-x^3/3+{m-b}x^2/2+{c_1-c_2}x} \\\\right]_\\\\var{cp1}^\\\\var{cp2},\\\\\\\\ &\\\\,=\\\\left[\\\\simplify[all, !collectNumbers,fractionNumbers,!noLeadingMinus]{-{cp2^3/3}+{(m-b)*cp2^2/2}+{(c_1-c_2)*cp2}}\\\\right]-\\\\left[\\\\simplify[all, !collectNumbers,fractionNumbers,!noLeadingMinus]{-{cp1^3/3}+{(m-b)*cp1^2/2}+{(c_1-c_2)*cp1}}\\\\right]\\\\\\\\ &\\\\,= \\\\left(\\\\simplify[all, fractionNumbers]{{-(cp2^3/3)+(m-b)cp2^2/2+(c_1-c_2)*cp2}}\\\\right)-\\\\left(\\\\simplify[all, fractionNumbers]{{-(cp1)^3/3+(m-b)cp1^2/2+(c_1-c_2)*cp1}}\\\\right)\\\\\\\\ &\\\\,=\\\\simplify[all, fractionNumbers]{{-(cp2^3/3)+(m-b)cp2^2/2+(c_1-c_2)*cp2+(cp1)^3/3-(m-b)cp1^2/2-(c_1-c_2)*cp1}}\\\\\\\\ &\\\\,=\\\\var{sol2dp} \\\\end{split} \\\\]

\"", "description": "", "templateType": "long string", "can_override": false}, "defs": {"name": "defs", "group": "Ungrouped variables", "definition": "[\n ['M',m],\n ['D',c_1],\n ['B',b],\n ['C',c_2]\n]", "description": "", "templateType": "anything", "can_override": false}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "((m-b)+delta)/2", "description": "", "templateType": "anything", "can_override": false}, "delta": {"name": "delta", "group": "Ungrouped variables", "definition": "sqrt((b-m)^2 - 4*(c_2-c_1))", "description": "", "templateType": "anything", "can_override": false}, "x1": {"name": "x1", "group": "Ungrouped variables", "definition": "((m-b)-delta)/2", "description": "", "templateType": "anything", "can_override": false}, "y1": {"name": "y1", "group": "Ungrouped variables", "definition": "m*x1 + c_1", "description": "", "templateType": "anything", "can_override": false}, "y2": {"name": "y2", "group": "Ungrouped variables", "definition": "m*x2 + c_1", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "cp1=round(cp1) and cp2=round(cp2) and dis>0", "maxRuns": "100"}, "ungrouped_variables": ["m", "c_1", "b", "c_2", "cp1", "cp2", "dis", "sol", "sol2dp", "advice", "advice2", "simplified", "simplify", "simplifyy", "defs", "x2", "delta", "x1", "y1", "y2"], "variable_groups": [{"name": "Unnamed group", "variables": []}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Denote the intersection points of $\\simplify{y={m}x+{c_1}}$ and $\\simplify{y=x^2+{b}x+{c_2}}$ as $(x_1, y_1)$ (leftmost) and $(x_2,y_2)$ (rightmost). Find these points

\n

$x_1=$[[0]], $y_1=$[[1]]

\n

$x_2=$[[2]], $y_2=$ [[3]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{x1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{y1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{x2}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": true, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{y2}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write a double integral, integrating $y$ first, to compute the shaded area. 

", "answer": "defint(defint( '',y, x^2+{b}x+{c_2}, {m}x+{c_1}), x,{x1},{x2})", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}]}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Compute the double integral you wrote in part b)

\n

[[0]] (Give your answers to 2 decimal places where necessary)

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Gap 0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{sol2dp}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": "0.01", "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}, {"name": "Ugur Efem", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18261/"}]}]}], "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}, {"name": "Ugur Efem", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18261/"}]}