// 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": [{"functions": {}, "name": "Complete the square", "tags": ["Steps", "algebra", "algebraic manipulation", "complete the square", "completing the square", "quadratics", "steps"], "advice": "\n

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}}\\]

\n ", "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "parts": [{"stepspenalty": 1.0, "prompt": "

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

", "gaps": [{"notallowed": {"message": "

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

", "showstrings": false, "strings": ["x^2", "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": "(x+{a})^2+{b}", "type": "jme", "musthave": {"message": "

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

", "showstrings": false, "strings": ["(", ")", "^"], "partialcredit": 0.0}}], "steps": [{"prompt": "\n

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)$.

\n ", "type": "information", "marks": 0.0}], "marks": 0.0, "type": "gapfill"}], "extensions": [], "statement": "\n

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.

\n ", "variable_groups": [], "progress": "ready", "type": "question", "variables": {"a": {"definition": "s1*random(1.0..9.5#0.5)", "name": "a"}, "s1": {"definition": "random(1,-1)", "name": "s1"}, "b": {"definition": "random(1..20)-a^2", "name": "b"}}, "metadata": {"notes": "\n \t\t

5/08/2012:

\n \t\t

Added tags.

\n \t\t

Added description.

\n \t\t

Checked calculation.OK.

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

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

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