// Numbas version: exam_results_page_options {"duration": 0, "timing": {"timedwarning": {"message": "", "action": "none"}, "allowPause": true, "timeout": {"message": "", "action": "none"}}, "showQuestionGroupNames": false, "navigation": {"onleave": {"message": "", "action": "none"}, "browse": true, "reverse": true, "allowregen": true, "preventleave": true, "showresultspage": "oncompletion", "showfrontpage": true}, "type": "exam", "allQuestions": true, "percentPass": 0, "metadata": {"notes": "", "description": "

Approximate the integral of a function by Riemann sums.

", "licence": "Creative Commons Attribution 4.0 International"}, "questions": [], "feedback": {"showtotalmark": true, "allowrevealanswer": true, "showanswerstate": true, "showactualmark": true, "advicethreshold": 0}, "shuffleQuestions": false, "name": "Maria's copy of Riemann sums", "question_groups": [{"questions": [{"name": "Approximate the integral of a quadratic by Riemann sums, ", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "lowersum2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(c^3*(2*n-1)*(4*n-1)/(24*n^2)+a*c^2*(2*n-1)/(4*n)+b*c,3)", "description": "", "name": "lowersum2"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "c"}, "uppersum": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tuppersum,3)", "description": "", "name": "uppersum"}, "uppersum2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(c^3*(2*n+1)*(4*n+1)/(24*n^2)+a*c^2*(2*n+1)/(4*n)+b*c,3)", "description": "", "name": "uppersum2"}, "theint": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(c^3/3+a*c^2/2+b*c,3)", "description": "", "name": "theint"}, "lowersum": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tlowersum,3)", "description": "", "name": "lowersum"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "name": "a"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..20#5)", "description": "", "name": "n"}, "tlowersum": {"templateType": "anything", "group": "Ungrouped variables", "definition": "c^3*(n-1)*(2n-1)/(6*n^2)+a*c^2*(n-1)/(2*n)+b*c", "description": "", "name": "tlowersum"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "name": "b"}, "tuppersum": {"templateType": "anything", "group": "Ungrouped variables", "definition": "c^3*(n+1)*(2n+1)/(6*n^2)+a*c^2*(n+1)/(2*n)+b*c", "description": "", "name": "tuppersum"}}, "ungrouped_variables": ["a", "tuppersum", "c", "b", "uppersum2", "theint", "n", "lowersum", "lowersum2", "tlowersum", "tol", "uppersum"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"plotf1": {"type": "html", "language": "javascript", "definition": "\nvar f = function(x){ return x*x+a*x+b; };\nvar div = Numbas.extensions.jsxgraph.makeBoard('200px','200px', {axis:true,showNavigation:false, boundingbox:[-a/2-5,f(-a/2+5),-a/2+5,Math.min(f(-a/2),-4)]});\n\nvar brd=div.board;\n\nvar plot = brd.create('functiongraph',[f,-a/2-5,-a/2+5]);\n\n//brd.create('text',[c,-2,c]);\n//var i1 = brd.create('integral', [[0, c], plot]);\n\nreturn div;\n", "parameters": [["a", "number"], ["b", "number"], ["c", "number"]]}, "riemann": {"type": "html", "language": "javascript", "definition": "\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px', {axis:false,showNavigation:true, boundingbox:[-2-c-1,(c+1)*(c+1)+(c+1)*a+b+15,c+2,-15]});\nvar brd=div.board;\n//This slider varies the number of partitions. Start off with n\nvar s = brd.create('slider',[[-1,(c+1)*(c+1)+(c+1)*a+b+10],[1,(c+1)*(c+1)+(c+1)*a+b+10],[0,n,50]],{name:'n',snapWidth:1});\nn=s.Value();\n//The function for which we are estimating the integral. \n//This dispays to the right\nvar f = function(x){ return x*x+a*x+b; };\n//Same function but displaced to the left for the lower sum\nvar f1=function(x){return (x+2+c+1)*(x+2+c+1)+a*(x+2+c+1)+b;};\nvar plot = brd.create('functiongraph',[f,0,c+1]);\nvar plot1=brd.create('functiongraph',[f1,-2-c-1,-2]);\n//Two diagrams created using built in function.\nvar os = brd.create('riemannsum',[f,function(){return s.Value();},'upper',0, c ], \n{fillColor:'#ffff00', fillOpacity:0.3});\nvar os1 = brd.create('riemannsum',[f1,function(){return s.Value();},'lower',-2-c-1, -3 ], \n{fillColor:'#ffff00', fillOpacity:0.3});\n//Unfortunately the uppersum calculation in jsxgraph does not agree with mine!\n//So have written the function which gives the same result as the question.\n//Have checked this and is OK - still could be checked.\nvar usm=function(c,n,a,b){\n var s=Math.pow(c,3)*(n+1)*(2*n+1)/(6*Math.pow(n,2))+a*Math.pow(c,2)*(n+1)/(2*n)+b*c;\ns=Numbas.math.precround(Numbas.math.niceNumber(s),3);\nreturn s;}\n//This gives the lower sum using the inbuilt Jsx calculations.\n//Agrees with the question calculations.\nbrd.create('text',\n[-2-c-1,(c+1)*(c+1)+(c+1)*a+b+5,function(){ return 'Sum='+(JXG.Math.Numerics.riemannsum(f1,s.Value(),'lower',-2-c-1,-3)).toFixed(3); }]);\nbrd.create('text',\n[-2-c-1,-5,'Lower Sum']);\nbrd.create('text',[-2-c-1,-1,0]);\nbrd.create('text',[-3,-1,c]);\n//Custom calculation of the upper bound.\nbrd.create('text',\n[0,(c+1)*(c+1)+(c+1)*a+b+5,function(){ return 'Sum='+usm(c,s.Value(),a,b); }]);\nbrd.create('text',[0,-5,'Upper Sum']);\nbrd.create('text',[0,-1,0]);\nbrd.create('text',[c,-1,c]);\nreturn div;\n", "parameters": [["c", "number"], ["n", "number"], ["a", "number"], ["b", "number"]]}, "plotf": {"type": "html", "language": "javascript", "definition": "\nvar f = function(x){ return x*x+a*x+b; };\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px', {axis:true,showNavigation:false, boundingbox:[-a/2-2,f(c+1),c+4,Math.min(f(-a/2)-2,-5)]});\n\nvar brd=div.board;\n\nvar plot = brd.create('functiongraph',[f,-5,c+5]);\n//var p1=brd.create('point',[0,0],{visible:false,fixed:true});\n//var p2=brd.create('point',[c,-1],{visible:true,fixed:true,size:1,name:c});\n//var p3=brd.create('point',[c,f(c)],{visible:false,fixed:true,size:1,name:''});\n//var p4=brd.create('point',[0,f(0)],{visible:false,fixed:true,size:1,name:''});\n//var c1=brd.create('line',[p1,p2]);\n//var c2=brd.create('line',[p2,p3]);\n\nbrd.create('text',[c,-2,c]);\nvar i1 = brd.create('integral', [[0, c], plot]);\n\nreturn div;\n", "parameters": [["a", "number"], ["b", "number"], ["c", "number"]]}}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "-a/2", "minValue": "-a/2", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Find $a$ such that $f$ is an increasing function for $x \\ge a$ and a decreasing function for $x \\le a$.

