// Numbas version: finer_feedback_settings {"name": "Rafa?'s copy of Solving a quadratic equation", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"js": "", "css": ""}, "advice": "

There are different ways to solve a quadratic equation.

\n

If you can see how to factorise the quadratic expression then this should be the quickest method.

\n

For this example we have

\n

\\[\\simplify{{a*b} * x ^ 2 + ( {-b*c-a * d}) * x + {c * d} = ({a} * x + { -c}) * ({b} * x + { -d})}\\]

\n

So either \\[\\simplify{ ({a} * x + { -c}) =0} \\  \\text{or} \\ \\ \\simplify{ ({b} * x + { -d})}=0\\]

\n

So the roots are:
\\[x= \\simplify{{n1-n4}/{2*a*b}} \\ \\ \\text{and} \\ \\  x= \\simplify{{n1+n4}/{2*a*b}}  \\]

\n

If you cannot see a factorisation then you can use the quadratic formula:

\n

\\[ x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}\\]

\n

Remember that there are three possible types of solution, depending upon the value of the discriminant $\\Delta=b^2-4ac$.

\n

1. $\\Delta \\gt 0$. The roots are real and distinct

\n

2. $\\Delta=0$. The roots are real and equal. Their common value is $\\displaystyle -\\frac{b}{2a}$

\n

3. $\\Delta \\lt 0$. There are no real roots. (The roots are complex)

\n

For this question the discriminant is $\\Delta = \\simplify[std]{{-n1}^2-4*{a*b*c*d}}=\\var{disc}$. {rdis}

\n

So the {rep} roots are:

\n

\\[ x = \\frac{\\var{n1} - \\sqrt{\\var{disc}}}{\\var{n3}} = \\frac{\\var{n1} - \\var{n4} }{\\var{n3}} = \\simplify{{n1 - n4}/ {n3}} \\ \\ \\text{and} \\ \\  x = \\frac{\\var{n1} + \\sqrt{\\var{disc}}}{\\var{n3}} = \\frac{\\var{n1} + \\var{n4} }{\\var{n3}} = \\simplify{{n1 + n4}/ {n3}} \\]

\n

You could also use the method of completing the square.

\n

First we write:
\\[\\begin{eqnarray} \\simplify{{a*b}x^2+{-n1}x+{c*d}}&=&\\var{n5}\\left(\\simplify{x^2+({-n1}/{a*b})x+ {c*d}/{a*b}}\\right)\\\\ &=&\\var{n5}\\left(\\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2+ \\simplify{{c*d}/{a*b}-({-n1}/({2*a*b}))^2}\\right)\\\\ &=&\\var{n5}\\left(\\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2 -\\simplify{ {n2^2}/{4*(a*b)^2}}\\right) \\end{eqnarray} \\]
So we need to solve:
\\[\\begin{eqnarray} \\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2&\\phantom{{}}& -\\simplify{ {n2^2}/{4*(a*b)^2}}=0\\Rightarrow\\\\ \\left(\\simplify{x+({-n1}/{2*a*b})}\\right)^2&\\phantom{{}}&=\\simplify{ {n2^2}/{4*(a*b)^2}=({abs(n2)}/{2*a*b})^2} \\end{eqnarray}\\]
and get the two {rep} solutions:
\\[\\begin{eqnarray} \\simplify{x+({-n1}/{2*a*b})}&=&\\simplify{-{abs(n2)}/{2*a*b}} \\Rightarrow &x& = \\simplify{({-abs(n2)+n1}/{2*a*b})}\\\\ \\simplify{x+({-n1}/{2*a*b})}&=&\\simplify{({abs(n2)}/{2*a*b})} \\Rightarrow &x& = \\simplify{({n1+abs(n2)}/{2*a*b})} \\end{eqnarray}\\]

\n

\n

See also these Mathcentre leaflets on solving quadratic equations.

\n

