// Numbas version: exam_results_page_options {"showstudentname": true, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

5 questions on definite integrals - integrate polynomials, trig functions and exponentials; find the area under a graph; find volumes of revolution.

"}, "navigation": {"reverse": true, "showresultspage": "oncompletion", "onleave": {"action": "none", "message": ""}, "preventleave": false, "showfrontpage": false, "allowregen": true, "browse": true}, "showQuestionGroupNames": false, "feedback": {"showactualmark": true, "feedbackmessages": [], "allowrevealanswer": true, "intro": "", "showtotalmark": true, "showanswerstate": true, "advicethreshold": 0}, "name": "Nick's copy of Definite Integration Practice", "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "duration": 0, "percentPass": 0, "question_groups": [{"pickingStrategy": "all-ordered", "pickQuestions": 1, "name": "Group", "questions": [{"name": "Jack's copy of Definite integration 1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Jack Dunham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2484/"}], "parts": [{"showFeedbackIcon": true, "gaps": [{"allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "scripts": {}, "maxValue": "ans1+tol", "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "minValue": "ans1-tol", "showFeedbackIcon": true, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "unitTests": []}], "scripts": {}, "marks": 0, "variableReplacements": [], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "unitTests": [], "prompt": "\n

\\[I=\\int_1^{\\var{b1}}\\simplify[std]{({a1} * x ^ 2 + {c1} * x + {d1})^2}\\;dx\\]

\n

$I=\\;\\;$[[0]]

\n

Input your answer to 2 decimal places.

\n "}, {"showFeedbackIcon": true, "gaps": [{"allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "scripts": {}, "maxValue": "ans2+tol", "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "minValue": "ans2-tol", "showFeedbackIcon": true, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "unitTests": []}], "scripts": {}, "marks": 0, "variableReplacements": [], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "unitTests": [], "prompt": "

\\[I=\\int_0^{\\var{b2}}\\simplify[std]{1/(x+{m2})}\\;dx\\]

\n

$I=\\;\\;$[[0]]

\n

Input your answer to 2 decimal places.

"}, {"showFeedbackIcon": true, "gaps": [{"allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "scripts": {}, "maxValue": "ans3+tol", "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "minValue": "ans3-tol", "showFeedbackIcon": true, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "unitTests": []}], "scripts": {}, "marks": 0, "variableReplacements": [], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "unitTests": [], "prompt": "\n

\\[I=\\int_0^\\pi\\simplify[std]{x * ({w} * Sin({m3} * x) + {1 -w} * Cos({m3} * x))}\\;dx\\]

\n

$I=\\;\\;$[[0]]

\n

Input your answer to 2 decimal places.

\n "}, {"showFeedbackIcon": true, "gaps": [{"allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "scripts": {}, "maxValue": "ans4+tol1", "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "minValue": "ans4-tol1", "showFeedbackIcon": true, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "unitTests": []}], "scripts": {}, "marks": 0, "variableReplacements": [], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "unitTests": [], "prompt": "\n

\\[I=\\int_0^{\\var{b4}}\\simplify[std]{x ^ {m4} * Exp({n4} * x)}\\;dx\\]

\n

$I=\\;\\;$[[0]]

\n

Input your answer to 4 decimal places.

\n "}], "metadata": {"description": "

Evaluate $\\int_1^{\\,m}(ax ^ 2 + b x + c)^2\\;dx$, $\\int_0^{p}\\frac{1}{x+d}\\;dx,\\;\\int_0^\\pi x \\sin(qx) \\;dx$, $\\int_0^{r}x ^ {2}e^{t x}\\;dx$

", "licence": "Creative Commons Attribution 4.0 International"}, "variable_groups": [], "ungrouped_variables": ["b2", "m3", "tans3", "s2", "ans2", "m2", "w", "n4", "ans3", "tans4", "tol1", "b4", "c1", "ans4", "b1", "ans1", "tans1", "m4", "a1", "t", "s7", "d1", "s6", "p", "tol"], "variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"js": "", "css": ""}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "functions": {}, "statement": "

