// Numbas version: exam_results_page_options {"name": "Kevin's copy of Complete the square", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"advice": "

Completing the square for the quadratic expression $\\simplify{{a*b}x^2+{-n1}x+{c*d}}$.
\\[\\begin{eqnarray} \\simplify{{a*b}x^2+{-n1}x+{c*d}}&=&\\var{n5}\\left(\\simplify{x^2+({-n1}/{a*b})x+ {c*d}/{a*b}}\\right)\\\\ &=&\\var{n5}\\left(\\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2+ \\simplify{{c*d}/{a*b}-({-n1}/({2*a*b}))^2}\\right)\\\\ &=&\\var{n5}\\left(\\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2 -\\simplify{ {n2^2}/{4*(a*b)^2}}\\right)\\\\ &=&\\var{n5}\\left(\\simplify{x+({-n1}/{2*n5})}\\right)^2 -\\simplify{ {n2^2}/{4*(n5)}} \\end{eqnarray} \\]
So to solve $\\simplify{{a*b}x^2+{-n1}x+{c*d}}=0$ we have to solve:
\\[\\begin{eqnarray} \\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2&\\phantom{{}}& -\\simplify{ {n2^2}/{4*(a*b)^2}}=0\\Rightarrow\\\\ \\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2&\\phantom{{}}&=\\simplify{ {n2^2}/{4*(a*b)^2}=({abs(n2)}/{2*a*b})^2} \\end{eqnarray}\\]
So we get the two {rep} solutions:
\\[\\begin{eqnarray} \\simplify{x+({-n1}/{2*a*b})}&=&\\simplify{{abs(n2)}/{2*a*b}} \\Rightarrow &x& = \\simplify{({abs(n2)+n1}/{2*a*b})}\\\\ \\simplify{x+({-n1}/{2*a*b})}&=&\\simplify{-({abs(n2)}/{2*a*b})} \\Rightarrow &x& = \\simplify{({n1-abs(n2)}/{2*a*b})} \\end{eqnarray}\\]

