// Numbas version: exam_results_page_options {"name": "Inbbavathie's copy of Complete the square and find solutions (SP1)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["big", "sml", "bits"], "rulesets": {}, "statement": "
We can rewrite quadratic equations given in the form $ax^2+bx+c$ as a square plus another term - this is called \"completing the square\".
\nThis can be useful when it isn't obvious how to fully factorise a quadratic equation.
", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Solve a quadratic equation by completing the square. The roots are not pretty!
"}, "parts": [{"gaps": [{"checkingaccuracy": 0.001, "musthave": {"strings": [")^2"], "partialCredit": 0, "message": "It doesn't look like you've completed the square.
", "showStrings": false}, "answer": "(x+{bits[0]})^2-{bits[1]^2}", "checkingtype": "absdiff", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": 1, "expectedvariablenames": [], "notallowed": {"strings": ["x^2"], "partialCredit": 0, "message": "It doesn't look like you've completed the square.
", "showStrings": false}, "showpreview": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "checkvariablenames": false, "type": "jme", "variableReplacements": [], "vsetrangepoints": 5, "vsetrange": [0, 1]}], "scripts": {}, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "prompt": "Write the following expression in the form $a(x+b)^2-c$.
\n$\\simplify {x^2+{sml}x+{big}} = $ [[0]]
", "variableReplacements": [], "marks": 0, "type": "gapfill"}, {"gaps": [{"checkingaccuracy": 0.001, "answer": "{-bits[0]-bits[1]}", "checkingtype": "absdiff", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": 1, "expectedvariablenames": [], "showpreview": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "checkvariablenames": false, "type": "jme", "variableReplacements": [], "vsetrangepoints": 5, "vsetrange": [0, 1]}, {"checkingaccuracy": 0.001, "answer": "{-bits[0]+bits[1]}", "checkingtype": "absdiff", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": 1, "expectedvariablenames": [], "showpreview": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "checkvariablenames": false, "type": "jme", "variableReplacements": [], "vsetrangepoints": 5, "vsetrange": [0, 1]}], "scripts": {}, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "prompt": "Now solve the quadratic equation
\n\\[ \\simplify {x^2+{sml}x+{big}} = 0\\text{.} \\]
\nGive the lowest solution first.
\n$x_1=$ [[0]]
\nor
\n$x_2=$ [[1]]
", "variableReplacements": [], "marks": 0, "type": "gapfill"}], "name": "Inbbavathie's copy of Complete the square and find solutions (SP1)", "variable_groups": [], "advice": "Completing the square works by noticing that
\n\\[ (x+a)^2 = x^2 + 2ax + a^2 \\]
\nSo when we see an expression of the form $x^2 + 2ax$, we can rewrite it as $(x+a)^2-a^2$.
\nRewrite $x^2+\\var{sml}x$ as $\\simplify[basic]{ (x+{sml/2})^2 - {sml/2}^2}$.
\n\\begin{align}
\\simplify[basic]{x^2+{sml}x+{big}} &= \\simplify[basic]{(x+{sml/2})^2-{(sml/2)}^2+{big}} \\\\
&= \\simplify[basic]{(x+{sml/2})^2+{-(sml/2)^2+big}} \\text{.}
\\end{align}
We showed above that
\n\\[ \\simplify[basic]{x^2+{sml}x+{big}} = 0 \\]
\nis equivalent to
\n\\[ \\simplify[basic]{(x+{bits[0]})^2-{bits[1]^2}} = 0 \\text{.} \\]
\nWe can then rearrange this equation to solve for $x$.
\n\\begin{align}
\\simplify{(x+{bits[0]})^2-{(bits[1])^2} } &= 0 \\\\
(x+\\var{bits[0]})^2 &= \\var{bits[1]^2} \\\\
x+\\var{bits[0]} &= \\pm \\var{bits[1]} \\\\
x &= -\\var{bits[0]} \\pm \\var{bits[1]} \\\\[2em]
x_1 &= \\var{-bits[0]-bits[1]} \\text{,}\\\\
x_2 &= \\var{-bits[0]+bits[1]} \\text{.}
\\end{align}
The coefficient of $x$ in the expanded quadratic.
", "name": "sml", "templateType": "anything"}, "big": {"definition": "bits[0]^2-bits[1]^2", "group": "Ungrouped variables", "description": "The constant term in the expanded quadratic.
", "name": "big", "templateType": "anything"}, "bits": {"definition": "sort(shuffle(1..9)[0..2])", "group": "Ungrouped variables", "description": "After completing the square, the expression will have the form $(x + \\mathrm{bits}[0])^2 - \\mathrm{bits}[1]^2$.
", "name": "bits", "templateType": "anything"}}, "extensions": [], "preamble": {"js": "", "css": ""}, "tags": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question", "contributors": [{"name": "Inbbavathie Ravi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1620/"}]}]}], "contributors": [{"name": "Inbbavathie Ravi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1620/"}]}