Evaluate the following definite integrals.

", "variables": {"b1": {"group": "Ungrouped variables", "name": "b1", "definition": "random(2..6)", "description": "", "templateType": "anything"}, "m2": {"group": "Ungrouped variables", "name": "m2", "definition": "random(1..9)", "description": "", "templateType": "anything"}, "w": {"group": "Ungrouped variables", "name": "w", "definition": "random(0,1)", "description": "", "templateType": "anything"}, "s2": {"group": "Ungrouped variables", "name": "s2", "definition": "random(1,-1)", "description": "", "templateType": "anything"}, "tol1": {"group": "Ungrouped variables", "name": "tol1", "definition": "0.0001", "description": "", "templateType": "anything"}, "tans4": {"group": "Ungrouped variables", "name": "tans4", "definition": "(e^(p)*(p^2-2*p+2)-2)/(n4^3)", "description": "", "templateType": "anything"}, "tans1": {"group": "Ungrouped variables", "name": "tans1", "definition": "a1^2*(b1^5-1)/5+a1*c1*(b1^4-1)/2+(2*a1*d1+c1^2)*(b1^3-1)/3+c1*d1*(b1^2-1)+d1^2*(b1-1)", "description": "", "templateType": "anything"}, "b2": {"group": "Ungrouped variables", "name": "b2", "definition": "random(1..20)", "description": "", "templateType": "anything"}, "p": {"group": "Ungrouped variables", "name": "p", "definition": "n4*b4", "description": "", "templateType": "anything"}, "ans4": {"group": "Ungrouped variables", "name": "ans4", "definition": "precround(tans4,4)", "description": "", "templateType": "anything"}, "m3": {"group": "Ungrouped variables", "name": "m3", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "t": {"group": "Ungrouped variables", "name": "t", "definition": "random(1,-1)", "description": "", "templateType": "anything"}, "m4": {"group": "Ungrouped variables", "name": "m4", "definition": "2", "description": "", "templateType": "anything"}, "tans3": {"group": "Ungrouped variables", "name": "tans3", "definition": "if(w=0,((-1)^(m3)-1)/m3^2,-pi*(-1)^(m3)/m3)", "description": "", "templateType": "anything"}, "s7": {"group": "Ungrouped variables", "name": "s7", "definition": "1", "description": "", "templateType": "anything"}, "b4": {"group": "Ungrouped variables", "name": "b4", "definition": "s7*random(1,2,3)", "description": "", "templateType": "anything"}, "a1": {"group": "Ungrouped variables", "name": "a1", "definition": "random(1..7)", "description": "", "templateType": "anything"}, "d1": {"group": "Ungrouped variables", "name": "d1", "definition": "random(-9..9)", "description": "", "templateType": "anything"}, "ans3": {"group": "Ungrouped variables", "name": "ans3", "definition": "precround(tans3,2)", "description": "", "templateType": "anything"}, "s6": {"group": "Ungrouped variables", "name": "s6", "definition": "-1", "description": "", "templateType": "anything"}, "n4": {"group": "Ungrouped variables", "name": "n4", "definition": "s6*random(1,2,3)", "description": "", "templateType": "anything"}, "ans1": {"group": "Ungrouped variables", "name": "ans1", "definition": "precround(tans1,2)", "description": "", "templateType": "anything"}, "tol": {"group": "Ungrouped variables", "name": "tol", "definition": "0.01", "description": "", "templateType": "anything"}, "c1": {"group": "Ungrouped variables", "name": "c1", "definition": "t*random(1..9)", "description": "", "templateType": "anything"}, "ans2": {"group": "Ungrouped variables", "name": "ans2", "definition": "precround(ln(1+b2/m2),2)", "description": "", "templateType": "anything"}}, "advice": "\n

a)
\\[I=\\int_1^\\var{b1}\\simplify[std]{({a1} * x ^ 2 + {c1} * x + {d1})^2}\\;dx\\]
Expand the parentheses to obtain:

\n

