// Numbas version: exam_results_page_options {"name": "Complete the square. (Video)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "name": "Complete the square. (Video)", "tags": ["Steps", "algebra", "algebraic manipulation", "complete the square", "completing the square", "quadratics", "roots of a polynomial", "roots of a quadratic", "solving equations", "solving quadratic equation", "steps", "video"], "advice": "\n \n \n
Completing the square for the quadratic expression $\\simplify{{a*b}x^2+{-n1}x+{c*d}}$
\\[\\begin{eqnarray}\n \n \\simplify{{a*b}x^2+{-n1}x+{c*d}}&=&\\var{n5}\\left(\\simplify{x^2+({-n1}/{a*b})x+ {c*d}/{a*b}}\\right)\\\\\n \n &=&\\var{n5}\\left(\\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2+ \\simplify{{c*d}/{a*b}-({-n1}/({2*a*b}))^2}\\right)\\\\\n \n &=&\\var{n5}\\left(\\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2 -\\simplify{ {n2^2}/{4*(a*b)^2}}\\right)\\\\\n \n &=&\\var{n5}\\left(\\simplify{x+({-n1}/{2*n5})}\\right)^2 -\\simplify{ {n2^2}/{4*(n5)}}\n \n \\end{eqnarray}\n \n \\]
So to solve $\\simplify{{a*b}x^2+{-n1}x+{c*d}}=0$ we have to solve:
\\[\\begin{eqnarray}\n \n \\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2&\\phantom{{}}& -\\simplify{ {n2^2}/{4*(a*b)^2}}=0\\Rightarrow\\\\\n \n \\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2&\\phantom{{}}&=\\simplify{ {n2^2}/{4*(a*b)^2}=({abs(n2)}/{2*a*b})^2}\n \n \\end{eqnarray}\\]
So we get the two {rep} solutions:
\\[\\begin{eqnarray}\n \n \\simplify{x+({-n1}/{2*a*b})}&=&\\simplify{{abs(n2)}/{2*a*b}} \\Rightarrow &x& = \\simplify{({abs(n2)+n1}/{2*a*b})}\\\\\n \n \\simplify{x+({-n1}/{2*a*b})}&=&\\simplify{-({abs(n2)}/{2*a*b})} \\Rightarrow &x& = \\simplify{({n1-abs(n2)}/{2*a*b})}\n \n \\end{eqnarray}\\]
\\[q(x)=\\simplify[std]{{a*b} * x ^ 2 + ( {-b*c-a * d}) * x + {c * d}}\\]
Write $q(x) = a(x+b)^2+c\\;\\;$ for fractions or integers $a$, $b$, $c$.
$q(x)=\\;$ [[0]]
\nYou can get more information on completing the square by clicking on Show steps. You will lose 1 mark if you do so.
\nYou will also find a video covering the use of completing the square in solving a quadratic equation.
\nInput all numbers as fractions or integers and not as decimals.
", "gaps": [{"notallowed": {"message": "Write in the form $a(x+b)^2+c$ without using decimals.
", "showstrings": false, "strings": [".", "x*x", "x x", "x(", "x (", ")x", ") x"], "partialcredit": 0.0}, "checkingaccuracy": 0.0001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 2.0, "answer": "{n5}(x+({-n1}/{2*n5}))^2-{n2^2}/{4*n5}", "type": "jme", "musthave": {"message": "write in the form $a(x+b)^2+c$
", "showstrings": false, "strings": ["(", ")", "^"], "partialcredit": 0.0}}], "steps": [{"prompt": "Given the quadratic $\\simplify{{a*b} * x ^ 2 + ( {-b*c-a * d}) * x + {c * d}}$ we complete the square by:
\n1. Writing the quadratic as \\[\\var{n5}\\left(\\simplify{x^2+({-n1}/{n5})x+ {c*d}/{n5}}\\right)\\]
\n2. Then complete the square for the quadratic \\[\\simplify{x^2+({-n1}/{n5})x+ {c*d}/{n5}}\\]
\n3. Remember to multiply by $\\var{n5}$ the expression found from the second stage.
\nThe following video steps through a similar problem.
\n \n", "type": "information", "marks": 0.0}], "marks": 0.0, "type": "gapfill"}, {"prompt": "\n
Now find the roots of the quadratic equation $\\simplify{{a*b}x^2+{-n1}x+{c*d}}=0$.
\nThe least root is $x=\\;$ [[0]]. The greatest root is $x=\\;$ [[1]].
\nInput the roots as fractions or integers not as decimals.
\n ", "gaps": [{"notallowed": {"message": "Input numbers as fractions or integers not as decimals.
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.0001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 1.0, "answer": "{n1-n4}/{2*a*b}", "type": "jme"}, {"notallowed": {"message": "Input numbers as fractions or integers not as decimals.
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.0001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 1.0, "answer": "{n1+n4}/{2*a*b}", "type": "jme"}], "type": "gapfill", "marks": 0.0}], "extensions": [], "statement": "Complete the square for the quadratic expression $q(x)$ given below by writing it in the form \\[a(x+b)^2+c\\] for numbers $a,\\;b$ and $c$.
\nHence, or otherwise, find both roots of the equation $q(x)=0$.
\n", "variable_groups": [], "progress": "ready", "type": "question", "variables": {"a": {"definition": "random(2..5)", "name": "a"}, "c": {"definition": "c1*s3", "name": "c"}, "b": {"definition": "random(1..4)", "name": "b"}, "d": {"definition": "if(d1=b*c/a, max(d1+1,random(1..5))*s3,d1*s3)", "name": "d"}, "f": {"definition": "a*b", "name": "f"}, "s3": {"definition": "random(1,-1)", "name": "s3"}, "s2": {"definition": "random(1,-1)", "name": "s2"}, "s1": {"definition": "random(1,-1)", "name": "s1"}, "n5": {"definition": "a*b", "name": "n5"}, "disc": {"definition": "(b*c+a*d)^2-4*a*b*c*d", "name": "disc"}, "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"}, "rep": {"definition": "switch(disc=0,'repeated', ' ')", "name": "rep"}, "n1": {"definition": "b*c+a*d", "name": "n1"}, "n2": {"definition": "b*c-a*d", "name": "n2"}, "n3": {"definition": "2*a*b", "name": "n3"}, "n4": {"definition": "abs(n2)", "name": "n4"}, "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"}, "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"}}, "metadata": {"notes": "\n \t\t
5/08/2012:
\n \t\tAdded tags.
\n \t\tAdded description.
\n \t\tCorrected variable value n2 to ensure that there are no repeated roots.
\n \t\tChecked calculation.OK.
\n \t\tImproved display in content areas.
\n \t\t", "description": "Find $p$ and $q$ such that $ax^2+bx+c = a(x+p)^2+q$.
\nHence, or otherwise, find roots of $ax^2+bx+c=0$.
\nIncludes a video which shows how to solve a quadratic by completing the square.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}