// Numbas version: exam_results_page_options {"name": "Area of a trapezoid by integration", "extensions": ["geogebra"], "custom_part_types": [], "resources": [["question-resources/line_3Hg39hr.ggb", "/srv/numbas/media/question-resources/line_3Hg39hr.ggb"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Area of a trapezoid by integration", "tags": ["area under curve", "definite integrals", "integration"], "metadata": {"description": "

Student is given two points defined symbolically, and must find the equation of the line they define, then use integration to find an equation for the area under the line, bounded by the x-axis and vertical lines through the two points.   

\n

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

{applet}

\n

", "advice": "

The equation of a line passing through two points $A = (\\var{x1}, \\var{y1}) $ and $B = (\\var{x2}, \\var{y2})$  is

\n

$\\dfrac{y-\\var{y1}}{\\simplify[zeroTerm]{x - {x1}}} = \\dfrac{\\var{y2}-\\var{y1}}{\\simplify[zeroTerm]{{x2} - {x1}}}$

\n

which rearranges to:

\n

$y = \\left(\\dfrac{\\var{y2}-\\var{y1}}{\\simplify[zeroTerm]{{x2} - {x1}}}\\right) (\\simplify[zeroTerm]{(x - {x1})}) + \\var{y1}$

\n

Integrate using vertical strips $dA = y dx$ to find the area

\n

$A = \\int dA = \\simplify{defint(y, x, {x1},{x2})}$

\n

$\\phantom{A} = \\int_\\var{x1}^\\var{x2} \\left(\\dfrac{\\var{y2}-\\var{y1}}{\\simplify[zeroTerm]{{x2} - {x1}}}\\right) (\\simplify[zeroTerm]{(x - {x1})}) + \\var{y1}\\; dx$

\n

Simplify by letting $ m = \\frac{\\var{y2}-\\var{y1}}{\\simplify[zeroTerm]{{x2}-{x1}}}$ and performing a $u$-substitiution with

\n

$u = (x - \\var{x1}) $ and $du = dx$

\n

and limits $ u(\\var{x1} )= 0$, and $u(\\var{x2}) = \\var{x2}-\\var{x1}$ to give:

\n

$A = \\int_0^\\simplify{{x2}-{x1}} \\simplify{(m u  + {y1})} \\;du$

\n

This function can be easily integrated with respect to $u$, and then expressed in terms of $x$:

\n

$A = m \\dfrac{u^2}{2} + \\var{y1}\\; u \\;\\Big|_0^\\simplify{{x2}-{x1}}$

\n

$\\phantom{A} = \\dfrac{(\\var{y2}-\\var{y1})}{(\\simplify[zeroTerm]{{x2}-{x1}})} \\dfrac{\\simplify{({x2}-{x1})^2}}{2} + \\var{y1}(\\simplify{{x2}-{x1}})$

\n

$\\phantom{A} = \\dfrac{1}{2} (\\var{y2}-\\var{y1})(\\simplify[zeroTerm]{{x2}-{x1}}) + \\var{y1} (\\simplify{{x2}-{x1}})$

\n

The resulting area can be recognized as the sum of the area of a triangle with $\\text{height}=  (\\simplify{{y2}-{y1}})$  and $\\text{base}=(\\simplify[zeroTerm]{{x2}-{x1}})$ and the area of a rectangle with $\\text{height}=\\var{y1}$ and the same base.

\n

Alternatively, this further simplifies to the average height of the trapezoid times the base.

\n

$A =\\left( \\dfrac{\\var{y2}+\\var{y1}}{2}\\right) (\\simplify[zeroTerm]{{x2}-{x1}})$

\n

", "rulesets": {}, "extensions": ["geogebra"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "vector(random(-20..30)/10, random(0..50)/10)", "description": "

x = 0 is never selected, but problem will still work.  Equations in solution will look poor.

", "templateType": "anything", "can_override": false}, "applet": {"name": "applet", "group": "Ungrouped variables", "definition": "geogebra_file('line_3Hg39hr.ggb',[\n A: A, B: B, \n x1: quote(strings[0]), y1: quote(strings[1]), \n x2: quote(strings[2]), y2: quote(strings[3])])", "description": "", "templateType": "anything", "can_override": false}, "B": {"name": "B", "group": "Ungrouped variables", "definition": "vector(A[0] + random(3,4,5,6), random(1,2,3,4,5))", "description": "", "templateType": "anything", "can_override": false}, "strings": {"name": "strings", "group": "Ungrouped variables", "definition": "random(\n if(A[0]<>0,\n [['a','b','c','d'], ['a','c','b','d'],['x_1','y_1','x_2','y_2']],\n [['0','a','c','b'], ['0','y_1','x_2','y_2'], ['0','h_1','b','h_2']]))", "description": "

picks one of several labeling schemes.

\n

strings needed for ggb labels

", "templateType": "anything", "can_override": false}, "x1": {"name": "x1", "group": "Ungrouped variables", "definition": "expression(strings[0])", "description": "", "templateType": "anything", "can_override": false}, "y1": {"name": "y1", "group": "Ungrouped variables", "definition": "expression(strings[1])", "description": "", "templateType": "anything", "can_override": false}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "expression(strings[2])", "description": "", "templateType": "anything", "can_override": false}, "y2": {"name": "y2", "group": "Ungrouped variables", "definition": "expression(strings[3])", "description": "", "templateType": "anything", "can_override": false}, "area": {"name": "area", "group": "Ungrouped variables", "definition": "substitute([x1: x1, y1: y1, x2: x2, y2: y2], expression(\"(x2-x1)(y2+y1)/2\"))", "description": "

({x2}-{x1})(({y2}-{y1})/2 + {y1})

", "templateType": "anything", "can_override": false}, "AreaNum": {"name": "AreaNum", "group": "Ungrouped variables", "definition": "(A[1]+B[1])/2 (B[0]-A[0])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "a[1]<>B[1] //line is not horizontal \nand abs(A[0]) > 1 // point A not too close to y axis", "maxRuns": 100}, "ungrouped_variables": ["A", "B", "applet", "strings", "x1", "y1", "x2", "y2", "area", "AreaNum"], "variable_groups": [], "functions": {"quote": {"parameters": [["s", "string"]], "type": "string", "language": "jme", "definition": "'\\\"'+s+'\\\"'"}}, "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": "

Use integration to find an expression for the area under the line from $x = \\var{x1}$ to $x = \\var{x2}$.

\n

$A = $ [[0]]

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Area", "marks": "20", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{area}", "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}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}]}]}], "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}]}