\\[\\begin{eqnarray*}I &=& \\int_1^\\var{b1} \\simplify[std]{{a1 ^ 2} * x ^ 4 + {2 * a1 * c1} * x ^ 3+ {c1 ^ 2+2*a1*d1} * x ^ 2 + {2 * c1 * d1} * x+ {d1 ^ 2} }\\;dx\\\\ &=&\\left[\\simplify[std]{{a1 ^ 2}/5 * x ^ 5 + {2 * a1 * c1}/4 * x ^ 4+ {c1 ^ 2+2*a1*d1}/3 * x ^ 3 + {2 * c1 * d1}/2 * x^2+ {d1 ^ 2}x }\\right]_1^\\var{b1}\\\\ &=&\\var{tans1}\\\\ \\\\&=&\\var{ans1}\\mbox{ to 2 decimal places} \\end{eqnarray*} \\]

\n

b)
\\[\\begin{eqnarray*}I&=&\\int_0^{\\var{b2}}\\simplify[std]{1/(x+{m2})}\\;dx\\\\ &=&\\left[\\ln(x+\\var{m2})\\right]_0^{\\var{b2}}\\\\ &=& \\ln(\\var{b2+m2})-\\ln(\\var{m2})\\\\ &=&\\ln\\left(\\frac{\\var{b2+m2}}{\\var{m2}}\\right)\\\\ &=&\\var{ans2}\\mbox{ to 2 decimal places} \\end{eqnarray*} \\]

\n

c)
\\[I=\\int_0^\\pi\\simplify[std]{x * ({w} * Sin({m3} * x) + {1 -w} * Cos({m3} * x))}\\;dx\\]
We use integration by parts.

\n

Recall that:
\\[\\int u\\frac{dv}{dx}\\;dx=uv-\\int \\frac{du}{dx}\\;v\\;dx\\]
Here we set $u=x$ and $\\displaystyle \\frac{dv}{dx}=\\simplify[std]{ {w} * Sin({m3} * x) + {1 -w} * Cos({m3} * x)}$

\n

Hence \\[v=\\simplify[std]{({-w}/ {m3}) * Cos({m3} * x) + {1 -w} * (({1-w}/ {m3}) * Sin({m3} * x))}\\]

\n

So \\[\\begin{eqnarray*} I&=&\\left[\\simplify[std]{{-w}*((x / {m3}) * Cos({m3} * x)) + {1 -w} * ((x / {m3}) * Sin({m3} * x))}\\right]_0^\\pi -\\int_0^\\pi\\simplify[std]{ ({ -w} / {m3} )* Cos({m3} * x) + {1 -w} * (1 / {m3} * Sin({m3} * x))}\\;dx\\\\ &=&\\simplify[std]{({-w*cos(m3*pi)})*({pi}/{m3})}-\\left[\\simplify[std]{{ -w} * (1 / {m3 ^ 2})* Sin({m3} * x) -({1 -w} * (1 / {m3 ^ 2}) * Cos({m3} * x))}\\right]_0^\\pi\\\\ &=& \\var{ans3}\\mbox{ to 2 decimal places} \\end{eqnarray*} \\]
d)

\n

\\[I=\\int_0^{\\var{b4}}\\simplify[std]{x ^ {m4} * Exp({n4} * x)}\\;dx\\]

\n

Use integration by parts twice with $u=x^2$ and $\\displaystyle \\frac{dv}{dx}=\\simplify[std]{e^({n4}x)}\\Rightarrow v = \\simplify[std]{1/{n4}e^({n4}x)}$
\\[\\begin{eqnarray*} I&=&\\left[\\simplify[std]{x^2/{n4}Exp({n4} * x)}\\right]_0^{\\var{b4}}+\\simplify[std]{2/{abs(n4)}DefInt(x*Exp({n4} * x),x,0,{b4})}\\\\ &=&\\simplify[std]{{b4^2}/{n4}*e^{p}-2/{n4}}\\left(\\left[\\simplify[std]{x/{n4}*e^({n4}*x)}\\right]_0^{\\var{b4}}+\\simplify[std]{1/{abs(n4)}DefInt(e^({n4}x),x,0,{b4})}\\right)\\\\ &=&\\simplify[std]{{b4^2}/{n4}*e^{p}-2/{n4}}\\left(\\simplify[std]{{b4}/{n4}*e^{p}-1/{n4}}\\left[\\simplify[std]{1/{n4}*e^({n4}*x)}\\right]_0^{\\var{b4}}\\right)\\\\ &=&\\simplify[std]{({b4 ^ 2} / {n4}) * Exp({p}) -(({2 * b4} / {n4 ^ 2}) * Exp({p})) + (2 / {n4 ^ 3}) * (Exp({p}) -1)}\\\\ &=&\\var{ans4}\\mbox{ to 4 decimal places} \\end{eqnarray*} \\]

