// Numbas version: exam_results_page_options {"name": "Solving a quadratic by 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", "b", "c", "dd", "d", "scoeff", "lcoeff", "ccoeff", "disc", "lengthdet", "div", "argtop", "argbot", "sqrtargtop", "sqrtargbot"], "name": "Solving a quadratic by completing the square", "tags": ["completing the square", "formula", "quadratic", "quadratics", "roots", "solving"], "preamble": {"css": "", "js": ""}, "advice": "", "rulesets": {}, "parts": [{"stepsPenalty": "8", "prompt": "

Fill in the blanks to solve the quadratic by completing the square:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\simplify{{scoeff}x^2+{lcoeff}x+{ccoeff+c}}$$=$$\\var{c}$
$\\Longrightarrow$$\\simplify{{scoeff}x^2+{lcoeff}x}$ $=$[[0]]
$\\Longrightarrow$$x^2+$[[1]]$x$$=$[[2]]
$\\Longrightarrow$$x^2+$[[1]]$x+$[[3]]$=$[[4]]
$\\Longrightarrow$$(x+$[[5]]$)^2$$=$[[4]]
$\\Longrightarrow$$(x+$[[5]]$)$$=$$\\pm$[[6]]
$\\Longrightarrow$$x$$=$[[7]]
\n

\n

Note: In the last gap, if $x=1,2$, enter set(1,2).

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "steps": [{"prompt": "

Recall 

\n

$(x+a)^2=x^2+2ax+a^2$

\n

is called a perfect square. Now, notice if we let $b=2a$ this equation would become

\n

$\\left(x+\\frac{b}{2}\\right)^2=x^2+bx+\\left(\\frac{b}{2}\\right)^2$.

\n

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\simplify{{scoeff}x^2+{lcoeff}x+{ccoeff+c}}$$=$$\\var{c}$
$\\simplify{{scoeff}x^2+{lcoeff}x}$ $=$$\\var{-ccoeff}$(get all constants on the right hand side)
$x^2+\\simplify{{lcoeff}/{scoeff}}x$$=$$\\simplify{{-ccoeff}/{scoeff}}$(divide every term by the coefficient of $x^2$)
$x^2+\\simplify{{lcoeff}/{scoeff}}x+\\simplify{{lcoeff^2}/{4*scoeff^2}}$$=$$\\simplify{{argtop}/{argbot}}$(halve the coefficient of $x$, then square, then add to both sides)
$(x+\\simplify{{lcoeff}/{2*scoeff}})^2$$=$$\\simplify{{argtop}/{argbot}}$(rewrite the left hand side as a perfect square)
$(x+\\simplify{{lcoeff}/{2*scoeff}})$$=$$\\pm \\simplify{{sqrtargtop}/{sqrtargbot}}$(take the plus or minus square root of both sides)
$x$$=$$\\simplify{{-c}/{a}},\\simplify{{-d}/{b}}$(solve for $x$)
\n

Note: we would enter the final answer as set$\\left(\\simplify{{-c}/{a}},\\simplify{{-d}/{b}}\\right)$.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "gaps": [{"integerPartialCredit": 0, "integerAnswer": true, "allowFractions": false, "variableReplacements": [], "maxValue": "{-ccoeff}", "minValue": "{-ccoeff}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": false, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": true, "variableReplacements": [], "maxValue": "{lcoeff}/{scoeff}", "minValue": "{lcoeff}/{scoeff}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": false, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": true, "variableReplacements": [], "maxValue": "{-ccoeff}/{scoeff}", "minValue": "{-ccoeff}/{scoeff}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": true, "variableReplacements": [], "maxValue": "{lcoeff^2}/{4*scoeff^2}", "minValue": "{lcoeff^2}/{4*scoeff^2}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": false, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": true, "variableReplacements": [], "maxValue": "{argtop}/{argbot}", "minValue": "{argtop}/{argbot}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": true, "variableReplacements": [], "maxValue": "{lcoeff}/{2*scoeff}", "minValue": "{lcoeff}/{2*scoeff}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": true, "variableReplacements": [], "maxValue": "{sqrtargtop}/{sqrtargbot}", "minValue": "{sqrtargtop}/{sqrtargbot}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "set({-c}/{a},{-d}/{b})", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": [], "statement": "", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(2..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(2..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(2..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "if(c*b=a*dd,dd+1,dd)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "sqrtargtop": {"definition": "sqrt(argtop)", "templateType": "anything", "group": "Ungrouped variables", "name": "sqrtargtop", "description": ""}, "dd": {"definition": "random(2..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "dd", "description": ""}, "ccoeff": {"definition": "c*d", "templateType": "anything", "group": "Ungrouped variables", "name": "ccoeff", "description": ""}, "argbot": {"definition": "4*scoeff^2", "templateType": "anything", "group": "Ungrouped variables", "name": "argbot", "description": ""}, "sqrtargbot": {"definition": "sqrt(argbot)", "templateType": "anything", "group": "Ungrouped variables", "name": "sqrtargbot", "description": ""}, "argtop": {"definition": "lcoeff^2-4*ccoeff*scoeff", "templateType": "anything", "group": "Ungrouped variables", "name": "argtop", "description": ""}, "lcoeff": {"definition": "a*d+b*c", "templateType": "anything", "group": "Ungrouped variables", "name": "lcoeff", "description": ""}, "lengthdet": {"definition": "abs(a*d-b*c)", "templateType": "anything", "group": "Ungrouped variables", "name": "lengthdet", "description": ""}, "div": {"definition": "lcoeff/scoeff", "templateType": "anything", "group": "Ungrouped variables", "name": "div", "description": ""}, "scoeff": {"definition": "a*b", "templateType": "anything", "group": "Ungrouped variables", "name": "scoeff", "description": ""}, "disc": {"definition": "(lcoeff^2-4*scoeff*ccoeff)", "templateType": "anything", "group": "Ungrouped variables", "name": "disc", "description": ""}}, "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}