// Numbas version: exam_results_page_options {"name": "Inequalities involving a rational function/hyperbola", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"css": "", "js": ""}, "variables": {"c": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(-12..12 except [0,a])", "name": "c"}, "prod": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "leadCoeff*choice", "name": "prod"}, "strict": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "if(choice=1 or choice=3,true,false)", "name": "strict"}, "choice": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "name": "choice"}, "a": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(-12..12 except 0)", "name": "a"}, "r2": {"description": "

r2

", "templateType": "anything", "group": "Ungrouped variables", "definition": "rootList[1]", "name": "r2"}, "sym": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "['>','\\\\ge','<','\\\\le'][choice-1]", "name": "sym"}, "one": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "if(prod=1 or prod=2 or prod=-3 or prod=-4,true,false)", "name": "one"}, "backprod": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "leadCoeff*backchoice", "name": "backprod"}, "backChoice": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "mod(choice+1,4)+1", "name": "backChoice"}, "backsym": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "['>','\\\\ge','<','\\\\le'][backChoice-1]", "name": "backsym"}, "b": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(-12..12 except [0,a*d,d,-d])", "name": "b"}, "dr": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "r2-r1", "name": "dr"}, "r1": {"description": "

r1

", "templateType": "anything", "group": "Ungrouped variables", "definition": "rootList[0]", "name": "r1"}, "d": {"description": "

d

", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(-12..12 except -1..1)", "name": "d"}, "rootList": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "sort([hole,nonhole])", "name": "rootList"}, "leadCoeff": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "sign(c*d^2-d)", "name": "leadCoeff"}, "nonhole": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "(a-b*c)/(c*d-1)", "name": "nonhole"}, "hole": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "-b/d", "name": "hole"}, "extremeY": {"description": "

approx of the furthest we need to plot in the y direction

", "templateType": "anything", "group": "Ungrouped variables", "definition": "(r2-r1)^2/4\n\n//abs((c*b-a)*b-(b*(d*d-1)+d*(c*b-a))^2/(4*d*(c*d-1)))", "name": "extremeY"}}, "advice": "

You could do this question by considering the cases (of the denominator being negative or positive) separately. However, the following method uses a nice trick to ensure you know the sign of what you are multiplying by. 

\n

Before we start manipulating the inequality, note that we can't divide by zero and hence $x\\ne \\var[basic,fractionNumbers,simplifyFractions]{-b/d}$ (we could need this in our final answer).

\n

Now multiply both sides of 

\n

\\[\\simplify{(x+{a})/({d}x+{b})} \\var{latex(sym)}  \\var{c}\\]

\n

by $(\\simplify{{d}x+{b}})^2$. This will get rid of the denominator with the added benefit that we know this quantity must be positive (it can't be negative and it can't be zero!) so we don't need to worry about swapping the direction of the inequality.

\n

\\[\\simplify{(x+{a})*({d}x+{b})} \\var{latex(sym)}  \\simplify{{c}*({d}x+{b})^2}\\]

\n

This introduces a quadratic and so we can continue this question using the same method that we use when dealing with inequalities involving quadratics (we also need to recall $x\\ne \\var[basic,fractionNumbers,simplifyFractions]{-b/d}$).

\n

Let's get everything on the right hand side and factorise the common factor (our original denominator) out.

\n

\\[\\begin{align}\\simplify{(x+{a})*({d}x+{b})} &\\var{latex(sym)}  \\simplify{{c}*({d}x+{b})^2}\\\\ 0 &\\var{latex(sym)} \\simplify{{c}*({d}x+{b})^2-(x+{a})*({d}x+{b})} \\\\ 0 &\\var{latex(sym)}\\simplify{({d}x+{b})({c}({d}x+{b})-(x+{a}))}\\\\ 0&\\var{latex(sym)} \\simplify{({d}x+{b})({c*d-1}x+{c*b-a})} \\end{align}\\]

\n

\n

We are probably more used to seeing this written the other way

\n

\\[\\simplify{({d}x+{b})({c*d-1}x+{c*b-a})}\\var{latex(backsym)} 0\\] 

\n

Since the quadratic is now factorised we can see the roots are $\\var[basic,fractionNumbers,simplifyFractions]{r1}$ and $\\var[basic,fractionNumbers,simplifyFractions]{r2}$.  

\n

Now we can either test the sign of each region $x< \\var[basic,fractionNumbers,simplifyFractions]{r1}$, $\\var[basic,fractionNumbers,simplifyFractions]{r1}<x<\\var[basic,fractionNumbers,simplifyFractions]{r2}$, and $x>\\var[basic,fractionNumbers,simplifyFractions]{r2}$ or we can sketch the parabola and determine which regions satisfy the inequality.

\n

\n

I'll use the parabola method:

\n\n

\n

So we have the following situation (where red indicates the inequality is not satisifed and green indicates it is):

\n

 {graph()}

\n

\n

Therefore the solution to the original inequality is 

\n

\\[\\var[basic,fractionNumbers,simplifyFractions]{r1} < x < \\var[basic,fractionNumbers,simplifyFractions]{r2}.\\]

\n

\\[\\var[basic,fractionNumbers,simplifyFractions]{r1} < x \\le \\var[basic,fractionNumbers,simplifyFractions]{r2}.\\]

\n

\\[\\var[basic,fractionNumbers,simplifyFractions]{r1} \\le x < \\var[basic,fractionNumbers,simplifyFractions]{r2}.\\]

\n

\n

\\[ x<\\var[basic,fractionNumbers,simplifyFractions]{r1},\\; x>\\var[basic,fractionNumbers,simplifyFractions]{r2}.\\]

\n

\\[ x\\leq\\var[basic,fractionNumbers,simplifyFractions]{r1},\\; x>\\var[basic,fractionNumbers,simplifyFractions]{r2}.\\]

\n

\\[ x<\\var[basic,fractionNumbers,simplifyFractions]{r1},\\; x\\ge\\var[basic,fractionNumbers,simplifyFractions]{r2}.\\]

\n

", "statement": "

Recall that with inequalities, you need to know whether an expression is positive or negative before you multiply or divide by it.

", "rulesets": {}, "parts": [{"variableReplacements": [], "gaps": [{"variableReplacements": [], "maxMarks": 0, "scripts": {"mark": {"order": "instead", "script": "// apply the normal marking algorithm for this part\nthis.__proto__.mark.apply(this);\n// store whether the student said \"one interval\" in an attribute that's easier to access\nthis.one = this.ticks[0][0];"}}, "shuffleChoices": false, "displayType": "dropdownlist", "showCorrectAnswer": true, "choices": ["

one interval.

", "

two intervals.

"], "variableReplacementStrategy": "originalfirst", "minMarks": 0, "displayColumns": 0, "distractors": ["", ""], "showFeedbackIcon": true, "matrix": ["if(one=true,1,0)", "if(one=false,1,0)"], "marks": 0, "type": "1_n_2"}, {"correctAnswerFraction": true, "variableReplacements": [], "allowFractions": true, "correctAnswerStyle": "plain", "scripts": {}, "showCorrectAnswer": true, "maxValue": "r1", "variableReplacementStrategy": "originalfirst", "marks": 1, "mustBeReducedPC": 0, "mustBeReduced": false, "showFeedbackIcon": true, "minValue": "r1", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry"}, {"variableReplacements": [], "maxMarks": 0, "scripts": {}, "shuffleChoices": false, "displayType": "dropdownlist", "showCorrectAnswer": true, "choices": ["

<

", "

"], "variableReplacementStrategy": "originalfirst", "minMarks": 0, "displayColumns": 0, "distractors": ["", ""], "showFeedbackIcon": true, "matrix": ["if(strict=true or r1=-b/d,1,0)", "if(strict=false and r1<>-b/d,1,0)"], "marks": 0, "type": "1_n_2"}, {"variableReplacements": [], "maxMarks": 0, "scripts": {}, "shuffleChoices": false, "displayType": "dropdownlist", "showCorrectAnswer": true, "choices": ["

<

", "

"], "variableReplacementStrategy": "originalfirst", "minMarks": 0, "displayColumns": 0, "distractors": ["", ""], "showFeedbackIcon": true, "matrix": ["if(strict=true or r2=-b/d,1,0)", "if(strict=false and r2<>-b/d,1,0)"], "marks": 0, "type": "1_n_2"}, {"correctAnswerFraction": true, "variableReplacements": [], "allowFractions": true, "correctAnswerStyle": "plain", "scripts": {}, "showCorrectAnswer": true, "maxValue": "r2", "variableReplacementStrategy": "originalfirst", "marks": 1, "mustBeReducedPC": 0, "mustBeReduced": false, "showFeedbackIcon": true, "minValue": "r2", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry"}, {"variableReplacements": [], "maxMarks": 0, "scripts": {}, "shuffleChoices": false, "displayType": "dropdownlist", "showCorrectAnswer": true, "choices": ["

<

", "

"], "variableReplacementStrategy": "originalfirst", "minMarks": 0, "displayColumns": 0, "distractors": ["", ""], "showFeedbackIcon": true, "matrix": ["if(strict=true or r1=-b/d,1,0)", "if(strict=false and r1<>-b/d,1,0)"], "marks": 0, "type": "1_n_2"}, {"correctAnswerFraction": true, "variableReplacements": [], "allowFractions": true, "correctAnswerStyle": "plain", "scripts": {}, "showCorrectAnswer": true, "maxValue": "r1", "variableReplacementStrategy": "originalfirst", "marks": 1, "mustBeReducedPC": 0, "mustBeReduced": false, "showFeedbackIcon": true, "minValue": "r1", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry"}, {"variableReplacements": [], "maxMarks": 0, "scripts": {}, "shuffleChoices": false, "displayType": "dropdownlist", "showCorrectAnswer": true, "choices": ["

>

", "

"], "variableReplacementStrategy": "originalfirst", "minMarks": 0, "displayColumns": 0, "distractors": ["", ""], "showFeedbackIcon": true, "matrix": ["if(strict=true or r2=-b/d,1,0)", "if(strict=false and r2<>-b/d,1,0)"], "marks": 0, "type": "1_n_2"}, {"correctAnswerFraction": true, "variableReplacements": [], "allowFractions": true, "correctAnswerStyle": "plain", "scripts": {}, "showCorrectAnswer": true, "maxValue": "r2", "variableReplacementStrategy": "originalfirst", "marks": 1, "mustBeReducedPC": 0, "mustBeReduced": false, "showFeedbackIcon": true, "minValue": "r2", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry"}], "showFeedbackIcon": true, "scripts": {"mark": {"order": "instead", "script": "var gaps = this.gaps;\n// if the student said \"one\" to gap 0, then mark gaps 0 to 4\nif(gaps[0].one) {\n this.setCredit((gaps[0].credit*gaps[0].marks+gaps[1].credit*gaps[1].marks+gaps[2].credit*gaps[2].marks+gaps[3].credit*gaps[3].marks+gaps[4].credit*gaps[4].marks)/(gaps[0].marks+gaps[1].marks+gaps[2].marks+gaps[3].marks+gaps[4].marks));\n// otherwise, work out the credit based on the gaps 0, 5 to 8\n} else {\n this.setCredit((gaps[0].credit*gaps[0].marks+gaps[5].credit*gaps[5].marks+gaps[6].credit*gaps[6].marks+gaps[7].credit*gaps[7].marks+gaps[8].credit*gaps[8].marks)/(gaps[0].marks+gaps[5].marks+gaps[6].marks+gaps[7].marks+gaps[8].marks));\n}\n\n"}, "constructor": {"order": "after", "script": "// override the default 'submit' method for the part\n// we only want to submit gaps 1,2,3,4 if the answer to gap 0 is \"one\" and we only want to submit gaps 5,6,7,8 if the answer to gap 0 is \"two\"\nthis.submit = Numbas.util.extend(function() {\n this.gaps[0].submit();\n if(this.gaps[0].one) {\n this.gaps[1].submit();\n this.gaps[2].submit();\n this.gaps[3].submit();\n this.gaps[4].submit();\n this.gaps[5].answered = true;\n this.gaps[6].answered = true;\n this.gaps[7].answered = true;\n this.gaps[8].answered = true;\n } else {\n this.gaps[1].answered = true;\n this.gaps[2].answered = true;\n this.gaps[3].answered = true;\n this.gaps[4].answered = true;\n this.gaps[5].submit();\n this.gaps[6].submit();\n this.gaps[7].submit();\n this.gaps[8].submit(); \n }\n},Part.prototype.submit);\n"}}, "prompt": "

The solution to the inequality

\n

\\[\\simplify{(x+{a})/({d}x+{b})} \\var{latex(sym)}  \\var{c}\\]

\n

is made up of  [[0]]

\n
\n

Given by the condition [[1]] [[2]] $x$ [[3]] [[4]].

\n
\n
\n

Given by the condition, $x$ [[5]] [[6]] or $x$ [[7]] [[8]].

\n
", "showCorrectAnswer": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "marks": 0}], "variable_groups": [], "metadata": {"description": "

Harder inequalities that involve terms like $\\frac{1}{x}$ where multiplication by the denominator requires you to split into cases for positive or negative, or you multiply by the square of the denominator.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "extensions": ["jsxgraph"], "tags": [], "functions": {"graph": {"language": "javascript", "parameters": [], "definition": "a = Numbas.jme.unwrapValue(scope.variables.leadcoeff);\nr1 = Numbas.jme.unwrapValue(scope.variables.r1);\nr2 = Numbas.jme.unwrapValue(scope.variables.r2);\nprod = Numbas.jme.unwrapValue(scope.variables.backprod);\ndr=Numbas.jme.unwrapValue(scope.variables.dr);\nexy=Numbas.jme.unwrapValue(scope.variables.extremey);\nhole = Numbas.jme.unwrapValue(scope.variables.hole);\nnonhole = Numbas.jme.unwrapValue(scope.variables.nonhole);\n\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[r1-dr,1.2*exy,r2+dr,-1.2*exy],grid:true,axis:false});\nvar board = div.board;\n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,2],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,10],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0,\n});\n\n\n\nif(prod==2 || prod==4 || prod==-2 || prod==-4){ptColour = 'green';} else {ptColour = 'red';};\n\nboard.create('point',[hole,0],{fixed:true,withLabel:false,strokeColour:'red', fillColor:'red'});\nboard.create('point',[nonhole,0],{fixed:true,withLabel:false,strokeColor:ptColour,fillColor:ptColour});\n\nif(prod==2 || prod==-4 || prod== 1 || prod==-3){ outColour = 'green';} else {outColour = 'red';};\nif(prod==-2 || prod==4 || prod== -1 || prod==3){inColour = 'green';} else {inColour = 'red';};\n\nboard.create('functiongraph',[function(x){return a*(x**2-(r1+r2)*x+r1*r2);},r1,r2],{strokeColor:inColour,strokeWidth:2});\nboard.create('functiongraph',[function(x){return a*(x**2-(r1+r2)*x+r1*r2);},r1-dr,r1],{strokeColor:outColour,strokeWidth:2});\nboard.create('functiongraph',[function(x){return a*(x**2-(r1+r2)*x+r1*r2);},r2,r2+dr],{strokeColor:outColour,strokeWidth:2});\n\nreturn div;", "type": "html"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["choice", "sym", "a", "c", "d", "b", "leadCoeff", "prod", "one", "rootList", "r1", "r2", "strict", "backChoice", "backsym", "extremeY", "backprod", "dr", "hole", "nonhole"], "name": "Inequalities involving a rational function/hyperbola", "type": "question", "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/"}]}