// Numbas version: finer_feedback_settings {"name": "Solve a quadratic with the formula", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"s1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "name": "s1", "description": ""}, "disc": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(b*c+a*d)^2-4*a*b*c*d", "name": "disc", "description": ""}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if((a*d1)^2=(b*c)^2, max(d1+1,random(1..5))*s3,d1*s3)", "name": "d", "description": ""}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "c1*s3", "name": "c", "description": ""}, "f": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a*b", "name": "f", "description": ""}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "name": "b", "description": ""}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "b*c+a*d", "name": "n1", "description": ""}, "d1": {"templateType": "anything", "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))", "name": "d1", "description": ""}, "n3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "2*a*b", "name": "n3", "description": ""}, "n5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a*b", "name": "n5", "description": ""}, "c1": {"templateType": "anything", "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))", "name": "c1", "description": ""}, "rdis": {"templateType": "anything", "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 exist and are distinct. ')", "name": "rdis", "description": ""}, "n4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "abs(n2)", "name": "n4", "description": ""}, "s3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "name": "s3", "description": ""}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "name": "a", "description": ""}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "b*c-a*d", "name": "n2", "description": ""}, "s2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "name": "s2", "description": ""}, "rep": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(disc=0,'repeated', ' ')", "name": "rep", "description": ""}}, "ungrouped_variables": ["a", "c", "b", "d", "f", "s3", "s2", "s1", "n4", "n2", "disc", "rdis", "n1", "rep", "n3", "c1", "n5", "d1"], "name": "Solve a quadratic with the formula", "functions": {}, "parts": [{"customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "steps": [{"prompt": "

Finding the roots by factorisation.

\n

Finding a factorisation of a quadratic $q(x)=a(x-r)(x-s)$ where $a$ is the coefficient of $x^2$ gives the roots $x=r$, $x=s$ immediately.

\n

If you cannot find a factorisation then there are several other methods you can use.

\n

Using the formula for the roots.

\n

You can find the roots by using the formula for finding the roots of a general quadratic equation $ax^2+bx+c=0$

\n

The two roots are:

\n

\\[ x = \\frac{-b +\\sqrt{b^2-4ac}}{2a}\\mbox{ and } x = \\frac{-b -\\sqrt{b^2-4ac}}{2a}\\]
there are three main types of solutions 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 value is $\\displaystyle \\frac{-b}{2a}$

\n

3. $\\Delta \\lt 0$. There are no real roots. The root are complex and form a complex conjugate pair.

\n

 

", "showCorrectAnswer": true, "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "type": "information", "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "unitTests": [], "showFeedbackIcon": true}], "prompt": "

Solve for $x$:

\n

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

\n

$x=$ [[0]] or [[1]].

\n

You can get more information on solving a quadratic by clicking on Show steps. You will lose 1 mark if you do so.

\n

Enter the roots as fractions or integers, not as decimals.

", "stepsPenalty": 1, "variableReplacementStrategy": "originalfirst", "sortAnswers": true, "scripts": {}, "gaps": [{"answer": "{n1-n4}/{2*a*b}", "customMarkingAlgorithm": "", "answerSimplification": "std", "expectedVariableNames": [], "showPreview": true, "unitTests": [], "notallowed": {"showStrings": false, "message": "

Input numbers as fractions or integers not as a decimals.

", "strings": ["."], "partialCredit": 0}, "checkingType": "absdiff", "checkVariableNames": false, "vsetRange": [0, 1], "vsetRangePoints": 5, "failureRate": 1, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingAccuracy": 0.001, "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}, {"answer": "{n1+n4}/{2*a*b}", "customMarkingAlgorithm": "", "answerSimplification": "std", "expectedVariableNames": [], "showPreview": true, "unitTests": [], "notallowed": {"showStrings": false, "message": "

Input numbers as fractions or integers not as a decimals.

", "strings": ["."], "partialCredit": 0}, "checkingType": "absdiff", "checkVariableNames": false, "vsetRange": [0, 1], "vsetRangePoints": 5, "failureRate": 1, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingAccuracy": 0.001, "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}], "type": "gapfill", "unitTests": [], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "showFeedbackIcon": true}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

Find the roots of the following quadratic equation.

", "tags": ["Algebra", "algebra", "checked2015", "Factorisation", "factorisation", "find roots of a quadratic equation", "Quadratic formula", "quadratic formula", "quadratics", "roots of a quadratic equation", "solving a quadratic equation", "Solving equations", "solving equations", "steps", "Steps"], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "extensions": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

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

\n

Entering the correct roots in any order is marked as correct. However, entering one correct and the other incorrect gives feedback stating that both are incorrect.

"}, "advice": "\n\t

Direct Factorisation

\n\t

If you can spot a direct factorisation then this is the quickest way to do this question.

\n\t

For this example we have the factorisation

\n\t

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

\n\t

Hence we find the roots:
\\[\\begin{eqnarray} x&=& \\simplify{{n1-n4}/{2*a*b}}\\\\ x&=& \\simplify{{n1+n4}/{2*a*b}} \\end{eqnarray} \\]

\n\t

Other Methods.

\n\t

There are several methods of finding the roots – here are the main methods.

\n\t

Finding the roots of a quadratic using the standard formula.

\n\t

We can use the following formula for finding the roots of a general quadratic equation $ax^2+bx+c=0$

\n\t

The two roots are

\n\t

\\[ x = \\frac{-b +\\sqrt{b^2-4ac}}{2a}\\mbox{ and } x = \\frac{-b -\\sqrt{b^2-4ac}}{2a}\\]
there are three main types of solutions depending upon the value of the discriminant $\\Delta=b^2-4ac$

\n\t

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

\n\t

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

\n\t

3. $\\Delta \\lt 0$. There are no real roots. The root are complex and form a complex conjugate pair.

\n\t

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

\n\t

{rdis}.

\n\t

So the {rep} roots are:

\n\t

\\[\\begin{eqnarray} x = \\frac{\\var{n1} - \\sqrt{\\var{disc}}}{\\var{n3}} &=& \\frac{\\var{n1} - \\var{n4} }{\\var{n3}} &=& \\simplify{{n1 - n4}/ {n3}}\\\\ x = \\frac{\\var{n1} + \\sqrt{\\var{disc}}}{\\var{n3}} &=& \\frac{\\var{n1} + \\var{n4} }{\\var{n3}} &=& \\simplify{{n1 + n4}/ {n3}} \\end{eqnarray}\\]

\n\t

Completing the square.

\n\t

First we complete the square for the quadratic expression $\\simplify{{a*b}x^2+{-n1}x+{c*d}}$
\\[\\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 to solve $\\simplify{{a*b}x^2+{-n1}x+{c*d}}=0$ we have 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}\\]
So we 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\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}