", "ungrouped_variables": ["a", "c", "b", "d", "f", "s3", "s2", "s1", "n4", "n2", "disc", "rdis", "n1", "rep", "n3", "c1", "n5", "d1"], "preamble": {"js": "", "css": ""}, "variables": {"a": {"definition": "random(2..5)", "name": "a", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s3": {"definition": "random(1,-1)", "name": "s3", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "c": {"definition": "c1*s3", "name": "c", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s1": {"definition": "random(1,-1)", "name": "s1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "b": {"definition": "random(1..4)", "name": "b", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "d1": {"definition": "switch(f=1, random(1..6),f=2,random(1,3,5,7,9),f=3,random(1,2,5,7,8),f=4,random(1,3,5,7,9),f=6, random(1,5,7,8),f=9,random(1,2,4,7,8),f=8,random(1,3,5,7,9),f=12,random(1,5,7),random(1,3,5,7))", "name": "d1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "c1": {"definition": "switch(f=1, random(1..6),f=2,random(1,3,5,7,9),f=3,random(1,2,5,7,8),f=4,random(1,3,5,7,9),f=6, random(1,5,7,8),f=9,random(1,2,4,7,8),f=8,random(1,3,5,7,9),f=12,random(1,5,7),random(1,3,5,7))", "name": "c1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "n1": {"definition": "b*c+a*d", "name": "n1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "s2": {"definition": "random(1,-1)", "name": "s2", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "disc": {"definition": "(b*c+a*d)^2-4*a*b*c*d", "name": "disc", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "rep": {"definition": "switch(disc=0,'repeated', ' ')", "name": "rep", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "n4": {"definition": "abs(n2)", "name": "n4", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "d": {"definition": "if(d1=-b*c/a, max(d1+1,random(1..5))*s3,d1*s3)", "name": "d", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "f": {"definition": "a*b", "name": "f", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "n5": {"definition": "a*b", "name": "n5", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "n2": {"definition": "b*c-a*d", "name": "n2", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "rdis": {"definition": "switch(disc=0,'The discriminant is '+ 0+' and so we get two repeated roots in this case.',disc<0, 'There are no real roots.','The roots exist and are distinct. ')", "name": "rdis", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "n3": {"definition": "2*a*b", "name": "n3", "group": "Ungrouped variables", "description": "", "templateType": "anything"}}, "question_groups": [{"questions": [], "pickQuestions": 0, "name": "", "pickingStrategy": "all-ordered"}], "functions": {}, "metadata": {"notes": "\n \t\t

20/06/2012:

\n \t\t

Added tags.

\n \t\t

Improved spacing, added some full stops!

\n \t\t

Changed \"Using that\" to \"Hence\" in statement.

\n \t\t

3/07/2012:

\n \t\t

Added tags.

\n \t\t

4/07/2012:

\n \t\t

In part a - When submitted answer c=7-(31^2)/48 is accepted however question asks for answer as a fraction or an integer but this is a combination of both.

\n \t\t

9/07/2012:

\n \t\t

Added reminder about using integers or fractions in last part.

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

Complete the square for a quadratic polynomial $q(x)$ by writing it in the form $a(x+b)^2+c$.  Find both roots of the equation $q(x)=0$.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"showCorrectAnswer": true, "gaps": [{"answer": "{n5}(x+({-n1}/{2*n5}))^2-{n2^2}/{4*n5}", "checkvariablenames": false, "type": "jme", "showCorrectAnswer": true, "vsetrangepoints": 5, "expectedvariablenames": [], "showpreview": true, "musthave": {"showStrings": false, "strings": ["(", ")", "^"], "partialCredit": 0, "message": "

write in the form $a(x+b)^2+c$

"}, "marks": 2, "checkingtype": "absdiff", "scripts": {}, "checkingaccuracy": 0.0001, "vsetrange": [0, 1], "notallowed": {"showStrings": false, "strings": [".", "x*x", "x x", "x(", "x (", ")x", ") x"], "partialCredit": 0, "message": "

write in the form $a(x+b)^2+c$ without using decimals

"}, "answersimplification": "std"}], "stepsPenalty": 1, "scripts": {}, "type": "gapfill", "steps": [{"type": "information", "showCorrectAnswer": true, "prompt": "\n \n \n

Given the quadratic $\\simplify{{a*b} * x ^ 2 + ( {-b*c-a * d}) * x + {c * d}}$ we complete the square by:

\n \n \n \n

1. Writing the quadratic as \\[\\var{n5}\\left(\\simplify{x^2+({-n1}/{n5})x+ {c*d}/{n5}}\\right)\\]

\n \n \n \n

2. Then complete the square for the quadratic \\[\\simplify{x^2+({-n1}/{n5})x+ {c*d}/{n5}}\\]

\n \n \n \n

3. Remember to multiply by {n5} the expression found from the second stage.

\n \n \n ", "marks": 0, "scripts": {}}], "prompt": "\n

\\[q(x)=\\simplify[std]{{a*b} * x ^ 2 + ( {-b*c-a * d}) * x + {c * d}}\\]
Now write $q(x) = a(x+b)^2+c\\;\\;$ for fractions or integers $a$, $b$, $c$.

\n


$q(x)=\\;$ [[0]]

\n

You can get more information on completing the square by clicking on Show steps.

\n

You will lose 1 mark if you do so.

\n

Remember: Input all numbers as fractions or integers and not as decimals.

\n ", "marks": 0}, {"showCorrectAnswer": true, "gaps": [{"answer": "{n1-n4}/{2*a*b}", "checkvariablenames": false, "type": "jme", "showCorrectAnswer": true, "vsetrangepoints": 5, "expectedvariablenames": [], "showpreview": true, "marks": 1, "checkingtype": "absdiff", "scripts": {}, "checkingaccuracy": 0.0001, "vsetrange": [0, 1], "notallowed": {"showStrings": false, "strings": ["."], "partialCredit": 0, "message": "

input numbers as fractions or integers not as a decimals

"}, "answersimplification": "all,fractionNumbers"}, {"answer": "{n1+n4}/{2*a*b}", "checkvariablenames": false, "type": "jme", "showCorrectAnswer": true, "vsetrangepoints": 5, "expectedvariablenames": [], "showpreview": true, "marks": 1, "checkingtype": "absdiff", "scripts": {}, "checkingaccuracy": 0.0001, "vsetrange": [0, 1], "notallowed": {"showStrings": false, "strings": ["."], "partialCredit": 0, "message": "

input numbers as fractions or integers not as a decimals

"}, "answersimplification": "all,fractionNumbers"}], "scripts": {}, "type": "gapfill", "prompt": "\n

Now find the roots of the quadratic equation $\\simplify{{a*b}x^2+{-n1}x+{c*d}}=0$.

\n

The least root is $x=\\;$ [[0]]. The greatest root is $x=\\;$ [[1]].

\n

Input numbers as fractions or integers not as a decimals

\n ", "marks": 0}], "type": "question", "variable_groups": [], "showQuestionGroupNames": false, "statement": "\n

Complete the square for the quadratic expression $q(x)$ by writing it in the form \\[a(x+b)^2+c\\] for numbers $a,\\;b$ and $c$.

\n

Hence find both roots of the equation $q(x)=0$.

\n ", "tags": ["algebra", "algebraic manipulation", "checked2015", "completing the square", "functions", "MAS1601", "mas1601", "quadratic equations", "quadratic expressions", "quadratics", "roots of a quadratic", "solving a quadratic", "Steps", "steps"], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers"]}, "variablesTest": {"maxRuns": 100, "condition": ""}, "name": "Kevin's copy of Complete the square", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Kevin Bohan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3363/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Kevin Bohan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3363/"}]}