\n

$a=\\;$[[0]] (input as a decimal).

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "uppersum+tol", "minValue": "uppersum-tol", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "lowersum+tol", "minValue": "lowersum-tol", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n

Compute the upper and lower sums over the interval for the partition $[0,\\var{c}]$ into subintervals each of length $\\simplify[all]{{c}/{n}}$

\n

\\[\\Delta = \\{0,\\;\\simplify[all]{{c}/{n}},\\;\\simplify[all]{{2*c}/{n}},\\ldots,\\;\\var{c}\\}\\]

\n

\n

Upper sum = ?[[0]] (Input to 3 decimal places.)

\n

Lower sum = ?[[1]] (Input to 3 decimal places.)

\n", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "uppersum2+tol", "minValue": "uppersum2-tol", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "lowersum2+tol", "minValue": "lowersum2-tol", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Suppose we refine the partition into $\\var{2*n}$ subintervals, each of length $\\simplify[all]{{c}/{2*n}}$.

\n

Find the new values of the upper and lower sums:

\n

Upper sum = ?[[0]]  (Input to 3 decimal places).

\n

Lowersum = ?[[1]]   (Input to 3 decimal places).

", "showCorrectAnswer": true, "marks": 0}], "statement": "\n

Let $f: \\mathbb{R} \\rightarrow  \\mathbb{R}$ be the function $f(x)=\\simplify{x^2+{a}*x+{b}}$.

\n

{plotf1(a,b,c)}

\n

\n

\n

\n", "tags": ["approximating integrals", "checked2015", "interactive", "Jsxgraph", "jsxgraph", "JSXgraph", "lower sum", "MAS1601", "MAS2224", "numerics", "quadratic", "Riemann sums", "upper sum"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n\t\t

06/12/2013:

\n\t\t

Started - to be finished with a fully interactive jsxgraph in Advice (or Steps).

\n\t\t

09/12/2013:

\n\t\t

First version finished.

\n\t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

Approximating integral of a quadratic by Riemann sums . Includes an interactive graph in Advice showing the approximations given by the upper and lower sums and how they vary as we increase the number of intervals.

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

$f(x)$ is a quadratic and its stationary point is given by $\\frac{df}{dx}=0$ which after solving gives the minimum point  $x=-\\simplify[all]{{a}/2}$.

\n

{plotf(a,b,c)}

\n

We see that the function is increasing in the range $[0,\\var{c}]$ and it follows that the lower sums are given by taking the value of $f$ on the left hand side of each interval, multiplying by the interval length and summing up over all intervals. The upper sums by taking the right hand side of each interval etc.

\n

The following diagrams illustrate this. Move the slider to see the effect on the upper and lower sums by varying the number $n$ of subintervals.

\n

{riemann(c,n,a,b)}

\n

Finding the Upper and Lower sums Directly.

\n

First you have to know the following sums of sequences:

\n

\\[\\begin{eqnarray*}\\sum_{r=1}^m r &=& \\frac{m(m+1)}{2}\\\\ \\sum_{r=1}^{m} r^2&=&\\frac{m(m+1)(2m+1)}{6}\\end{eqnarray*}\\]

\n

Also the interval points between $0$ and $\\var{c}$ are given by $x_j=\\simplify[all,fractionNumbers]{({c}/{n})j},\\;j=0,\\dots,\\var{n}$

\n

For the lower sums, each rectangle with base the interval $[x_r,x_{r+1}]$ contributes an area $f(x_r)(x_{r+1}-x_r)=\\simplify[all,fractionNumbers]{f({c}/{n}*r)*({c}/{n})},\\;r=0,\\ldots,\\var{n-1}$.

\n

We sum from $r=0$ to $r=\\var{n-1}$ as we have to take the left value of each interval.

\n

So the lower sum is:

\n