\n ", "tags": [], "type": "question"}, {"name": "Definite Integration 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "tags": ["Calculus", "calculus", "definite integration", "integration", "integration by parts", "integration by parts twice"], "advice": "\n

 

\n

b)
\\[\\begin{eqnarray*}I&=&\\int_0^{\\var{b2}}\\simplify[std]{1/(x+{m2})}\\;dx\\\\ &=&\\left[\\ln(x+\\var{m2})\\right]_0^{\\var{b2}}\\\\ &=& \\ln(\\var{b2+m2})-\\ln(\\var{m2})\\\\ &=&\\ln\\left(\\frac{\\var{b2+m2}}{\\var{m2}}\\right)\\\\ &=&\\var{ans2}\\mbox{ to 2 decimal places} \\end{eqnarray*} \\]

\n

 

\n ", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "\n

\\[I=\\int_0^{\\var{b1}}\\simplify[std]{e^({a}x)}\\;dx\\]

\n

$I=\\;\\;$[[0]]

\n

Input your answer to 3 decimal places.

\n ", "gaps": [{"minvalue": "ans1-tol", "type": "numberentry", "maxvalue": "ans1+tol", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}, {"prompt": "\n

\\[I=\\int_0^{\\var{b2}}\\simplify[std]{1/({b}x+{m2})}\\;dx\\]

\n

$I=\\;\\;$[[0]]

\n

Input your answer to 3 decimal places.

\n ", "gaps": [{"minvalue": "ans2-tol", "type": "numberentry", "maxvalue": "ans2+tol", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}, {"prompt": "\n

\\[I=\\int_0^{\\pi/2}\\simplify[std]{({w} * Sin({m3} * x) + {1 -w} * Cos({m3} * x))}\\;dx\\]

\n

$I=\\;\\;$[[0]]

\n

Input your answer to 3 decimal places.

\n ", "gaps": [{"minvalue": "ans3-tol", "type": "numberentry", "maxvalue": "ans3+tol", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}], "statement": "

Evaluate the following definite integrals.