", "variablesTest": {"condition": "", "maxRuns": 100}, "functions": {}, "extensions": [], "ungrouped_variables": ["a", "c", "b", "d", "f", "s3", "s2", "s1", "n4", "n2", "disc", "rdis", "n1", "c1", "n3", "rep", "n5", "d1"], "variables": {"disc": {"group": "Ungrouped variables", "definition": "(b*c+a*d)^2-4*a*b*c*d", "templateType": "anything", "description": "", "name": "disc"}, "n5": {"group": "Ungrouped variables", "definition": "a*b", "templateType": "anything", "description": "", "name": "n5"}, "n4": {"group": "Ungrouped variables", "definition": "abs(n2)", "templateType": "anything", "description": "", "name": "n4"}, "d": {"group": "Ungrouped variables", "definition": "if((a*d1)^2=(b*c)^2, max(d1+1,random(1..5))*s3,d1*s3)", "templateType": "anything", "description": "", "name": "d"}, "n3": {"group": "Ungrouped variables", "definition": "2*a*b", "templateType": "anything", "description": "", "name": "n3"}, "c": {"group": "Ungrouped variables", "definition": "c1*s3", "templateType": "anything", "description": "", "name": "c"}, "rdis": {"group": "Ungrouped variables", "definition": "switch(disc=0,'The discriminant is '+ 0+' and so we get two repeated roots in this case.',disc<0, 'There are no real roots.','The roots are real and distinct. ')", "templateType": "anything", "description": "", "name": "rdis"}, "n2": {"group": "Ungrouped variables", "definition": "b*c-a*d", "templateType": "anything", "description": "", "name": "n2"}, "d1": {"group": "Ungrouped variables", "definition": "switch(f=1, random(1..6),f=2,random(1,3,5,7,9),f=3,random(1,2,5,7,8),f=4,random(1,3,5,7,9),f=6, random(1,5,7,8),f=9,random(1,2,4,7,8),f=8,random(1,3,5,7,9),f=12,random(1,5,7),random(1,3,5,7))", "templateType": "anything", "description": "", "name": "d1"}, "n1": {"group": "Ungrouped variables", "definition": "b*c+a*d", "templateType": "anything", "description": "", "name": "n1"}, "c1": {"group": "Ungrouped variables", "definition": "switch(f=1, random(1..6),f=2,random(1,3,5,7,9),f=3,random(1,2,5,7,8),f=4,random(1,3,5,7,9),f=6, random(1,5,7,8),f=9,random(1,2,4,7,8),f=8,random(1,3,5,7,9),f=12,random(1,5,7),random(1,3,5,7))", "templateType": "anything", "description": "", "name": "c1"}, "s2": {"group": "Ungrouped variables", "definition": "random(1,-1)", "templateType": "anything", "description": "", "name": "s2"}, "s3": {"group": "Ungrouped variables", "definition": "random(1,-1)", "templateType": "anything", "description": "", "name": "s3"}, "rep": {"group": "Ungrouped variables", "definition": "switch(disc=0,'repeated', ' ')", "templateType": "anything", "description": "", "name": "rep"}, "s1": {"group": "Ungrouped variables", "definition": "random(1,-1)", "templateType": "anything", "description": "", "name": "s1"}, "b": {"group": "Ungrouped variables", "definition": "random(1..4)", "templateType": "anything", "description": "", "name": "b"}, "a": {"group": "Ungrouped variables", "definition": "random(2..5)", "templateType": "anything", "description": "", "name": "a"}, "f": {"group": "Ungrouped variables", "definition": "a*b", "templateType": "anything", "description": "", "name": "f"}}, "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "variable_groups": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Solve for $x$: $\\displaystyle ax ^ 2 + bx + c=0$.

"}, "statement": "

Znajd\u017a pierwiastki podanego równania kwadratowego

", "tags": [], "parts": [{"marks": 0, "showFeedbackIcon": true, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "prompt": "

 \\[\\simplify[std]{{a*b} * x ^ 2 + ( {-b*c-a * d}) * x + {c * d}}=0\\]

\n

Podja warto\u015bci pierwiastków jako u\u0142amki lub liczby ca\u0142kowite, nie dziesi\u0119tne

\n

Wpisz pierwiastek z ni\u017csz\u0105 warto\u015bci\u0105 jako pierwszy, je\u017celi równanie posiada jeden podwójny pierwiastek wpisz go w obu miejscach.

\n

\n

Pierwiuastek z ni\u017csz\u0105 warto\u015bci\u0105 $x=\\;$ [[0]].

\n

Pierwiastek z wy\u017csza warto\u015bci\u0105 $x=\\;$ [[1]]

\n

", "showCorrectAnswer": true, "gaps": [{"notallowed": {"partialCredit": 0, "showStrings": false, "message": "

Input numbers as fractions or integers not as a decimals.

", "strings": ["."]}, "expectedvariablenames": [], "checkingtype": "absdiff", "variableReplacementStrategy": "originalfirst", "showpreview": true, "answersimplification": "std", "checkvariablenames": false, "marks": 1, "showFeedbackIcon": true, "variableReplacements": [], "type": "jme", "showCorrectAnswer": true, "answer": "{n1-n4}/{2*a*b}", "scripts": {}, "checkingaccuracy": 0.0001, "vsetrange": [0, 1], "vsetrangepoints": 5}, {"notallowed": {"partialCredit": 0, "showStrings": false, "message": "

Input numbers as fractions or integers not as a decimals.

", "strings": ["."]}, "expectedvariablenames": [], "checkingtype": "absdiff", "variableReplacementStrategy": "originalfirst", "showpreview": true, "answersimplification": "std", "checkvariablenames": false, "marks": 1, "showFeedbackIcon": true, "variableReplacements": [], "type": "jme", "showCorrectAnswer": true, "answer": "{n1+n4}/{2*a*b}", "scripts": {}, "checkingaccuracy": 0.0001, "vsetrange": [0, 1], "vsetrangepoints": 5}], "scripts": {}}], "name": "Rafa?'s copy of Solving a quadratic equation", "type": "question", "contributors": [{"name": "Rafa? Porzezinski", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2042/"}]}]}], "contributors": [{"name": "Rafa? Porzezinski", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2042/"}]}