// 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"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)-a^2", "description": "", "name": "b"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s1*random(1.0..4.5#0.5)", "description": "", "name": "a"}}, "ungrouped_variables": ["a", "s1", "b"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Complete the square", "functions": {}, "showQuestionGroupNames": false, "parts": [{"stepsPenalty": 1, "scripts": {}, "gaps": [{"answer": "(x+{a})^2+{b}", "musthave": {"message": "

please input in the form $(x+a)^2+b$

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

Input your answer in the form $(x+a)^2+b$.

", "showStrings": false, "partialCredit": 0, "strings": ["x^2", "x*x", "x x", "x(", "x*("]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "answersimplification": "std", "marks": 2, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$\\simplify{x^2+{2*a}x+ {a^2+b}} = \\phantom{{}}$ [[0]].

", "steps": [{"type": "information", "prompt": "

Given the quadratic $q(x)=\\simplify{x^2+{2*a}x+ {a^2+b}}$:

\n

1. Complete the square for $\\simplify{x^2+{2*a}x}$, by comparing $\\simplify{x^2+{2*a}x}$ to $(x+B)^2=x^2+2Bx+B^2$. This will give us the value of $B$.

\n

2. Using your value of $B$, write $\\simplify{x^2+{2*a}x}$ as $(x+B)^2 - B^2$.

\n

3. Add $\\var{a^2+b}$ to both sides.

", "showCorrectAnswer": true, "scripts": {}, "marks": 0}], "showCorrectAnswer": true, "marks": 0}], "statement": "

Put the following quadratic expression in the form $(x+B)^2+C$ for suitable numbers $B$ and $C$.

\n

Note that you have to input your answer in the form $(x+B)^2+C$  and  the numbers $B,\\;C$ must be input exactly (they can be entered as integers, as fractions or as exact decimals). If $C=0$, then it may be omitted in the answer.

", "tags": ["algebra", "algebraic manipulation", "checked2015", "complete the square", "completing the square", "quadratics", "SFY0001", "Steps", "steps"], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "

Find $B$ and $C$ such that $x^2+bx+c = (x+B)^2+C$.

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

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

\n

1. Considering first $\\simplify{x^2+{2*a}x}$ and comparing to $(x+B)^2=x^2+2Bx+B^2$: both start with $x^2$ and we set $2B=\\var{2*a}$, so $B=\\var{a}$. Thus $\\simplify{(x+{a})^2=x^2+{2*a}x+{a}^2}$ and $\\simplify{x^2+{2*a}x=(x+{a})^2-{a}^2}$.

\n

2. It follows that $\\simplify{x^2+{2*a}x+{a^2+b}=(x+{a})^2-{a}^2}+\\simplify{{a^2+b}=(x+{a})^2+{b}}$.

\n

3. Hence we get \\[q(x) = \\simplify[all]{ (x+{a})^2+{b}}\\]

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