", "variable_groups": [], "progress": "ready", "type": "question", "variables": {"a": {"definition": "random(-2..2#0.5 except 0)", "name": "a"}, "m2": {"definition": "random(1..9)", "name": "m2"}, "b": {"definition": "random(2..5)", "name": "b"}, "w": {"definition": "random(0,1)", "name": "w"}, "s2": {"definition": "random(1,-1)", "name": "s2"}, "ans2": {"definition": "precround(1/b*(ln(1+b*b2/m2)),3)", "name": "ans2"}, "ans3": {"definition": "precround(tans3,3)", "name": "ans3"}, "b2": {"definition": "random(1..20)", "name": "b2"}, "b1": {"definition": "random(-1..2#0.5 except 0)", "name": "b1"}, "tol": {"definition": 0.001, "name": "tol"}, "t": {"definition": "random(1,-1)", "name": "t"}, "m3": {"definition": "random(2..9)", "name": "m3"}, "ans1": {"definition": "precround(tans1,3)", "name": "ans1"}, "c1": {"definition": "t*random(1..9)", "name": "c1"}, "tans1": {"definition": "(1/a)*(e^(a*b1)-1)", "name": "tans1"}, "tol1": {"definition": 0.0001, "name": "tol1"}, "tans3": {"definition": "1/m3*((1-w)*sin(m3*pi/2)-w*(cos(m3*pi/2)-1))", "name": "tans3"}, "d1": {"definition": "random(-9..9)", "name": "d1"}}, "metadata": {"notes": "\n \t\t \t\t

3/07/1012:

\n \t\t \t\t

Added tags.

\n \t\t \t\t

Checked calculations.

\n \t\t \t\t

Left tolerances in, as easy to make minor errors in calculations.

\n \t\t \t\t

Improved display in Advice.

\n \t\t \t\t

Some superscripts e.g. the form a^\\var{b} in latex have to be written as a^{\\var{b}} as not displayed properly (if b has a second digit it slips down). Corrected.

\n \t\t \t\t

20/07/2012:

\n \t\t \t\t

Set new tolerace variables, tol=0.01, tol1=0.0001.

\n \t\t \t\t

Can have expressions in Advice of the form $1\\times E$ where E is an expression. This can be remedied by rewriting - but later as not crucial.

\n \t\t \t\t

Added description.

\n \t\t \t\t

\n \t\t \t\t

25/07/2012:

\n \t\t \t\t

 

\n \t\t \t\t

Added tags.

\n \t\t \t\t

A lot of work in this question - Perhaps it would be more managable broken down into two separate questions?

\n \t\t \t\t

 

\n \t\t \t\t

Question appears to be working correctly.

\n \t\t \t\t

 

\n \t\t \t\t

 

\n \t\t \n \t\t", "description": "

Evaluate $\\int_0^{\\,m}e^{ax}\\;dx$, $\\int_0^{p}\\frac{1}{bx+d}\\;dx,\\;\\int_0^{\\pi/2} \\sin(qx) \\;dx$. 

", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Definite Integration: Calculating the area under a curve 1", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Gemma Crowe", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2440/"}, {"name": "Jack Dunham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2484/"}], "variables": {"a2": {"templateType": "anything", "name": "a2", "description": "", "definition": "1", "group": "b) quadratic. no neg region"}, "x31": {"templateType": "anything", "name": "x31", "description": "", "definition": "b3-random(2..3)", "group": "c quadratic. neg region"}, "x32": {"templateType": "anything", "name": "x32", "description": "", "definition": "b3", "group": "c quadratic. neg region"}, "x12": {"templateType": "anything", "name": "x12", "description": "", "definition": "random(1..4) + x11", "group": "linear graph (not used)"}, "x42": {"templateType": "anything", "name": "x42", "description": "", "definition": "b4", "group": "Ungrouped variables"}, "area3": {"templateType": "anything", "name": "area3", "description": "", "definition": "(x33^3/3 - 0.5*(a3+b3)*x33^2+a3*b3*x33)-2*(x32^3/3 - 0.5*(a3+b3)*x32^2+a3*b3*x32)+(x31^3/3 - 0.5*(a3+b3)*x31^2+a3*b3*x31)", "group": "c quadratic. neg region"}, "a3": {"templateType": "anything", "name": "a3", "description": "", "definition": "random(-3..-1)", "group": "c quadratic. neg region"}, "b4": {"templateType": "anything", "name": "b4", "description": "", "definition": "a4+random(2..3)", "group": "Ungrouped variables"}, "a1": {"templateType": "anything", "name": "a1", "description": "", "definition": "1", "group": "linear graph (not used)"}, "b3": {"templateType": "anything", "name": "b3", "description": "", "definition": "a3+random(3..4)", "group": "c quadratic. neg region"}, "c2": {"templateType": "anything", "name": "c2", "description": "", "definition": "random(1..4)", "group": "b) quadratic. no neg region"}, "x33": {"templateType": "anything", "name": "x33", "description": "", "definition": "x32+2", "group": "c quadratic. neg region"}, "x11": {"templateType": "anything", "name": "x11", "description": "", "definition": "random(1..2)", "group": "linear graph (not used)"}, "c4": {"templateType": "anything", "name": "c4", "description": "", "definition": "b4+2", "group": "Ungrouped variables"}, "a4": {"templateType": "anything", "name": "a4", "description": "", "definition": "random(-3..-2)", "group": "Ungrouped variables"}, "area2": {"templateType": "anything", "name": "area2", "description": "", "definition": "(a2*x22^3/3+c2*x22)-(a2*x21^3/3+c2*x21)", "group": "b) quadratic. no neg region"}, "x22": {"templateType": "anything", "name": "x22", "description": "", "definition": "random(3..5)+x21", "group": "b) quadratic. no neg region"}, "x21": {"templateType": "anything", "name": "x21", "description": "", "definition": "random(-4..-2)", "group": "b) quadratic. no neg region"}, "b1": {"templateType": "anything", "name": "b1", "description": "", "definition": "random(1..3)", "group": "linear graph (not used)"}, "x41": {"templateType": "anything", "name": "x41", "description": "", "definition": "a4", "group": "Ungrouped variables"}}, "preamble": {"js": "", "css": ""}, "functions": {"plotgraph": {"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 = -7;\nvar xmax = 7;\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 });\nyticks = brd.create('ticks',[yaxis,5],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 4\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 (x-a)*(x-b);\n}\n\nvar f4 = function(x) {\n return 0.5*(x-a)*(x-b)*(x-c);\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 shade(f3,x2,x2+2,'green');\n break;\n case 4:\n brd.create('functiongraph', [f4]);\n shade(f4,x1,x2,'red');\n shade(f4,x2,x2+2,'green');\n break\n}\n\n\n\nreturn div;", "parameters": [["q", "number"], ["x1", "number"], ["x2", "number"], ["ymin", "number"], ["ymax", "number"], ["a", "number"], ["b", "number"], ["c", "number"]]}}, "ungrouped_variables": ["a4", "b4", "c4", "x41", "x42"], "rulesets": {}, "tags": [], "metadata": {"description": "

Graphs are given with areas underneath them shaded. The student is asked to select or enter the correct integral which calculates its area.

", "licence": "Creative Commons Attribution 4.0 International"}, "variable_groups": [{"name": "linear graph (not used)", "variables": ["x11", "x12", "a1", "b1"]}, {"name": "b) quadratic. no neg region", "variables": ["x21", "x22", "a2", "c2", "area2"]}, {"name": "c quadratic. neg region", "variables": ["a3", "b3", "x31", "x32", "x33", "area3"]}], "advice": "

