// Numbas version: exam_results_page_options {"name": "Integration with Partial Fractions 6", "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 6", "tags": [], "metadata": {"description": "

Calculating the integral of a function of the form $\\frac{n}{(x+a)(x+b)^2}$ using partial fractions.

", "licence": "None specified"}, "statement": "

Calculate the integral

\n

\\[ \\simplify{int({n}/((x+{a})(x+{b})^2),x)}. \\]

", "advice": "

In order to integrate the function \\[ \\simplify{{n}/((x+{a})(x+{b})^2)} \\] we want to rewrite it in terms of its partial fractions.

\n

Since 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{{n}/((x+{a})(x+{b})^2)} = \\simplify{A/(x+{a}) + B/(x+{b})+ C/(x+{b})^2}.\\]

\n

To 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{{n}=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

\n

To find $A$, we can eliminate $B$ and $C$ by setting $x=\\var{-a}$:

\n

\\[ \\simplify{{n}=A{(b-a)^2}} \\implies A=\\simplify[fractionNumbers]{{Asol}}.\\]

\n

To find $C$, we can eliminate $A$ and $B$ by setting $x=\\var{-b}$:

\n

\\[ \\simplify{{n}=C{(a-b)}} \\implies C=\\simplify[fractionNumbers]{{Csol}}.\\]

\n

Finally, by equating coefficients of the $x^2$-terms we can find $B$:

\n

\\[ (x^2): \\quad 0 = \\simplify{A+B} \\implies B=-A. \\]

\n

Therefore, \\[ B=\\simplify[fractionNumbers]{{Bsol}}, \\]

\n

and

\n

{check}

\n

Hence,

\n

\\[\\begin{split} \\simplify{int({n}/((x+{a})(x+{b})^2),x)} &\\,= \\simplify[all,fractionNumbers]{int({Asol}/(x+{a})+{Bsol}/(x+{b})+{Csol}/(x+{b})^2,x)} \\\\\\\\ &\\,=\\simplify[basic,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}\\]

\n

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-6..6 except 0)", "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": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "Asol": {"name": "Asol", "group": "Ungrouped variables", "definition": "(n/(b-a))/(b-a)", "description": "", "templateType": "anything", "can_override": false}, "Bsol": {"name": "Bsol", "group": "Ungrouped variables", "definition": "-Asol", "description": "", "templateType": "anything", "can_override": false}, "Csol": {"name": "Csol", "group": "Ungrouped variables", "definition": "n/(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{{n}/((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{{n}/((x+{a})(x+{b})^2)} = \\\\simplify[all,fractionNumbers]{{n}/({(b-a)^2}(x+{a}))-{n}/({(b-a)^2}(x+{b}))+{n}/({(a-b)}(x+{b})^2)}.\\\\]

\"", "description": "", "templateType": "long string", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "n", "Asol", "Bsol", "Csol", "check", "sol1", "sol2"], "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", "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", "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/"}]}