// Numbas version: exam_results_page_options {"name": "Factorising Quadratics 5 - Completing the Square", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["a", "s1", "b"], "name": "Factorising Quadratics 5 - Completing the Square", "tags": ["algebra", "algebraic manipulation", "complete the square", "completing the square", "quadratics", "steps", "Steps"], "preamble": {"css": "", "js": ""}, "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}}\\]

", "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "parts": [{"stepsPenalty": 1, "prompt": "

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

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "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}, "vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.0001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "(x+{a})^2+{b}", "marks": 2, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme", "musthave": {"message": "

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

", "showStrings": false, "strings": ["(", ")", "^"], "partialCredit": 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 ", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}], "statement": "

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

\n

Your answer must be input exactly in this form.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "s1*random(1.0..9.5#0.5)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "s1": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s1", "description": ""}, "b": {"definition": "random(1..20)-a^2", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}}, "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"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Katie Lester", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/586/"}]}]}], "contributors": [{"name": "Katie Lester", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/586/"}]}