// Numbas version: exam_results_page_options {"name": "Complete the square", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"s1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s1"}, "disc": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(b*c+a*d)^2-4*a*b*c*d", "description": "", "name": "disc"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "b"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "c1*s3", "description": "", "name": "c"}, "f": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a*b", "description": "", "name": "f"}, "d1": {"templateType": "anything", "group": "Ungrouped variables", "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))", "description": "", "name": "d1"}, "s2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s2"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "name": "a"}, "n3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "2*a*b", "description": "", "name": "n3"}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "b*c-a*d", "description": "", "name": "n2"}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "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))", "description": "", "name": "c1"}, "rdis": {"templateType": "anything", "group": "Ungrouped variables", "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. ')", "description": "", "name": "rdis"}, "n4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "abs(n2)", "description": "", "name": "n4"}, "s3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "name": "s3"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(d1=-b*c/a, max(d1+1,random(1..5))*s3,d1*s3)", "description": "", "name": "d"}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "b*c+a*d", "description": "", "name": "n1"}, "n5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a*b", "description": "", "name": "n5"}, "rep": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(disc=0,'repeated', ' ')", "description": "", "name": "rep"}}, "ungrouped_variables": ["a", "c", "b", "d", "f", "s3", "s2", "s1", "n4", "n2", "disc", "rdis", "n1", "rep", "n3", "c1", "n5", "d1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Complete the square", "functions": {}, "showQuestionGroupNames": false, "parts": [{"stepsPenalty": 1, "scripts": {}, "gaps": [{"answer": "{n5}(x+({-n1}/{2*n5}))^2-{n2^2}/{4*n5}", "musthave": {"message": "

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

", "showStrings": false, "partialCredit": 0, "strings": ["(", ")", "^"]}, "vsetrange": [0, 1], "checkingaccuracy": 0.0001, "showCorrectAnswer": true, "expectedvariablenames": [], "notallowed": {"message": "

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

", "showStrings": false, "partialCredit": 0, "strings": [".", "x*x", "x x", "x(", "x (", ")x", ") x"]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "answersimplification": "std", "marks": 2, "vsetrangepoints": 5}], "type": "gapfill", "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 ", "steps": [{"type": "information", "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 ", "showCorrectAnswer": true, "scripts": {}, "marks": 0}], "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "{n1-n4}/{2*a*b}", "vsetrange": [0, 1], "checkingaccuracy": 0.0001, "showCorrectAnswer": true, "expectedvariablenames": [], "notallowed": {"message": "

input numbers as fractions or integers not as a decimals

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

input numbers as fractions or integers not as a decimals

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "answersimplification": "all,fractionNumbers", "marks": 1, "vsetrangepoints": 5}], "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 ", "showCorrectAnswer": true, "marks": 0}], "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"]}, "preamble": {"css": "", "js": ""}, "type": "question", "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", "licence": "Creative Commons Attribution 4.0 International", "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$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "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}\\]

", "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/"}]}