// Numbas version: finer_feedback_settings {"name": "Katherine's copy of Complete the square and find solutions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Solve a quadratic equation by completing the square. The roots are not pretty!

"}, "advice": "

Completing the square works by noticing that

\n

\\[ (x+a)^2 = x^2 + 2ax + a^2 \\]

\n

So when we see an expression of the form $x^2 + 2ax$, we can rewrite it as $(x+a)^2-a^2$.

\n

a)

\n

Rewrite $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}

\n

b)

\n

We showed above that

\n

\\[ \\simplify[basic]{x^2+{sml}x+{big}} = 0 \\]

\n

is equivalent to

\n

\\[ \\simplify[basic]{(x+{bits[0]})^2-{bits[1]^2}} = 0 \\text{.} \\]

\n

We 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}

", "parts": [{"scripts": {}, "prompt": "

Write the following expression in the form $a(x+b)^2-c$.

\n

$\\simplify {x^2+{sml}x+{big}} = $ [[0]]

", "variableReplacementStrategy": "originalfirst", "marks": 0, "type": "gapfill", "showFeedbackIcon": true, "variableReplacements": [], "gaps": [{"checkingtype": "absdiff", "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "answer": "(x+{bits[0]})^2-{bits[1]^2}", "checkvariablenames": false, "vsetrange": [0, 1], "musthave": {"message": "

It doesn't look like you've completed the square.

", "partialCredit": 0, "strings": [")^2"], "showStrings": false}, "showCorrectAnswer": true, "notallowed": {"message": "

It doesn't look like you've completed the square.

", "partialCredit": 0, "strings": ["x^2"], "showStrings": false}, "scripts": {}, "marks": 1, "checkingaccuracy": 0.001, "type": "jme", "expectedvariablenames": [], "showpreview": true, "variableReplacements": [], "showFeedbackIcon": true}], "showCorrectAnswer": true}, {"scripts": {}, "prompt": "

Now solve the quadratic equation

\n

\\[ \\simplify {x^2+{sml}x+{big}} = 0\\text{.} \\]

\n

Give the lowest solution first.

\n

$x_1=$ [[0]]

\n

or

\n

$x_2=$ [[1]]

", "variableReplacementStrategy": "originalfirst", "marks": 0, "type": "gapfill", "showFeedbackIcon": true, "variableReplacements": [], "gaps": [{"checkingtype": "absdiff", "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "answer": "{-bits[0]-bits[1]}", "checkvariablenames": false, "vsetrange": [0, 1], "showCorrectAnswer": true, "scripts": {}, "marks": 1, "checkingaccuracy": 0.001, "type": "jme", "expectedvariablenames": [], "showpreview": true, "variableReplacements": [], "showFeedbackIcon": true}, {"checkingtype": "absdiff", "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "answer": "{-bits[0]+bits[1]}", "checkvariablenames": false, "vsetrange": [0, 1], "showCorrectAnswer": true, "scripts": {}, "marks": 1, "checkingaccuracy": 0.001, "type": "jme", "expectedvariablenames": [], "showpreview": true, "variableReplacements": [], "showFeedbackIcon": true}], "showCorrectAnswer": true}], "tags": [], "functions": {}, "variable_groups": [], "extensions": [], "ungrouped_variables": ["big", "sml", "bits"], "rulesets": {}, "variables": {"bits": {"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", "definition": "sort(shuffle(1..9)[0..2])", "templateType": "anything"}, "big": {"group": "Ungrouped variables", "description": "

The constant term in the expanded quadratic.

", "name": "big", "definition": "bits[0]^2-bits[1]^2", "templateType": "anything"}, "sml": {"group": "Ungrouped variables", "description": "

The coefficient of $x$ in the expanded quadratic.

", "name": "sml", "definition": "2*bits[0]", "templateType": "anything"}}, "name": "Katherine's copy of Complete the square and find solutions", "preamble": {"js": "", "css": ""}, "statement": "", "type": "question", "contributors": [{"name": "Katherine Tomlinson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1652/"}], "resources": []}]}], "contributors": [{"name": "Katherine Tomlinson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1652/"}]}