// Numbas version: exam_results_page_options {"name": "Terry's copy of 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": [{"type": "question", "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0, "name": ""}], "variable_groups": [], "variables": {"div": {"group": "Ungrouped variables", "name": "div", "definition": "lcoeff/scoeff", "templateType": "anything", "description": ""}, "a": {"group": "Ungrouped variables", "name": "a", "definition": "random(2..5)", "templateType": "anything", "description": ""}, "dd": {"group": "Ungrouped variables", "name": "dd", "definition": "random(2..5)", "templateType": "anything", "description": ""}, "lcoeff": {"group": "Ungrouped variables", "name": "lcoeff", "definition": "a*d+b*c", "templateType": "anything", "description": ""}, "disc": {"group": "Ungrouped variables", "name": "disc", "definition": "(lcoeff^2-4*scoeff*ccoeff)", "templateType": "anything", "description": ""}, "argtop": {"group": "Ungrouped variables", "name": "argtop", "definition": "lcoeff^2-4*ccoeff*scoeff", "templateType": "anything", "description": ""}, "sqrtargtop": {"group": "Ungrouped variables", "name": "sqrtargtop", "definition": "sqrt(argtop)", "templateType": "anything", "description": ""}, "lengthdet": {"group": "Ungrouped variables", "name": "lengthdet", "definition": "abs(a*d-b*c)", "templateType": "anything", "description": ""}, "scoeff": {"group": "Ungrouped variables", "name": "scoeff", "definition": "a*b", "templateType": "anything", "description": ""}, "argbot": {"group": "Ungrouped variables", "name": "argbot", "definition": "4*scoeff^2", "templateType": "anything", "description": ""}, "sqrtargbot": {"group": "Ungrouped variables", "name": "sqrtargbot", "definition": "sqrt(argbot)", "templateType": "anything", "description": ""}, "b": {"group": "Ungrouped variables", "name": "b", "definition": "random(2..5)", "templateType": "anything", "description": ""}, "ccoeff": {"group": "Ungrouped variables", "name": "ccoeff", "definition": "c*d", "templateType": "anything", "description": ""}, "d": {"group": "Ungrouped variables", "name": "d", "definition": "if(c*b=a*dd,dd+1,dd)", "templateType": "anything", "description": ""}, "c": {"group": "Ungrouped variables", "name": "c", "definition": "random(2..5)", "templateType": "anything", "description": ""}}, "showQuestionGroupNames": false, "preamble": {"js": "", "css": ""}, "tags": ["completing the square", "formula", "quadratic", "quadratics", "roots", "solving"], "name": "Terry's copy of Solving a quadratic by completing the square", "rulesets": {}, "statement": "", "ungrouped_variables": ["a", "b", "c", "dd", "d", "scoeff", "lcoeff", "ccoeff", "disc", "lengthdet", "div", "argtop", "argbot", "sqrtargtop", "sqrtargbot"], "functions": {}, "extensions": [], "parts": [{"type": "gapfill", "steps": [{"type": "information", "variableReplacements": [], "marks": 0, "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "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)$.

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

", "stepsPenalty": "8", "variableReplacements": [], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "integerPartialCredit": 0, "variableReplacements": [], "maxValue": "{-ccoeff}", "showCorrectAnswer": false, "variableReplacementStrategy": "originalfirst", "showPrecisionHint": false, "type": "numberentry", "correctAnswerFraction": false, "marks": 1, "scripts": {}, "integerAnswer": true, "minValue": "{-ccoeff}"}, {"allowFractions": true, "maxValue": "{lcoeff}/{scoeff}", "variableReplacements": [], "correctAnswerFraction": true, "marks": 1, "type": "numberentry", "showCorrectAnswer": false, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "{lcoeff}/{scoeff}", "showPrecisionHint": false}, {"allowFractions": true, "maxValue": "{-ccoeff}/{scoeff}", "variableReplacements": [], "correctAnswerFraction": true, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "{-ccoeff}/{scoeff}", "showPrecisionHint": false}, {"allowFractions": true, "maxValue": "{lcoeff^2}/{4*scoeff^2}", "variableReplacements": [], "correctAnswerFraction": true, "marks": 1, "type": "numberentry", "showCorrectAnswer": false, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "{lcoeff^2}/{4*scoeff^2}", "showPrecisionHint": false}, {"allowFractions": true, "maxValue": "{argtop}/{argbot}", "variableReplacements": [], "correctAnswerFraction": true, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "{argtop}/{argbot}", "showPrecisionHint": false}, {"allowFractions": true, "maxValue": "{lcoeff}/{2*scoeff}", "variableReplacements": [], "correctAnswerFraction": true, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "{lcoeff}/{2*scoeff}", "showPrecisionHint": false}, {"allowFractions": true, "maxValue": "{sqrtargtop}/{sqrtargbot}", "variableReplacements": [], "correctAnswerFraction": true, "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "minValue": "{sqrtargtop}/{sqrtargbot}", "showPrecisionHint": false}, {"vsetrangepoints": 5, "answer": "set({-c}/{a},{-d}/{b})", "variableReplacements": [], "vsetrange": [0, 1], "showCorrectAnswer": true, "checkingaccuracy": 0.001, "showpreview": true, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme", "expectedvariablenames": [], "marks": 1, "scripts": {}, "variableReplacementStrategy": "originalfirst"}]}], "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": ""}, "advice": "", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Terry Young", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3130/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Terry Young", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3130/"}]}