\\[\\begin{eqnarray}\\mbox{LS}=\\sum_{r=0}^{\\var{n-1}}\\simplify[all,fractionNumbers]{f(({c}/{n})*r)*({c}/{n})}&=&\\sum_{r=0}^{\\var{n-1}}\\simplify[all,fractionNumbers,!collectNumbers]{((({c}/{n})*r)^2+{a}*(({c}/{n})*r)+{b})*({c}/{n})}\\\\
&=&\\sum_{r=0}^{\\var{n-1}}\\simplify[all,fractionNumbers,!collectNumbers]{({c}/{n})^3*r^2}+\\var{a}\\sum_{r=0}^{\\var{n-1}}\\simplify[all,fractionNumbers,!collectNumbers]{({c}/{n})^2*r}+\\var{b}\\sum_{r=0}^{\\var{n-1}}\\simplify[all,fractionNumbers,!collectNumbers]{({c}/{n})}\\\\
&=&\\simplify[all,fractionNumbers]{({c}/{n})^3}\\sum_{r=0}^{\\var{n-1}}r^2+\\var{a}\\times\\simplify[all,fractionNumbers]{({c}/{n})^2}\\sum_{r=0}^{\\var{n-1}}r+\\var{b}\\times\\var{c}\\end{eqnarray}\\]

\n

Using \\[\\sum_{r=0}^{\\var{n-1}}r=\\frac{\\var{n-1}\\times \\var{n}}{2}=\\var{(n-1)*n/2},\\;\\;\\;\\sum_{r=0}^{\\var{n-1}}r^2=\\frac{\\var{n-1}\\times \\var{n}\\times \\var{2*n-1}}{6}=\\var{(n-1)*n*(2*n-1)/6}\\]

\n

and substituting into the above equation we obtain:

\n

LS = $\\var{tlowersum}=\\var{lowersum}$ to 3 decimal places.

\n

As for the upper sum we have $\\mbox{US}=\\mbox{LS}+(f(\\var{c})-f(0))\\times\\simplify[all,fractionNumbers]{{c}/{n}}=\\mbox{LS}+(\\var{c^2+a*c+b}-\\var{b})\\times \\simplify[all,fractionNumbers]{{c}/{n}}=\\var{tlowersum}+\\var{tuppersum-tlowersum}=\\var{tuppersum}=\\var{uppersum}$ to 3 decimal places .

\n

Or if we take the more long-winded approach using the same method as for LS we have:

\n

\\[\\begin{eqnarray}\\mbox{US}=\\sum_{r=1}^{\\var{n}}\\simplify[all,fractionNumbers]{f(({c}/{n})*r)*({c}/{n})}&=&\\sum_{r=1}^{\\var{n}}\\simplify[all,fractionNumbers,!collectNumbers]{((({c}/{n})*r)^2+{a}*(({c}/{n})*r)+{b})*({c}/{n})}\\\\&=&\\sum_{r=1}^{\\var{n}}\\simplify[all,fractionNumbers,!collectNumbers]{({c}/{n})^3*r^2}+\\var{a}\\sum_{r=1}^{\\var{n}}\\simplify[all,fractionNumbers,!collectNumbers]{({c}/{n})^2*r}+\\var{b}\\sum_{r=1}^{\\var{n}}\\simplify[all,fractionNumbers,!collectNumbers]{({c}/{n})}\\\\&=&\\simplify[all,fractionNumbers]{({c}/{n})^3}\\sum_{r=1}^{\\var{n}}r^2+\\var{a}\\times\\simplify[all,fractionNumbers]{({c}/{n})^2}\\sum_{r=1}^{\\var{n}}r+\\var{b}\\times\\var{c}\\\\&=&\\var{tuppersum}=\\var{uppersum}\\end{eqnarray}\\]

\n

to 3 decimal places.

\n

The true value is given by the integral

\n

\\[\\int_{0}^{\\var{c}} \\simplify[all]{x^2+{a}*x+{b}}\\;dx=\\left[\\simplify[all]{x^3/3+{a}/2*x^2+{b}*x}\\right]_{0}^{\\var{c}}=\\var{theint}\\] to 3 decimal places.

\n

\n

For $\\var{2*n}$ intervals we obtain:

\n

$\\mbox{LS}=\\var{lowersum2}$.

\n

$\\mbox{US}=\\var{uppersum2}$.

\n

Both to 3 decimal places.

\n

\n

\n

\n

\n

