// Numbas version: exam_results_page_options {"name": "7. Unusual Domain", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "parts": [{"prompt": "

Find the area enclosed by one of its leaves.

", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 1, "variableReplacements": [], "answer": "{k^2/gcd}/{2*n/gcd}pi", "vsetrangepoints": 5, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "showpreview": true, "vsetrange": [0, 1], "showFeedbackIcon": true, "checkvariablenames": false, "type": "jme", "scripts": {}, "expectedvariablenames": []}, {"prompt": "

Find the area of $f$ in the interval $[-\\pi/\\var{2*n},\\var{4n-1}\\pi/\\var{2*n}]$.

", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 1, "variableReplacements": [], "correctAnswerFraction": false, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "0", "showFeedbackIcon": true, "type": "numberentry", "scripts": {}, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "0"}], "metadata": {"description": "

I created this question, and every other question in Multiple Integration, for my dissertation `Computer-Aided Assessment of Multiple Integration'.

", "licence": "None specified"}, "name": "7. Unusual Domain", "functions": {"meme": {"type": "html", "parameters": [], "language": "javascript", "definition": "k = 1;\nn = 9;\npi = Math.PI;\n\nvar makeboard = Numbas.extensions.jsxgraph.makeBoard\n('250px','250px',{boundingBox:[-1.2*k,1.2*k,1.2*k,-1.2*k], axis:true, grid:false}); // define how the graph is displayed\nvar board = makeboard.board; // generate the graph\n\nvar c1 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], -pi/(2*n), pi/(2*n)]);\nvar c2 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], 3*pi/(2*n), 5*pi/(2*n)]);\nvar c3 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], 7*pi/(2*n), 9*pi/(2*n)]);\nvar c4 = board.create('curve',\n [ function(r){ return 0.5;},\n [-0.5,0], 0, 2*pi]);\nvar c5 = board.create('curve',\n [ function(r){ return 0.4;},\n [-0.5,0], 0, 2*pi]);\n\nvar f = [];\nf.push(c1);\nf.push(c2);\nf.push(c3);\nf.push(c4);\nf.push(c5);\nvar area = board.create('curve', [[], []], {color: 'blue', opacity: 0.4});\narea.updateDataArray = function () {\n x = [], y = [];\n\n curve = f[0]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[1]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[2]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[3]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[4]; \n for (i = 0; i < curve.numberPoints; i++) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n \n// close the curve\n this.dataX = x;\n this.dataY = y;\n}\nreturn makeboard; // update the board"}, "domain": {"type": "html", "parameters": [], "language": "javascript", "definition": "var k = Numbas.jme.unwrapValue(scope.variables.k); // define random parameter k\nvar n = Numbas.jme.unwrapValue(scope.variables.n); // define random parameter n\npi = Math.PI;\n\nvar makeboard = Numbas.extensions.jsxgraph.makeBoard\n('250px','250px',{boundingBox:[-1.2*k,1.2*k,1.2*k,-1.2*k], axis:true, grid:false}); // define how the graph is displayed\nvar board = makeboard.board; // generate the graph\n\nvar c1 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], -pi/(2*n), pi/(2*n)]);\nvar c2 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], 3*pi/(2*n), 5*pi/(2*n)]);\nvar c3 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], 7*pi/(2*n), 9*pi/(2*n)]);\nvar c4 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], 11*pi/(2*n), 13*pi/(2*n)]);\nvar c5 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], 15*pi/(2*n), 17*pi/(2*n)]);\nvar c6 = board.create('curve',\n [ function(r){ return k*Math.cos(n*r);},\n [0,0], 19*pi/(2*n), 21*pi/(2*n)]);\n\nvar f = [];\nf.push(c1);\nf.push(c2);\nf.push(c3);\nf.push(c4);\nf.push(c5);\nf.push(c6);\nvar area = board.create('curve', [[], []], {color: 'blue', opacity: 0.4});\narea.updateDataArray = function () {\n x = [], y = [];\n\n curve = f[0]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[1]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[2]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[3]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[4]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n curve = f[5]; \n for (i = curve.numberPoints - 1; i >= 0; i--) {\n x.push(curve.points[i].usrCoords[1]);\n y.push(curve.points[i].usrCoords[2]);\n }\n \n// close the curve\n this.dataX = x;\n this.dataY = y;\n}\nreturn makeboard; // update the board"}}, "preamble": {"js": "", "css": ""}, "rulesets": {}, "variable_groups": [], "advice": "

a)

\n

     The limits of integration for $r$ are simply $0$ and $f$.

\n

\n

     Looking at the boundaries of the rightmost leaf, the upper side reaches $r=0$ when $\\var{n}\\theta=\\frac{\\pi}{2}$, and the lower side when $\\var{n}\\theta=-\\frac{\\pi}{2}$.

\n

     The limits of integration for $\\theta$ are therefore $\\pm\\pi/\\var{2*n}$.

\n

\n

     Because we just want the area, we integrate over $r$.

\n

\\[
A=\\int_{-\\pi/\\var{2*n}}^{\\pi/\\var{2*n}}\\int_0^{\\var{k}\\cos\\var{n}\\theta} r\\, \\mathrm{d}r\\,\\mathrm{d}\\theta
  =\\int_{-\\pi/\\var{2*n}}^{\\pi/\\var{2*n}} \\frac{1}{2}r^2 \\, \\bigg|_0^{\\var{k}\\cos\\var{n}\\theta} \\,\\mathrm{d}\\theta
  =\\int_{-\\pi/\\var{2*n}}^{\\pi/\\var{2*n}} \\simplify[fractionNumbers]{{k^2/2}}\\cos^2\\var{n}\\theta  \\,\\mathrm{d}\\theta
\\]

\n

     We know $\\cos^2\\theta=\\cos2\\theta+1$ from the double angle formulae, so we deduce that $\\cos^2\\var{n}\\theta=\\cos\\var{2*n}\\theta+1$.

\n

\\[
A=\\simplify[fractionNumbers]{{k^2/2}} \\int_{-\\pi/\\var{2*n}}^{\\pi/\\var{2*n}} \\cos\\var{2*n}\\theta+1 \\,\\mathrm{d}\\theta
  =\\simplify[fractionNumbers]{{k^2/2}}\\bigg(\\frac{1}{\\var{2*n}}\\sin\\var{2*n}\\theta+\\theta\\bigg) \\bigg|_{-\\pi/\\var{2*n}}^{\\pi/\\var{2*n}}
  =\\simplify[fractionNumbers]{{k^2/(2*n)}}\\pi
\\]

\n

b)

\n

     Over an interval of $2\\pi$, $f$ produces an equal number of positive and negative leaves. That is to say the leaves have positive and negative radii, and so they all cancel out with each other and therefore $A=0$.

", "statement": "

Consider the rose $f(\\theta)=\\var{k}\\cos\\var{n}\\theta$.

\n

{domain()}

", "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["k", "n", "gcd"], "variables": {"n": {"group": "Ungrouped variables", "name": "n", "description": "", "templateType": "randrange", "definition": "random(2..6#1)"}, "k": {"group": "Ungrouped variables", "name": "k", "description": "", "templateType": "randrange", "definition": "random(2..9#1)"}, "gcd": {"group": "Ungrouped variables", "name": "gcd", "description": "", "templateType": "anything", "definition": "gcd(k^2,2*n)"}}, "extensions": ["jsxgraph"], "type": "question", "contributors": [{"name": "Nicholas Barker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1915/"}]}]}], "contributors": [{"name": "Nicholas Barker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1915/"}]}