// Numbas version: exam_results_page_options {"name": "Completing 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": "Completing 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}}$ we complete the square by:

\n

1. Halving the coefficient of $x$ gives $\\var{a}$

\n

2. Work out $\\simplify[all]{p(x)=(x+{a})^2=x^2+{2*a}x+{a^2}}$.
This gives the first two terms of $q(x)$.

\n

3. But the constant term $\\simplify[all]{{a^2}}$ in $p(x)$ is not the same as in $q(x)$ – so we need to adjust by adding on a suitable constant to $p(x)$.

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

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

\n

Note that you have to input your answer in the form $(x+a)^2+b$  and  the numbers $a,\\;b$ must be input exactly.

", "tags": ["MAS1601", "Steps", "algebra", "algebraic manipulation", "checked2015", "complete the square", "completing the square", "mas1601", "quadratics", "steps"], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

14/7/2015

\n

Added module tag

\n

5/08/2012:

\n

Added tags.

\n

Added description.

\n

Checked calculation.OK.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Find $c$ and $d$ such that $x^2+ax+b = (x+c)^2+d$.

"}, "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. Halving the coefficient of $x$ gives $\\var{a}$

\n

2. Work out $\\simplify[all]{p(x)=(x+{a})^2=x^2+{2*a}x+{a^2}}$.
This gives the first two terms of $q(x)$.

\n

3. But the constant term $\\simplify[all]{{a^2}}$ in $p(x)$ is not the same as in $q(x)$, so we need to adjust by adding on $\\simplify[std,!fractionNumbers]{{a^2+b}-{a^2}={b}}$ to $p(x)$.
Hence we get \\[q(x) = \\simplify[all]{p(x)+{b} = (x+{a})^2+{b}}=\\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/"}]}