\n"}, {"name": "Compute Riemann sums of a linear function, ", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"uppersum": {"templateType": "anything", "group": "Ungrouped variables", "definition": "((d-c)*(a*(c+d+sign(a))+2*b))/2", "description": "", "name": "uppersum"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(c <0,-c+random(4..10),c+random(6..10))", "description": "", "name": "d"}, "lowersum2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a*(2*c-sign(a)+2*d)+4*b)*(d-c)/4", "description": "", "name": "lowersum2"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "name": "c"}, "uppersum2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a*(2*c+sign(a)+2*d)+4*b)*(d-c)/4", "description": "", "name": "uppersum2"}, "theint": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a/2*(d^2-c^2)+b*(d-c)", "description": "", "name": "theint"}, "lowersum": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(d-c)*(a*(c+d-sign(a))+2*b)/2", "description": "", "name": "lowersum"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "name": "a"}, "side": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(a>0,1,0)", "description": "", "name": "side"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "d-c", "description": "", "name": "n"}, "type": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(a>0,'increasing','decreasing')", "description": "", "name": "type"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "name": "b"}, "monotonic": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(a<0,\"a decreasing \", \"an increasing \")", "description": "", "name": "monotonic"}}, "ungrouped_variables": ["a", "c", "b", "uppersum2", "d", "theint", "monotonic", "n", "lowersum", "lowersum2", "type", "uppersum", "side"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"riemann": {"type": "html", "language": "javascript", "definition": "\n//the next four variables are used to scope out the bounding box.\nvar m1=a<0? c*a+b: a>0? d*a+b:0;\nvar m2=a<0? d*a+b: a>0?c*a+b:0;\nvar v1=Math.max(3,m1+2);\nvar v2=Math.min(-3,m2-2);\nvar m=d-c;\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px', {axis:false,showNavigation:false, boundingbox:[2*c-d-7,v1,d+2,v2-5]});\nvar brd=div.board;\nvar xaxis=brd.create('segment',[[2*c-d-7,0],[d+2,0]],{strokeColor:'black',fixed:true});\n//This slider varies the number of partitions. Start off with m\nvar s = brd.create('slider',[[c-5,(v1+v2)/2],[c-1,(v1+v2)/2],[0,m,40]],{name:'n',snapWidth:1});\nn=s.Value();\n//The function for which we are estimating the integral. \n//This displays to the right\nvar f = function(x){ return a*x+b; };\n//Same function but displaced to the left for the lower sum\nvar f1=function(x){return a*(x+d-c+5)+b;};\nvar plot = brd.create('functiongraph',[f,c,d+1]);\nvar plot1=brd.create('functiongraph',[f1,2*c-d-5,c-5]);\n//Two diagrams created using built in function.\nvar os = brd.create('riemannsum',[f,function(){return s.Value();},'upper',c, d ], \n{fillColor:'#ffff00', fillOpacity:0.3});\nvar os1 = brd.create('riemannsum',[f1,function(){return s.Value();},'lower',2*c-d-5, c-5 ], \n{fillColor:'#ffff00', fillOpacity:0.3});\n//Unfortunately the uppersum and lowersum calculations in jsxgraph sometimes does not agree with mine!\n//So have written functions usm and lsm which gives the same result as the question.\n//Have checked this and is OK - still could be checked.\n//lsm and usm are functions which add up arithmetic sequences. The term abs(a)*m/n varies in\n//sign depending on whether or not a<0, decreasing function, or a > 0, increasing.\nvar lsm=function(a,b,c,d,n){\nvar s=m*(a*(c+d)-Math.abs(a)*m/n+2*b)/2;\ns=Numbas.math.precround(Numbas.math.niceNumber(s),3);\nreturn s;}\nvar usm=function(a,b,c,d,n){\nvar s=m*(a*(c+d)+Math.abs(a)*m/n+2*b)/2;\ns=Numbas.math.precround(Numbas.math.niceNumber(s),3);\nreturn s;}\nbrd.create('text',\n[2*c-d-5,v2,function(){ return 'Lower Sum='+lsm(a,b,c,d,s.Value()); }]);\nbrd.create('text',[2*c-d-5-0.2,-0.5,c]);\nbrd.create('text',[c-5+0.2,-0.5,d]);\nbrd.create('text',\n[c,v2,function(){ return 'Upper Sum='+usm(a,b,c,d,s.Value()); }]);\nbrd.create('text',[c-0.2,-0.5,c]);\nbrd.create('text',[d+0.2,-0.5,d]);\n\nreturn div;\n", "parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["d", "number"]]}, "plotf": {"type": "html", "language": "javascript", "definition": "\nvar f = function(x){ return a*x+b; }\nvar m1=a<0? c*a+b: a>0? d*a+b:0;\nvar m2=a<0? d*a+b: a>0?c*a+b:0;\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px', {axis:true,showNavigation:false, boundingbox:[c-5,Math.max(3,m1+2),d+5,Math.min(-3,m2-2)]});\n\nvar brd=div.board;\n\nvar plot = brd.create('functiongraph',[f,Math.min(-3,c-2),Math.max(3,d+2)]);\n//var p1=brd.create('point',[0,0],{visible:false,fixed:true});\n//var p2=brd.create('point',[c,-1],{visible:true,fixed:true,size:1,name:c});\n//var p3=brd.create('point',[c,f(c)],{visible:false,fixed:true,size:1,name:''});\n//var p4=brd.create('point',[0,f(0)],{visible:false,fixed:true,size:1,name:''});\n//var c1=brd.create('line',[p1,p2]);\n//var c2=brd.create('line',[p2,p3]);\n\n//brd.create('text',[c,-2,c]);\n//brd.create('text',[d,-2,d]);\nvar i1 = brd.create('integral', [[c,d], plot]);\n\nreturn div;\n", "parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["d", "number"]]}}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "uppersum", "minValue": "uppersum", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "lowersum", "minValue": "lowersum", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Compute the upper and lower sums of $f$ for the partition of the interval $[\\var{c},\\var{d}]$ into subintervals each of length 1:

\n

\\[\\Delta = \\{\\var{c},\\var{c+1},\\;\\ldots,\\var{d}\\}.\\]

\n

Note that $f$ is {monotonic} function over this interval.

\n

Upper sum = ?[[0]] (Input to 3 decimal places.)

\n

Lower sum = ?[[1]] (Input to 3 decimal places.)

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "uppersum2", "minValue": "uppersum2", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "lowersum2", "minValue": "lowersum2", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Suppose we refine the partition into $\\var{2*n}$ subintervals, each of length $\\simplify[all]{1/2}$.

\n

Find the new values of the upper and lower sums:

\n

Upper sum = ?[[0]]  (Input to 3 decimal places).

\n

Lowersum = ?[[1]]   (Input to 3 decimal places).

", "showCorrectAnswer": true, "marks": 0}], "statement": "\n

Let $f: \\mathbb{R} \\rightarrow  \\mathbb{R}$ be the function $f(x)=\\simplify{{a}*x+{b}}$.

\n

\n

\n

\n", "tags": ["approximating integrals", "checked2015", "interactive", "jsxgraph", "JSXgraph", "Jsxgraph", "linear function", "lower sum", "MAS1601", "MAS2224", "numerics", "Riemann sums", "upper sum"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n\t\t

09/12/2013:

\n\t\t

First version started.

\n\t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

Approximating integral of a linear function by Riemann sums . Includes an interactive graph in Advice showing the approximations given by the upper and lower sums and how they vary as we increase the number of intervals.

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

{plotf(a,b,c,d)}

\n

$f(x)$ is a linear function which is {monotonic} function. It follows that:

\n

1. The lower sum is given by taking the area over each interval $[x_j,x_{j+1}]$ to be $f(x_{\\simplify{j+{1-side}}})\\times(x_{j+1}-x_j)$ as $f(x_{\\simplify{j+{1-side}}})\\lt f(x_{\\simplify{j+{side}}})$

\n

2. The upper sum is given by taking the area over each interval $[x_j,x_{j+1}]$ to be  $f(x_{\\simplify{j+{side}}})\\times(x_{j+1}-x_j)$  as $f(x_{\\simplify{j+{side}}})\\gt f(x_{\\simplify{j+{1-side}}})$

\n

\n

a) In this case, $x_j=j,\\;\\;j=\\var{c},\\var{c+1},\\dots,\\var{d}$ and so the interval length  $x_{j+1}-x_{j}=1$ and so we have the for the lower sum:

\n

Lower sum.

\n


\\[\\begin{eqnarray}\\mbox{LS}=\\sum_{j=\\var{c}}^{\\var{d-1}}f(x_{\\simplify{j+{1-side}}})=\\sum_{j=\\var{c}}^{\\var{d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{{a}*(j+{1-side})+{b}}\\right)&=&{\\var{a}}\\times\\sum_{j=\\var{c}}^{\\var{d-1}}(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{1-side}) })+\\var{n*b}\\\\&=&\\var{lowersum}\\end{eqnarray}\\]

