// Numbas version: finer_feedback_settings {"name": "Definite integration using standard integrals", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"w": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "name": "w"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "description": "", "name": "tol"}, "m4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "2", "description": "", "name": "m4"}, "tans4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(e^(p)*(p^2-2*p+2)-2)/(n4^3)", "description": "", "name": "tans4"}, "b4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s7*random(1,2,3)", "description": "", "name": "b4"}, "d1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-9..9)", "description": "", "name": "d1"}, "s2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s2"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..7)", "description": "", "name": "a1"}, "m3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..9)", "description": "", "name": "m3"}, "tol1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.0001", "description": "", "name": "tol1"}, "tans3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(w=0,((-1)^(m3)-1)/m3^2,-pi*(-1)^(m3)/m3)", "description": "", "name": "tans3"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "t"}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "n4*b4", "description": "", "name": "p"}, "ans2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ln(1+b2/m2),2)", "description": "", "name": "ans2"}, "ans3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tans3,2)", "description": "", "name": "ans3"}, "b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..6)", "description": "", "name": "b1"}, "ans1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tans1,2)", "description": "", "name": "ans1"}, "b2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..20)", "description": "", "name": "b2"}, "ans4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tans4,4)", "description": "", "name": "ans4"}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "t*random(1..9)", "description": "", "name": "c1"}, "m2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "name": "m2"}, "tans1": {"templateType": "anything", "group": "Ungrouped variables", "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": "", "name": "tans1"}, "s6": {"templateType": "anything", "group": "Ungrouped variables", "definition": "-1", "description": "", "name": "s6"}, "n4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s6*random(1,2,3)", "description": "", "name": "n4"}, "s7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1", "description": "", "name": "s7"}}, "ungrouped_variables": ["ans1", "ans2", "ans3", "ans4", "b4", "b1", "b2", "d1", "s2", "s7", "s6", "m4", "m3", "m2", "tol", "a1", "tans4", "c1", "tans1", "tans3", "tol1", "p", "t", "w", "n4"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Definite integration using standard integrals", "functions": {}, "showQuestionGroupNames": false, "parts": [{"prompt": "

\\[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.

", "scripts": {}, "gaps": [{"correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans1+tol", "minValue": "ans1-tol", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"prompt": "

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

\n

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

\n

Input your answer to 2 decimal places.

", "scripts": {}, "gaps": [{"correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans2+tol", "minValue": "ans2-tol", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"prompt": "

\\[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.

", "scripts": {}, "gaps": [{"correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans3+tol", "minValue": "ans3-tol", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"prompt": "

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

\n

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

\n

Input your answer to 4 decimal places.

", "scripts": {}, "gaps": [{"correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "allowFractions": false, "type": "numberentry", "maxValue": "ans4+tol1", "minValue": "ans4-tol1", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}], "statement": "

Evaluate the following definite integrals.

", "tags": ["Calculus", "calculus", "checked2015", "definite integration", "integration", "integration by parts", "integration by parts twice", "MAS1601", "mas1601"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/07/2015:

\n

Added tags

\n

3/07/1012:

\n

Added tags.

\n

Checked calculations.

\n

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

\n

Improved display in Advice.

\n

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

20/07/2012:

\n

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

\n

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

Added description.

\n

\n

25/07/2012:

\n

 

\n

Added tags.

\n

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

\n

 

\n

Question appears to be working correctly.

\n

 

\n

 

", "licence": "Creative Commons Attribution 4.0 International", "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$

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

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*} \\]

", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}