Be sure to initally write down the integral expression for $A$ with the appropriate boundaries.

\n

\\[A=\\int_{a}^{b}{f(x)}dx\\]

\n

Double check your answer makes sense. Remember, areas below the $x$-axis are negative. Try and estimate whether most of the area is above or below the $x$-axis, from this you should be to check whether or not the sign of your answer is correct.

\n

For further information see Chapter 6 - Integration Notes. 

", "statement": "

Find the following areas $A$ shown by the following shaded regions. Enter all values as fractions and not as decimals

", "variablesTest": {"condition": "", "maxRuns": 100}, "parts": [{"type": "gapfill", "showCorrectAnswer": true, "sortAnswers": false, "variableReplacementStrategy": "originalfirst", "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "prompt": "

{plotgraph(2,x21,x22,-5,25,a2,0,c2)}

\n

This is the graph of the function $f(x) = \\simplify{{a2}*x^2+{c2}}$.

\n

$A=\\,\\,$[[0]]

", "marks": 0, "scripts": {}, "variableReplacements": [], "gaps": [{"type": "numberentry", "allowFractions": true, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "3", "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "correctAnswerStyle": "plain", "scripts": {}, "maxValue": "area2", "mustBeReducedPC": 0, "variableReplacements": [], "unitTests": [], "minValue": "area2"}]}, {"type": "gapfill", "showCorrectAnswer": true, "sortAnswers": false, "variableReplacementStrategy": "originalfirst", "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "prompt": "

{plotgraph(3,x31,x32,-6,15,a3,b3,0)}

\n

This curve has equation $y = \\simplify{x^2-{a3+b3}*x + {a3*b3}}$.

\n

$A=\\,\\,$[[0]]

\n

\n

", "marks": 0, "scripts": {}, "variableReplacements": [], "gaps": [{"type": "numberentry", "allowFractions": true, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "5", "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "correctAnswerStyle": "plain", "scripts": {}, "maxValue": "area3", "mustBeReducedPC": 0, "variableReplacements": [], "unitTests": [], "minValue": "area3"}]}], "type": "question"}, {"name": "Definite Integration: Calculating the area under a curve II. Needs integration by parts.", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Gemma Crowe", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2440/"}, {"name": "Jack Dunham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2484/"}], "parts": [{"gaps": [{"showPreview": true, "vsetRangePoints": 5, "answer": "{area1_exact}", "checkVariableNames": false, "showFeedbackIcon": true, "marks": "3", "scripts": {}, "failureRate": 1, "extendBaseMarkingAlgorithm": true, "unitTests": [], "expectedVariableNames": [], "vsetRange": [0, 1], "checkingType": "absdiff", "showCorrectAnswer": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "answerSimplification": "fractionNumbers", "type": "jme", "checkingAccuracy": 0.001, "customMarkingAlgorithm": ""}], "showFeedbackIcon": true, "marks": 0, "scripts": {}, "extendBaseMarkingAlgorithm": true, "unitTests": [], "sortAnswers": false, "showCorrectAnswer": true, "prompt": "

{plotgraph(1,0,x1,-2,ymax1,a1,0,0)}

\n

This is the graph of the function $f(x) = \\simplify[fractionNumbers]{x*e^({a1}*x)}$.

\n

$A=\\,\\,$ [[0]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "type": "gapfill", "customMarkingAlgorithm": ""}], "variable_groups": [{"variables": ["x1", "a1", "ymax1", "area1_exact", "area1"], "name": "(a)"}], "tags": [], "statement": "

Find the following area $A$ shown by the following shaded region. Enter all values as fractions and not decimals

", "advice": "

Be sure to initally write down the integral expression for $A$ with the appropriate boundaries.

\n

\\[A=\\int_{a}^{b}{f(x)}dx\\]

\n

For this question you will need to use integration by parts to integrate the function. 

\n

Double check your answer makes sense. Remember, areas below the $x$-axis are negative. Try and estimate whether most of the area is above or below the $x$-axis, from this you should be to check whether or not the sign of your answer is correct.

\n

For further information see Chapter 6 - Integration Notes. 

", "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Graphs are given with areas underneath them shaded. The student is asked to select or enter the correct integral which calculates its area.

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": [], "preamble": {"css": "", "js": ""}, "functions": {"plotgraph": {"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 = -1;\nvar xmax = 7;\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 });\nyticks = brd.create('ticks',[yaxis,5],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 4\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 x*Math.exp(a*x);\n}\n\nvar f2 = function(x) {\n return a*x*x + c;\n}\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}\n\n\n\nreturn div;", "language": "javascript", "type": "html", "parameters": [["q", "number"], ["x1", "number"], ["x2", "number"], ["ymin", "number"], ["ymax", "number"], ["a", "number"], ["b", "number"], ["c", "number"]]}}, "variables": {"x1": {"group": "(a)", "templateType": "anything", "definition": "random(2..4)", "description": "", "name": "x1"}, "ymax1": {"group": "(a)", "templateType": "anything", "definition": "x1*e^(a1*x1)+5", "description": "", "name": "ymax1"}, "area1_exact": {"group": "(a)", "templateType": "anything", "definition": "expression((x1/a1-1/a1^2)+\"*e^(\"+a1*x1+\")+\"+1/a1^2)", "description": "", "name": "area1_exact"}, "a1": {"group": "(a)", "templateType": "anything", "definition": "random([0.1,0.2,0.25,0.5])", "description": "", "name": "a1"}, "area1": {"group": "(a)", "templateType": "anything", "definition": "(x1/a1-1/a1^2)*e^(a1*x1)+1/a1^2", "description": "", "name": "area1"}}, "type": "question"}]}], "type": "exam", "contributors": [{"name": "Nick Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2416/"}], "extensions": ["jsxgraph"], "custom_part_types": [], "resources": []}