\n

We are using the arithmetic series sum: $\\displaystyle \\sum_{j=a}^b j=\\frac{1}{2}(a+b)(b-a+1)$ so that $\\sum_{j=\\var{c}}^{\\var{d-1}}(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{side}) })=\\var{(c+d-1+2*side)*(d-c)/2}$.

\n

Upper sum.

\n


\\[\\begin{eqnarray}\\mbox{US}=\\sum_{j=\\var{c}}^{\\var{d-1}}f(x_{\\simplify{j+{side}}})=\\sum_{j=\\var{c}}^{\\var{d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{{a}*(j+{side})+{b}}\\right)&=&{\\var{a}}\\times\\sum_{j=\\var{c}}^{\\var{d-1}}(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{side}) })+\\var{n*b}\\\\&=&\\var{uppersum}\\end{eqnarray}\\]

\n

We are using the arithmetic series sum: $\\displaystyle \\sum_{j=a}^b j=\\frac{1}{2}(a+b)(b-a+1)$ so that $\\sum_{j=\\var{c}}^{\\var{d-1}}(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{side}) })=\\var{(c+d-1+2*side)*(d-c)/2}$.

\n

{riemann(a,b,c,d)}

\n

You can use the slider above to see the effect of changing the number, $n$ of partitions between $\\var{c}$ and $\\var{d}$.

\n

b)

\n

If we double the number of  partitions them we have $x_j=\\frac{j}{2},\\;\\;j=\\var{2*c},\\var{2*c+1},\\ldots,\\var{2*d}$.

\n

Also we have to remember to multiply by the interval length $x_{j+1}-x_j=1/2$.

\n

We have:

\n

Lower sum.

\n


\\[\\begin{eqnarray}\\mbox{LS}=\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}f(x_{\\simplify{j+{1-side}}})\\times \\frac{1}{2}=\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{{a}*((j+{1-side})/2)+{b}}\\right)\\times \\frac{1}{2}&=&\\frac{\\var{a}}{4}\\times\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{(1-side)}) }\\right)+\\var{n*b}\\\\&=&\\var{lowersum2}\\end{eqnarray}\\]

\n

Upper sum.

\n

\\[\\begin{eqnarray}\\mbox{US}=\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}f(x_{\\simplify{j+{side}}})\\times \\frac{1}{2}=\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{{a}*((j+{side})/2)+{b}}\\right)\\times \\frac{1}{2}&=&\\frac{\\var{a}}{4}\\times\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{side}) }\\right)+\\var{n*b}\\\\&=&\\var{uppersum2}\\end{eqnarray}\\]

\n

True value of the integral is:

\n


\\[\\int_{\\var{c}}^{\\var{d}}\\simplify{{a}*x+{b}}\\;dx=\\left[\\simplify{{a}/2*x^2+{b}*x}\\right]_{\\var{c}}^{\\var{d}}=\\var{theint}\\]

