// Numbas version: finer_feedback_settings {"name": "Completing the Square", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Completing the Square", "tags": [], "metadata": {"description": "
Write the expression $ax^2+bx+c$ in completed square form $a(x+p)^2+k$.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "Rewrite the expression \\[\\simplify{{a}x^2+{b}x+{c}}\\] in completed square form $a(x+k)^2+p$ for suitable numbers $a, k$ and $p$.
\n\n
Your answer must be input exactly in this form.
", "advice": "(a)
\nGiven the quadratic $q(x)=\\simplify{{a}x^2+{b}x+ {c}}$, one way of completing the square is to simply expand the term $a(x+k)^2+p$ and equate coefficients to the quadratic term.
\nExpanding $a(x+k)^2+p$ gives $ax^2 + 2akx + ak^2 + p$.
\nEquating coefficients gives:
\n$x^2:\\quad \\var{a}=a$ or $a=\\var{a}$.
\n$x:\\quad \\var{b}= 2ak \\implies k = \\simplify{{b}/(2{a})}$
\nconstant: $\\var{c}=ak^2+p \\implies p=\\var{c}-ak^2=\\simplify[all, fractionNumbers]{{c-b^2/(4a)}}$.
\nNow, put these together to obtain: $\\qquad \\simplify[all, fractionNumbers]{{a}(x+{b}/(2{a}))^2+{c-b^2/(4a)}}$.
\n(b)
\nCompleting the square for this function gives:$\\qquad \\simplify[all, fractionNumbers]{{a}(x+{b}/(2{a}))^2+{c-b^2/(4a)}}$.
\nThe function attains its turning point when $\\quad \\simplify{{a}(x+{b}/(2{a}))^2}=0$
\nSo the $x$ coordinate of the turning point is $\\simplify{-{b}/(2{a})}$.
\nThe $y$ coordinate is $k=\\simplify[all, fractionNumbers]{{c-b^2/(4a)}}$.
\nHence the turning point is $\\quad (\\simplify{-{b}/(2{a})},\\simplify[all, fractionNumbers]{{c-b^2/(4a)}})$
", "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-5..7 except 0)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-20..20)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "c", "b"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "(a)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "$\\simplify{{a}x^2+{b}x+ {c}} = \\phantom{{}}$ [[0]].
", "stepsPenalty": "2", "steps": [{"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Given the quadratic $q(x)=\\simplify{{a}x^2+{b}x+ {c}}$, one way of completing the square is to simply expand the term $a(x+k)^2+p$ and equate coefficients to the quadratic term.
\nExpanding $a(x+k)^2+p$ gives $ax^2 + 2akx + ak^2 + p$.
\nEquating coefficients gives:
\n$x^2:\\quad \\var{a}=a$ or $a=\\var{a}$.
\n$x:\\quad \\var{b}= 2ak \\implies k = \\simplify{{b}/(2{a})}$
\nconstant: $\\var{c}=ak^2+p \\implies p=\\var{c}-ak^2=\\simplify[all, fractionNumbers]{{c-b^2/(4a)}}$.
\nNow, put these together to obtain: $\\qquad \\simplify[all, fractionNumbers]{{a}(x+{b}/(2{a}))^2+{c-b^2/(4a)}}$.
"}], "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 2, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{a}(x+{b}/(2{a}))^2+{c}-{b}^2/(4{a})", "answerSimplification": "std", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.0001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "musthave": {"strings": ["(", ")", "^"], "showStrings": false, "partialCredit": 0, "message": "please input in the form $(x+a)^2+b$
"}, "notallowed": {"strings": ["x^2", "x*x", "x x", "x(", "x*("], "showStrings": false, "partialCredit": 0, "message": "Input your answer in the form $(x+a)^2+b$.
"}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": true, "customName": "(b)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Hence, state the coordinates of the turning point for $q(x)=\\simplify{{a}x^2+{b}x+ {c}}$:
\nTurning point:$\\quad \\phantom{}$[[0]].
", "stepsPenalty": 1, "steps": [{"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Completing the square for this function gives:$\\qquad \\simplify[all, fractionNumbers]{{a}(x+{b}/(2{a}))^2+{c-b^2/(4a)}}$.
\nThe function attains its turning point when $\\quad \\simplify{{a}(x+{b}/(2{a}))^2}=0$
\nSo the $x$ coordinate of the turning point is $\\simplify{-{b}/(2{a})}$.
\nThe $y$ coordinate is $k=\\simplify[all, fractionNumbers]{{c-b^2/(4a)}}$.
\nHence the turning point is $\\quad (\\simplify{-{b}/(2{a})},\\simplify[all, fractionNumbers]{{c-b^2/(4a)}})$
"}], "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([-{b}/(2{a}),{c}-{b}^2/(4{a})])", "correctAnswerFractions": true, "numRows": 1, "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Katie Lester", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/586/"}, {"name": "Wan Mekwi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4058/"}]}]}], "contributors": [{"name": "Katie Lester", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/586/"}, {"name": "Wan Mekwi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4058/"}]}