// Numbas version: finer_feedback_settings {"name": "Integration with Partial Fractions 10", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Integration with Partial Fractions 10", "tags": [], "metadata": {"description": "
Calculating the integral of a function of the form $\\frac{mx^2+nx+k}{(x+a)(x+b)^2}$ using partial fractions.
", "licence": "None specified"}, "statement": "Calculate the following integral:
\n\\[ \\simplify{int(({m}x^2+{n}x+{k})/((x+{a})(x+{b})^2),x)}. \\]
", "advice": "In order to integrate the function \\[ \\simplify{({m}x^2+{n}x+{k})/((x+{a})(x+{b})^2)}, \\] we want to rewrite it in terms of its partial fractions.
\nSince we have a distinct linear factor and a repeated linear factor, we want to set the function equal to the sum of 3 fractions with denominators $\\simplify{x+{a}}$, $\\simplify{x+{b}}$, and $\\simplify{(x+{b})^2}$. The numerators will be constants, which we will call $A$, $B$, and $C$:
\n\\[ \\simplify{({m}x^2+{n}x+{k})/((x+{a})(x+{b})^2)} = \\simplify{A/(x+{a}) + B/(x+{b})+ C/(x+{b})^2}.\\]
\nTo find the values of $A$, $B$, and $C$, we want to first multiply this equation by the denominator of the left-hand side. This gives
\n\\[ \\simplify{{m}x^2+{n}x+{k}=A(x+{b})^2+B(x+{a})(x+{b}) + C(x+{a})}.\\]
\n(Note: To find $A$, $B$, and $C$, we will use a combination of choosing suitable values of $x$ to eliminate terms, and equating coefficients. It can be solved by only equating coefficients, but this is a more efficient process.)
\n\nTo find $A$, we can eliminate $B$ and $C$ by setting $x=\\var{-a}$:
\n\\[ \\simplify{{m*a^2-n*a+k}=A{(b-a)^2}} \\implies A=\\simplify[fractionNumbers]{{Asol}}.\\]
\nTo find $C$, we can eliminate $A$ and $B$ by setting $x=\\var{-b}$:
\n\\[ \\simplify{{m*b^2-n*b+k}=C{(a-b)}} \\implies C=\\simplify[fractionNumbers]{{Csol}}.\\]
\nFinally, by equating coefficients of the $x^2$-terms we can find $B$:
\n\\[ (x^2): \\quad \\var{m} = \\simplify{A+B} \\implies B=\\var{m}-A. \\]
\nTherefore, \\[ B=\\simplify[fractionNumbers]{{Bsol}}, \\]
\nand
\n{check}
\nHence,
\n{check2}
\n", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-6..6)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-6..6 except a)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "if(k=1,random(-1,1)*random([1,3,4,5]),if (k=2,random(-1,1)*random([1,2,4,5]),if(k=3,random(-1,1)*random([1,2,3,5]),if(k=5,random(-1,1)*random([1,2,3,4,5,7]),random(-1,1)*random([1,2,3,4,5,7])))))", "description": "", "templateType": "anything", "can_override": false}, "Asol": {"name": "Asol", "group": "Ungrouped variables", "definition": "rational(((m*a^2-n*a+k)/(b-a))/(b-a))", "description": "", "templateType": "anything", "can_override": false}, "Bsol": {"name": "Bsol", "group": "Ungrouped variables", "definition": "rational((m*b^2-2*m*a*b+n*a-k)/(b-a)^2)", "description": "", "templateType": "anything", "can_override": false}, "Csol": {"name": "Csol", "group": "Ungrouped variables", "definition": "rational((m*b^2-n*b+k)/(a-b))", "description": "", "templateType": "anything", "can_override": false}, "check": {"name": "check", "group": "Ungrouped variables", "definition": "if(Asol=round(Asol) and Bsol=round(Bsol),'{sol1}','{sol2}')", "description": "", "templateType": "anything", "can_override": false}, "sol1": {"name": "sol1", "group": "Ungrouped variables", "definition": "\"\\\\[ \\\\simplify{({m}x^2+{n}x+{k})/((x+{a})(x+{b})^2)} = \\\\simplify{{Asol}/(x+{a})+{Bsol}/(x+{b})+{Csol}/(x+{b})^2}.\\\\]
\"", "description": "", "templateType": "long string", "can_override": false}, "sol2": {"name": "sol2", "group": "Ungrouped variables", "definition": "\"\\\\[ \\\\simplify{({m}x^2+{n}x+{k})/((x+{a})(x+{b})^2)} = \\\\simplify[all,fractionNumbers]{{m*a^2-n*a+k}/({(b-a)^2}(x+{a}))+{m*b^2-2*m*a*b+n*a-k}/({(b-a)^2}(x+{b}))+{m*b^2-n*b+k}/({(a-b)}(x+{b})^2)}.\\\\]
\"", "description": "", "templateType": "long string", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "random([1,2,3,5,7])", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "random(1..3)", "description": "", "templateType": "anything", "can_override": false}, "check2": {"name": "check2", "group": "Ungrouped variables", "definition": "if(Asol=round(Asol),'{int1}','{int2}')", "description": "", "templateType": "anything", "can_override": false}, "int1": {"name": "int1", "group": "Ungrouped variables", "definition": "\"\\\\[\\\\begin{split} \\\\simplify{int(({m}x^2+{n}x+{k})/((x+{a})(x+{b})^2),x)} &\\\\,= \\\\simplify[all,fractionNumbers]{int({Asol}/(x+{a})+{Bsol}/(x+{b})+{Csol}/(x+{b})^2,x)} \\\\\\\\\\\\\\\\ &\\\\,=\\\\simplify[all,!collectLikeFractions,fractionNumbers,zeroTerm,unitFactor,noLeadingMinus]{{Asol} int(1/(x+{a}),x)+{Bsol} int(1/(x+{b}),x)+{Csol} int((x+{b})^-2,x)} \\\\\\\\\\\\\\\\ &\\\\,=\\\\simplify[basic,fractionNumbers,zeroTerm,unitFactor,noLeadingMinus]{{Asol} ln(abs(x+{a}))+{Bsol} ln(abs(x+{b}))-{Csol}/(x+{b})+C}.\\\\end{split}\\\\]
\"", "description": "", "templateType": "long string", "can_override": false}, "int2": {"name": "int2", "group": "Ungrouped variables", "definition": "\"\\\\[\\\\begin{split} \\\\simplify{int(({m}x^2+{n}x+{k})/((x+{a})(x+{b})^2),x)} &\\\\,= \\\\simplify[all,fractionNumbers]{int({m*a^2-n*a+k}/({(b-a)^2}(x+{a}))+{m*b^2-2*m*a*b+n*a-k}/({(b-a)^2}(x+{b}))+{m*b^2-n*b+k}/({a-b}(x+{b})^2),x)} \\\\\\\\\\\\\\\\ &\\\\,=\\\\simplify[all,!collectLikeFractions,fractionNumbers,zeroTerm,noLeadingMinus]{{Asol} int(1/(x+{a}),x)+{Bsol} int(1/(x+{b}),x)+{Csol} int((x+{b})^-2,x)} \\\\\\\\\\\\\\\\ &\\\\,=\\\\simplify[basic,fractionNumbers,zeroTerm,noLeadingMinus]{{Asol} ln(abs(x+{a}))+{Bsol} ln(abs(x+{b}))-{Csol}/(x+{b})}+C.\\\\end{split}\\\\]
\"", "description": "", "templateType": "long string", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "m", "n", "k", "Asol", "Bsol", "Csol", "check", "sol1", "sol2", "check2", "int1", "int2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "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": "\n[[0]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "answer": "{Asol}ln(x+{a})+{Bsol}ln(x+{b})-{Csol}/(x+{b})+c", "answerSimplification": "all,fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}], "answer": "{Asol}ln(abs(x+{a}))+{Bsol}ln(abs(x+{b}))-{Csol}/(x+{b}) +c", "answerSimplification": "all,!collectLikeFractions,fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "c", "value": ""}, {"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}]}], "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}