\n"}, {"name": "Compute Riemann sums of a linear function, ", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"uppersum": {"templateType": "anything", "group": "Ungrouped variables", "definition": "((d-c)*(a*(c+d+sign(a))+2*b))/2", "description": "", "name": "uppersum"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(c <0,-c+random(4..10),c+random(6..10))", "description": "", "name": "d"}, "lowersum2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a*(2*c-sign(a)+2*d)+4*b)*(d-c)/4", "description": "", "name": "lowersum2"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "name": "c"}, "uppersum2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a*(2*c+sign(a)+2*d)+4*b)*(d-c)/4", "description": "", "name": "uppersum2"}, "theint": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a/2*(d^2-c^2)+b*(d-c)", "description": "", "name": "theint"}, "lowersum": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(d-c)*(a*(c+d-sign(a))+2*b)/2", "description": "", "name": "lowersum"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "name": "a"}, "side": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(a>0,1,0)", "description": "", "name": "side"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "d-c", "description": "", "name": "n"}, "type": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(a>0,'increasing','decreasing')", "description": "", "name": "type"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "name": "b"}, "monotonic": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(a<0,\"a decreasing \", \"an increasing \")", "description": "", "name": "monotonic"}}, "ungrouped_variables": ["a", "c", "b", "uppersum2", "d", "theint", "monotonic", "n", "lowersum", "lowersum2", "type", "uppersum", "side"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"riemann": {"type": "html", "language": "javascript", "definition": "\n//the next four variables are used to scope out the bounding box.\nvar m1=a<0? c*a+b: a>0? d*a+b:0;\nvar m2=a<0? d*a+b: a>0?c*a+b:0;\nvar v1=Math.max(3,m1+2);\nvar v2=Math.min(-3,m2-2);\nvar m=d-c;\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px', {axis:false,showNavigation:false, boundingbox:[2*c-d-7,v1,d+2,v2-5]});\nvar brd=div.board;\nvar xaxis=brd.create('segment',[[2*c-d-7,0],[d+2,0]],{strokeColor:'black',fixed:true});\n//This slider varies the number of partitions. Start off with m\nvar s = brd.create('slider',[[c-5,(v1+v2)/2],[c-1,(v1+v2)/2],[0,m,40]],{name:'n',snapWidth:1});\nn=s.Value();\n//The function for which we are estimating the integral. \n//This displays to the right\nvar f = function(x){ return a*x+b; };\n//Same function but displaced to the left for the lower sum\nvar f1=function(x){return a*(x+d-c+5)+b;};\nvar plot = brd.create('functiongraph',[f,c,d+1]);\nvar plot1=brd.create('functiongraph',[f1,2*c-d-5,c-5]);\n//Two diagrams created using built in function.\nvar os = brd.create('riemannsum',[f,function(){return s.Value();},'upper',c, d ], \n{fillColor:'#ffff00', fillOpacity:0.3});\nvar os1 = brd.create('riemannsum',[f1,function(){return s.Value();},'lower',2*c-d-5, c-5 ], \n{fillColor:'#ffff00', fillOpacity:0.3});\n//Unfortunately the uppersum and lowersum calculations in jsxgraph sometimes does not agree with mine!\n//So have written functions usm and lsm which gives the same result as the question.\n//Have checked this and is OK - still could be checked.\n//lsm and usm are functions which add up arithmetic sequences. The term abs(a)*m/n varies in\n//sign depending on whether or not a<0, decreasing function, or a > 0, increasing.\nvar lsm=function(a,b,c,d,n){\nvar s=m*(a*(c+d)-Math.abs(a)*m/n+2*b)/2;\ns=Numbas.math.precround(Numbas.math.niceNumber(s),3);\nreturn s;}\nvar usm=function(a,b,c,d,n){\nvar s=m*(a*(c+d)+Math.abs(a)*m/n+2*b)/2;\ns=Numbas.math.precround(Numbas.math.niceNumber(s),3);\nreturn s;}\nbrd.create('text',\n[2*c-d-5,v2,function(){ return 'Lower Sum='+lsm(a,b,c,d,s.Value()); }]);\nbrd.create('text',[2*c-d-5-0.2,-0.5,c]);\nbrd.create('text',[c-5+0.2,-0.5,d]);\nbrd.create('text',\n[c,v2,function(){ return 'Upper Sum='+usm(a,b,c,d,s.Value()); }]);\nbrd.create('text',[c-0.2,-0.5,c]);\nbrd.create('text',[d+0.2,-0.5,d]);\n\nreturn div;\n", "parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["d", "number"]]}, "plotf": {"type": "html", "language": "javascript", "definition": "\nvar f = function(x){ return a*x+b; }\nvar m1=a<0? c*a+b: a>0? d*a+b:0;\nvar m2=a<0? d*a+b: a>0?c*a+b:0;\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px', {axis:true,showNavigation:false, boundingbox:[c-5,Math.max(3,m1+2),d+5,Math.min(-3,m2-2)]});\n\nvar brd=div.board;\n\nvar plot = brd.create('functiongraph',[f,Math.min(-3,c-2),Math.max(3,d+2)]);\n//var p1=brd.create('point',[0,0],{visible:false,fixed:true});\n//var p2=brd.create('point',[c,-1],{visible:true,fixed:true,size:1,name:c});\n//var p3=brd.create('point',[c,f(c)],{visible:false,fixed:true,size:1,name:''});\n//var p4=brd.create('point',[0,f(0)],{visible:false,fixed:true,size:1,name:''});\n//var c1=brd.create('line',[p1,p2]);\n//var c2=brd.create('line',[p2,p3]);\n\n//brd.create('text',[c,-2,c]);\n//brd.create('text',[d,-2,d]);\nvar i1 = brd.create('integral', [[c,d], plot]);\n\nreturn div;\n", "parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["d", "number"]]}}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "uppersum", "minValue": "uppersum", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "lowersum", "minValue": "lowersum", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Compute the upper and lower sums of $f$ for the partition of the interval $[\\var{c},\\var{d}]$ into subintervals each of length 1:

\n

\\[\\Delta = \\{\\var{c},\\var{c+1},\\;\\ldots,\\var{d}\\}.\\]

\n

Note that $f$ is {monotonic} function over this interval.

\n

Upper sum = ?[[0]] (Input to 3 decimal places.)

\n

Lower sum = ?[[1]] (Input to 3 decimal places.)

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "uppersum2", "minValue": "uppersum2", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "lowersum2", "minValue": "lowersum2", "correctAnswerFraction": false, "marks": 2, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Suppose we refine the partition into $\\var{2*n}$ subintervals, each of length $\\simplify[all]{1/2}$.

\n

Find the new values of the upper and lower sums:

\n

Upper sum = ?[[0]]  (Input to 3 decimal places).

\n

Lowersum = ?[[1]]   (Input to 3 decimal places).

", "showCorrectAnswer": true, "marks": 0}], "statement": "\n

Let $f: \\mathbb{R} \\rightarrow  \\mathbb{R}$ be the function $f(x)=\\simplify{{a}*x+{b}}$.

\n

\n

\n

\n", "tags": ["approximating integrals", "checked2015", "interactive", "JSXgraph", "jsxgraph", "Jsxgraph", "linear function", "lower sum", "MAS1601", "MAS2224", "numerics", "Riemann sums", "upper sum"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n\t\t

09/12/2013:

\n\t\t

First version started.

\n\t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

Approximating integral of a linear function by Riemann sums . Includes an interactive graph in Advice showing the approximations given by the upper and lower sums and how they vary as we increase the number of intervals.

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

{plotf(a,b,c,d)}

\n

$f(x)$ is a linear function which is {monotonic} function. It follows that:

\n

1. The lower sum is given by taking the area over each interval $[x_j,x_{j+1}]$ to be $f(x_{\\simplify{j+{1-side}}})\\times(x_{j+1}-x_j)$ as $f(x_{\\simplify{j+{1-side}}})\\lt f(x_{\\simplify{j+{side}}})$

\n

2. The upper sum is given by taking the area over each interval $[x_j,x_{j+1}]$ to be  $f(x_{\\simplify{j+{side}}})\\times(x_{j+1}-x_j)$  as $f(x_{\\simplify{j+{side}}})\\gt f(x_{\\simplify{j+{1-side}}})$

\n

\n

a) In this case, $x_j=j,\\;\\;j=\\var{c},\\var{c+1},\\dots,\\var{d}$ and so the interval length  $x_{j+1}-x_{j}=1$ and so we have the for the lower sum:

\n

Lower sum.

\n


\\[\\begin{eqnarray}\\mbox{LS}=\\sum_{j=\\var{c}}^{\\var{d-1}}f(x_{\\simplify{j+{1-side}}})=\\sum_{j=\\var{c}}^{\\var{d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{{a}*(j+{1-side})+{b}}\\right)&=&{\\var{a}}\\times\\sum_{j=\\var{c}}^{\\var{d-1}}(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{1-side}) })+\\var{n*b}\\\\&=&\\var{lowersum}\\end{eqnarray}\\]

