Try the substitution $u=\\simplify[std]{{a}+{b}cos(x)}$

", "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "type": "information", "variableReplacements": []}], "marks": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "gaps": [{"showFeedbackIcon": true, "vsetRange": [0, 1], "vsetRangePoints": 5, "marks": 3, "unitTests": [], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "failureRate": 1, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "scripts": {}, "checkingType": "absdiff", "checkVariableNames": false, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "malrules:\n [\n [\"-({a}+{b}*cos(x))^{m+1}/{b*(m+1)}\", \"Almost there! Did you forget to include the integration constant?\"],\n [\"u^{m+1}/{b*(m+1)}+C\",\"Don't forget to fill back in for $u$. You must give your answer in terms of the original variable i.e. in terms of $x$.\"],\n [\"u^{m+1}/{b*(m+1)}\",\"Don't forget to fill back in for $u$. You must give your answer in terms of the original variable i.e. in terms of $x$.\"],\n [\"-u^{m+1}/{b*(m+1)}+C\",\"Don't forget to fill back in for $u$. You must give your answer in terms of the original variable i.e. in terms of $x$.\"],\n [\"-u^{m+1}/{b*(m+1)}\",\"Don't forget to fill back in for $u$. You must give your answer in terms of the original variable i.e. in terms of $x$.\"],\n [\"-1/{b}*({a}+{b}*cos(x))^{m}+C\",\"You haven't actually integrated here. You simply subbed in for $\\\\var{a} + \\\\var{b} \\\\cos x$ and then subbed back again.\"],\n [\"-1/{b}*({a}+{b}*cos(x))^{m}\",\"You haven't actually integrated here. You simply subbed in for $\\\\var{a} + \\\\var{b} \\\\cos x$ and then subbed back again.\"],\n [\"-1/{b}*u^{m}+C\",\"You haven't actually integrated here. You simply subbed in for $\\\\var{a} + \\\\var{b} \\\\cos x$. Also, once you have integrated, make sure you sub back in for $u$ - give your answer in terms of the original variable (i.e. in terms of $x$).\"],\n [\"-1/{b}*u^{m}\",\"You haven't actually integrated here. You simply subbed in for $\\\\var{a} + \\\\var{b} \\\\cos x$. Also, once you have integrated, make sure you sub back in for $u$ - give your answer in terms of the original variable (i.e. in terms of $x$).\"],\n [\"-cos(x)*({a}*x+{b}*sin(x))^{m}+C\",\"You cannot simply integrate each part of a product individually. Look closely at the integrand (what you were asked to integrate). Is one part of the integrand equal to the derivative (or a multiple of the derivative) of another part? If so, try substitution.\"], \n [\"-cos(x)*({a}*x+{b}*sin(x))^{m}\",\"You cannot simply integrate each part of a product individually. Look closely at the integrand (what you were asked to integrate). Is one part of the integrand equal to the derivative (or a multiple of the derivative) of another part? If so, try substitution.\"], \n [\"({a}+{b}*cos(x))^{m+1}/{b*(m+1)}+C\",\"Almost there. Look closely at what you let $u=$ and how you differentiated that. Double check the relevant differentiation rule.\"],\n [\"({a}+{b}*cos(x))^{m+1}/{b*(m+1)}\",\"Almost there. Look closely at what you let $u=$ and how you differentiated that. Double check the relevant differentiation rule.\"],\n [\"-({a}+{b}*cos(x))/{b*(m+1)}+C\", \"Be careful when subbing back in for $u$. Did you do this correctly? Did you include the power on the bracket?\"],\n [\"-({a}+{b}*cos(x))/{b*(m+1)}\", \"Be careful when subbing back in for $u$. Did you do this correctly? Did you include the power on the bracket?\"],\n [\"-({a}+{b}*cos(x))^{m+1}/{m+1}+C\", \"Double check the relationship between $du$ and $dx$. Did you sub in correctly here?\"],\n [\"-({a}+{b}*cos(x))^{m+1}/{m+1}\", \"Double check the relationship between $du$ and $dx$. Did you sub in correctly here?\"]\n]\n\n\nparsed_malrules: \n map(\n [\"expr\":parse(x[0]),\"feedback\":x[1]],\n x,\n malrules\n )\n\nagree_malrules (Do the student's answer and the expected answer agree on each of the sets of variable values?):\n map(\n len(filter(not x ,x,map(\n try(\n resultsEqual(unset(question_definitions,eval(studentexpr,vars)),unset(question_definitions,eval(malrule[\"expr\"],vars)),settings[\"checkingType\"],settings[\"checkingAccuracy\"]),\n message,\n false\n ),\n vars,\n vset\n )))\\[I=\\simplify[std]{Int( sin(x)*({a} + {b}*cos(x))^{m},x)}\\]

\n\t\t\tInput all numbers as integers or fractions.

\n\t\t\t$I=\\;$[[0]]

\n\t\t\tInput the constant of integration as $C$.

\n\t\t\tClick on Show steps if you need help. You will lose 1 mark if you do so.

\n\t\t\t \n\t\t\t", "sortAnswers": false, "customMarkingAlgorithm": "", "stepsPenalty": 1, "showCorrectAnswer": true, "type": "gapfill"}], "variable_groups": [], "ungrouped_variables": ["m", "a", "b", "s1"], "advice": "\n\t \n\t \n\tThis exercise is best solved by using substitution.

Note that if we let $u=\\simplify[std]{{a}+{b}cos(x)}$ then $du=\\simplify[std]{({-b}*sin(x))*dx }$

Hence we can replace $\\sin(x)\\;dx$ by $\\frac{1}{\\var{-b}}\\;du$.

Hence the integral becomes:

\n\t \n\t \n\t \n\t\\[\\begin{eqnarray*} I&=&\\simplify[std]{Int((1/{-b})u^{m},u)}\\\\\n\t \n\t &=&\\simplify[std]{(1/{-b})u^{m+1}/{m+1}+C}\\\\\n\t \n\t &=& \\simplify[std]{({a}+{b}*cos(x))^{m+1}/{-b*(m+1)}+C}\n\t \n\t \\end{eqnarray*}\\]

\n\t \n\t \n\t \n\t", "preamble": {"css": "", "js": ""}, "name": "Indefinite integral by substitution 2 (custom feedback)", "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "\n\tFind the following integral.

\n\tInput the constant of integration as $C$.

\n\tInput all numbers as integers or fractions not as decimals.

\n\t \n\t", "extensions": [], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/", "name": "Julie Crowley"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/", "name": "Clodagh Carroll"}], "type": "question", "tags": [], "variables": {"a": {"description": "", "name": "a", "templateType": "anything", "definition": "random(1..9)", "group": "Ungrouped variables"}, "b": {"description": "", "name": "b", "templateType": "anything", "definition": "s1*random(1..9)", "group": "Ungrouped variables"}, "s1": {"description": "", "name": "s1", "templateType": "anything", "definition": "random(1,-1)", "group": "Ungrouped variables"}, "m": {"description": "", "name": "m", "templateType": "anything", "definition": "random(3..9)", "group": "Ungrouped variables"}}, "functions": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Find $\\displaystyle \\int \\sin(x)(a+ b\\cos(x))^{m}\\;dx$

"}}], "pickingStrategy": "all-ordered"}], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/", "name": "Julie Crowley"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/", "name": "Clodagh Carroll"}]}