// Numbas version: finer_feedback_settings {"name": "Simon's copy of Julie's copy of First order differential equations 5", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"type": "gapfill", "prompt": "

Solution is:

\n

$y=\\;\\;$[[0]]

\n

Input all numbers as integers or fractions – not as decimals.

", "scripts": {}, "sortAnswers": false, "customMarkingAlgorithm": "", "showFeedbackIcon": true, "unitTests": [], "showCorrectAnswer": true, "variableReplacements": [], "gaps": [{"type": "jme", "showPreview": true, "extendBaseMarkingAlgorithm": true, "expectedVariableNames": [], "notallowed": {"strings": ["."], "partialCredit": 0, "showStrings": false, "message": "

Input all numbers as integers or fractions.

"}, "scripts": {}, "vsetRange": [0.5, 1], "customMarkingAlgorithm": "", "checkingAccuracy": 0.001, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkVariableNames": false, "unitTests": [], "showCorrectAnswer": true, "answerSimplification": "std", "checkingType": "absdiff", "answer": "({b} / {(a + n)}) * (x ^ {n} + ({c} * (x ^ { - a})))", "variableReplacements": [], "marks": 3, "failureRate": 1, "variableReplacementStrategy": "originalfirst"}], "extendBaseMarkingAlgorithm": true, "marks": 0, "variableReplacementStrategy": "originalfirst"}], "metadata": {"description": "

Find the solution of $\\displaystyle x\\frac{dy}{dx}+ay=bx^n,\\;\\;y(1)=c$

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "preamble": {"css": "", "js": ""}, "ungrouped_variables": ["a", "c", "b", "n"], "variable_groups": [], "advice": "

$\\displaystyle{x\\frac{dy}{dx}+\\var{a}y=\\simplify[std]{{b}x^{n}}}$ can be solved by the integrating factor method.

\n

First we divide both sides by $x$ to obtain $\\displaystyle{\\frac{dy}{dx}+\\frac{\\var{a}}{x}y=\\simplify[std]{{b}x^{n-1}}}$

\n

This is now in the standard form $\\displaystyle{\\frac{dy}{dx}+a(x)y=b(x)}$ which we can solve by multiplying through by the integrating factor $e^{\\int a(x)dx}$

\n

\n

In our example, $a(x) = \\frac{\\var{a}}{x}$ so $e^{\\int a(x)dx}=e^{\\int{\\frac{\\var{a}}{x}dx}}=e^{\\var{a}\\ln(x)}=x^\\var{a}$

\n

\n

Hence multiplying both sides of $\\displaystyle{\\frac{dy}{dx}+\\frac{\\var{a}}{x}y=\\simplify[std]{{b}x^{n-1}}}$ by $x^\\var{a}$ gives

\n

$\\displaystyle{x^\\var{a}\\frac{dy}{dx}+\\var{a}x^{\\var{a-1}}y=\\simplify[std]{{b}x^{n-1+a}}}$

\n

We note that we can rewrite the left hand side as $\\frac{d(x^{\\var{a}}y)}{dx}$ (product rule) and hence:

\n

\\[\\frac{d(x^{\\var{a}}y)}{dx}=\\simplify[std]{{b}x^{a+n-1}}\\]
We can integrate both sides to get:
\\[x^{\\var{a}}y=\\simplify[std]{{b}/{a+n}x^{a+n}+A}\\]
to determine $A$ we use the condition $\\displaystyle{y(1)=\\simplify[std]{{b*(c+1)}/{a+n}}}$ and we see that:

\n

\\[\\simplify[std]{{b*(c+1)}/{a+n}}=\\simplify[std]{{b}/{a+n}+A}\\]
\\[A = \\simplify[std]{{b*(c+1)}/{a+n}} - \\simplify[std]{{b}/{a+n} = {b*c}/{a+n}}\\]
and so the solution is:
\\[x^{\\var{a}}y=\\simplify[std]{{b}/{a+n}x^{a+n}+{b*c}/{a+n}} \\Rightarrow y=\\simplify[std]{{b}/{a+n}*(x^{n}+{c}*x^{-a})}\\]

", "variables": {"a": {"definition": "random(2..8)", "group": "Ungrouped variables", "description": "", "name": "a", "templateType": "anything"}, "b": {"definition": "random(1..9)", "group": "Ungrouped variables", "description": "", "name": "b", "templateType": "anything"}, "c": {"definition": "random(1..5)", "group": "Ungrouped variables", "description": "", "name": "c", "templateType": "anything"}, "n": {"definition": "random(2..5)", "group": "Ungrouped variables", "description": "", "name": "n", "templateType": "anything"}}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "statement": "

Integrating Factor Method:

\n

Find the solution of:
\\[x\\frac{dy}{dx}+\\var{a}y=\\simplify[std]{{b}x^{n}}\\]

\n

which satisfies $\\displaystyle{y(1)=\\simplify[std]{{b*(c+1)}/{a+n}}}$

", "name": "Simon's copy of Julie's copy of First order differential equations 5", "tags": [], "extensions": [], "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}