\n

We are using the arithmetic series sum: $\\displaystyle \\sum_{j=a}^b j=\\frac{1}{2}(a+b)(b-a+1)$ so that $\\sum_{j=\\var{c}}^{\\var{d-1}}(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{side}) })=\\var{(c+d-1+2*side)*(d-c)/2}$.

\n

Upper sum.

\n


\\[\\begin{eqnarray}\\mbox{US}=\\sum_{j=\\var{c}}^{\\var{d-1}}f(x_{\\simplify{j+{side}}})=\\sum_{j=\\var{c}}^{\\var{d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{{a}*(j+{side})+{b}}\\right)&=&{\\var{a}}\\times\\sum_{j=\\var{c}}^{\\var{d-1}}(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{side}) })+\\var{n*b}\\\\&=&\\var{uppersum}\\end{eqnarray}\\]

\n

We are using the arithmetic series sum: $\\displaystyle \\sum_{j=a}^b j=\\frac{1}{2}(a+b)(b-a+1)$ so that $\\sum_{j=\\var{c}}^{\\var{d-1}}(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{side}) })=\\var{(c+d-1+2*side)*(d-c)/2}$.

\n

{riemann(a,b,c,d)}

\n

You can use the slider above to see the effect of changing the number, $n$ of partitions between $\\var{c}$ and $\\var{d}$.

\n

b)

\n

If we double the number of  partitions them we have $x_j=\\frac{j}{2},\\;\\;j=\\var{2*c},\\var{2*c+1},\\ldots,\\var{2*d}$.

\n

Also we have to remember to multiply by the interval length $x_{j+1}-x_j=1/2$.

\n

We have:

\n

Lower sum.

\n


\\[\\begin{eqnarray}\\mbox{LS}=\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}f(x_{\\simplify{j+{1-side}}})\\times \\frac{1}{2}=\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{{a}*((j+{1-side})/2)+{b}}\\right)\\times \\frac{1}{2}&=&\\frac{\\var{a}}{4}\\times\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{(1-side)}) }\\right)+\\var{n*b}\\\\&=&\\var{lowersum2}\\end{eqnarray}\\]

\n

Upper sum.

\n

\\[\\begin{eqnarray}\\mbox{US}=\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}f(x_{\\simplify{j+{side}}})\\times \\frac{1}{2}=\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{{a}*((j+{side})/2)+{b}}\\right)\\times \\frac{1}{2}&=&\\frac{\\var{a}}{4}\\times\\sum_{j=\\var{2*c}}^{\\var{2*d-1}}\\left(\\simplify[all,!collectNumbers,!noLeadingMinus]{(j+{side}) }\\right)+\\var{n*b}\\\\&=&\\var{uppersum2}\\end{eqnarray}\\]

\n

True value of the integral is:

\n


\\[\\int_{\\var{c}}^{\\var{d}}\\simplify{{a}*x+{b}}\\;dx=\\left[\\simplify{{a}/2*x^2+{b}*x}\\right]_{\\var{c}}^{\\var{d}}=\\var{theint}\\]

\n"}, {"name": "True/false statements about Riemann integration, ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tr8": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If $f$ is a bounded function on $[a,b]$, and if $P_n$ ($n \\\\in \\\\mathbb{N}$) are partitions of $[a,b]$ such that $U(P_n) \\\\to \\\\ell$ and $L(P_n) \\\\to \\\\ell$ as $n \\\\to \\\\infty$, then $f$ is Riemann integrable on $[a,b]$ and $\\\\int_a^b f(x) dx = \\\\ell$.

\"", "description": "", "name": "tr8"}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "v"}, "f1": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If a function $f$ is bounded on $[a,b]$, then $f$ is Riemann integrable on $[a,b]$.

