// Numbas version: exam_results_page_options {"name": "Differential Equations: Separation of Variables 4", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Differential Equations: Separation of Variables 4", "tags": [], "metadata": {"description": "

Solving a differential equation of the form $\\frac{dy}{dx}=x(y-a)$ using separation of variables.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Solve the differential equation \\[ \\frac{dy}{dx}=x(\\simplify{y-{a}}).\\]

", "advice": "

If we have a differential equation of the form \\[ \\frac{dy}{dx} = f(x) g(y),\\] we are able to find a solution to this equation using the method Separation of Variables.

\n

We can rewrite the above equation in the form \\[ \\frac{1}{g(y)} \\frac{dy}{dx} = f(x).\\]

\n

If we then integrate with respect to $x$: 

\n

\\[ \\begin{split} &\\int \\frac{1}{g(y)} &\\frac{dy}{dx} dx = \\int f(x) dx, \\\\\\\\ \\implies &\\int \\frac{1}{g(y)} &dy = \\int f(x) dx.  \\end{split} \\]

\n

Integrating both sides, we can write $y$ as a function of $x$. 

\n

Following this method for $\\frac{dy}{dx}=x(\\simplify{y-{a}})$:

\n

\\[ \\begin{split} &\\frac{dy}{dx}=x(\\simplify{y-{a}}) \\\\ \\implies  \\frac{1}{\\simplify{y-{a}}}\\,& \\frac{dy}{dx} =x. \\end{split} \\]

\n

Integrating both sides with respect to $x$:

\n

\\[ \\begin{split}  \\int  \\frac{1}{\\simplify{y-{a}}} \\, \\frac{dy}{dx}\\, dx &= \\int x \\, dx, \\\\ \\\\ \\implies \\int \\frac{1}{\\simplify{y-{a}}} \\,dy &= \\int x \\, dx.   \\end{split} \\]

\n

Taking the integral of both sides, we are able to find a solution to the differential equation:

\n

\\[ \\begin{split} \\int \\frac{1}{\\simplify{y-{a}}} \\,dy &=x \\, dx \\\\ \\ln(\\simplify{y-{a}})&\\,= \\frac{x^2}{2} +c, \\\\ \\simplify{y-{a}} &\\,=e^{\\frac{x^2}{2} +c} \\\\ y&\\,=\\simplify{e^(x^2/2+c)+{a}}.  \\end{split} \\]

\n

 

\n

Note: You can also have the answer 

\n

\\[y=A\\simplify{e^(x^2/2)+{a}}, \\]

\n

where $A=e^c$. This shows there is still a constant, but indicates it is different to the original constant of integration, $c$.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-7..7 except 0)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a"], "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": "

$y=\\,$[[0]]

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "Gap 0", "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": "Ae^(x^2/2+c)+{a}", "answerSimplification": "basic", "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": "ae", "value": ""}, {"name": "c", "value": ""}, {"name": "x", "value": ""}]}], "answer": "e^(x^2/2+c)+{a}", "answerSimplification": "basic", "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/"}]}