\"", "description": "", "name": "f1"}, "ch2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(u=1,tr4,if(u=2,tr5,if(u=3,tr6, if(u=4, tr7,tr8))))", "description": "", "name": "ch2"}, "u": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "u"}, "f7": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If a bounded function $f$ is Riemann integrable on $[a,b]$, and if $P_n$ ($n \\\\in \\\\mathbb{N}$) are partitions of $[a,b]$, then $U(P_n)-L(P_n) \\\\to 0$ as $n \\\\to \\\\infty$.

\"", "description": "", "name": "f7"}, "tr7": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If $f$ is a bounded function on $[a,b]$, and if $P_n$ ($n \\\\in \\\\mathbb{N}$) are partitions of $[a,b]$ such that $U(P_n)-L(P_n) \\\\to 0$ as $n \\\\to \\\\infty$, then $f$ is Riemann integrable on $[a,b]$.

\"", "description": "", "name": "tr7"}, "f5": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If $f$ is a bounded function on $[a,b]$, and if $P$ and $Q$ are partitions of $[a,b]$ with $Q$ a refinement of $P$, then $L(P) \\\\geq U(Q)$.

\"", "description": "", "name": "f5"}, "h": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "h"}, "f4": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If $f$ is a bounded function on $[a,b]$, and if $P$ and $Q$ are partitions of $[a,b]$, then $L(P) \\\\leq L(Q)$.

\"", "description": "", "name": "f4"}, "f3": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If a function $f$ is Riemann integrable on $[a,b]$, then $f$ is bounded and increasing on $[a,b]$.

\"", "description": "", "name": "f3"}, "tr5": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If $f$ is a bounded function on $[a,b]$, and if $P$ and $Q$ are partitions of $[a,b]$ with $Q$ a refinement of $P$, then $L(P) \\\\leq L(Q)$.

\"", "description": "", "name": "tr5"}, "ch1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(t=1,tr1,if(t=2,tr2,tr3))", "description": "", "name": "ch1"}, "tr6": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If $f$ is a bounded function on $[a,b]$, and if $P$ and $Q$ are partitions of $[a,b]$, then $U(P \\\\cup Q) \\\\leq U(P)$.

\"", "description": "", "name": "tr6"}, "tr2": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If a function $f$ is bounded and decreasing on $[a,b]$, then $f$ is Riemann integrable on $[a,b]$.

\"", "description": "", "name": "tr2"}, "f2": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If a function $f$ is Riemann integrable on $[a,b]$, then $f$ is bounded and decreasing on $[a,b]$.

\"", "description": "", "name": "f2"}, "f": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "f"}, "tr3": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If a function $f$ is continuous on $[a,b]$, then $f$ is Riemann integrable on $[a,b]$.

\"", "description": "", "name": "tr3"}, "f8": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If a function $f$ is Riemann integrable on $[a,b]$, then $f$ is continuous on $[a,b]$.

\"", "description": "", "name": "f8"}, "f6": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If $f$ is a bounded function on $[a,b]$, and if $P_n$ ($n \\\\in \\\\mathbb{N}$) are partitions of $[a,b]$, then $U(P_n)-L(P_n) \\\\to 0$ as $n \\\\to \\\\infty$.

\"", "description": "", "name": "f6"}, "ch3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(v=1,f1,if(v=2,f2,if(v=3,f3,f8)))", "description": "", "name": "ch3"}, "ch4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(f=1,f4,if(f=2,f5,if(f=3,f6, f7)))", "description": "", "name": "ch4"}, "tr4": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If $f$ is a bounded function on $[a,b]$, and if $P$ and $Q$ are partitions of $[a,b]$, then $L(P) \\\\leq U(Q)$.

\"", "description": "", "name": "tr4"}, "tr1": {"templateType": "long string", "group": "Ungrouped variables", "definition": "\"

If a function $f$ is bounded and increasing on $[a,b]$, then $f$ is Riemann integrable on $[a,b]$.

\"", "description": "", "name": "tr1"}, "g": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..3)", "description": "", "name": "g"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..3)", "description": "", "name": "t"}}, "ungrouped_variables": ["f1", "f2", "f3", "f4", "f5", "f6", "t", "tr1", "u", "tr2", "tr3", "tr4", "tr5", "tr6", "g", "f", "h", "ch1", "ch2", "ch3", "ch4", "v", "tr7", "tr8", "f7", "f8"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"displayType": "checkbox", "layout": {"expression": ""}, "marks": 0, "choices": ["

{Ch1}

", "

{Ch2}

", "

{Ch3}

", "

{Ch4}

"], "matrix": [[1, -1], [1, -1], ["-1", "1"], [-1, 1]], "type": "m_n_x", "maxAnswers": 0, "shuffleChoices": true, "warningType": "none", "scripts": {}, "maxMarks": 0, "minAnswers": 0, "minMarks": 0, "shuffleAnswers": false, "showCorrectAnswer": true, "answers": ["True", "False"]}], "type": "gapfill", "prompt": "\n \n \n

[[0]]

\n \n \n \n", "showCorrectAnswer": true, "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

Answer the following question on continuity and differentiability. Note that every correct answer is worth 1 mark, but every wrong answer loses a mark.

", "tags": ["checked2015", "continuous", "convergence", "convergent sequences", "limits", "MAS1601", "MAS2224", "sequence", "sequences"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

17/04/15:

\n

(OK) new question adapting the format of an older question

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Multiple response question (2 correct out of 4) covering properties of Riemann integration. Selection of questions from a pool.

"}, "advice": "

You should be able to work out the correct answers from your notes.

"}], "name": "", "pickQuestions": 0, "pickingStrategy": "all-ordered"}], "pickQuestions": 0, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}], "extensions": ["jsxgraph"], "custom_part_types": [], "resources": []}