// Numbas version: exam_results_page_options {"percentPass": 0, "timing": {"timeout": {"message": "", "action": "none"}, "timedwarning": {"message": "", "action": "none"}, "allowPause": true}, "showQuestionGroupNames": false, "question_groups": [{"pickingStrategy": "all-ordered", "name": "Group", "pickQuestions": 1, "questions": [{"name": "MA1002 First order differential equations 1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Kieran Mulchrone", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1243/"}], "tags": [], "metadata": {"description": "

Solve 4 first order differential equations of two types:$\\displaystyle \\frac{dy}{dx}=\\frac{ax}{y},\\;\\;\\frac{dy}{dx}=\\frac{by}{x},\\;y(2)=1$ for all 4.

\n

rebelmaths

\n

 

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Separate the variables:

\n

Find the solutions of the following ordinary differential equations satisfying the condition $y=1$ at $x=2$.

\n

You may find it instructive to sketch your various solutions (but this is not required for this CBA).

", "advice": "\n

These are all separable first order differential equations.

\n

a)

\n

$\\displaystyle{\\frac{dy}{dx}=\\frac{y}{\\var{a1}x} \\Rightarrow \\int \\frac{1}{y}\\;dy = \\frac{1}{\\var{a1}}\\int\\frac{1}{x}\\;dx \\Rightarrow \\ln(y)=\\frac{1}{\\var{a1}}\\ln(x)+C}$

\n

Exponentiation of both sides then gives $y=Ax^{1/\\var{a1}}$ where we have renamed the constant of integration.

\n

To find the particular solution satisfying $y=1$ at $x=2$, we have $\\displaystyle{1=A \\times 2^{1/\\var{a1}} \\Rightarrow A = \\frac{1}{2^{1/\\var{a1}}}}$

\n

Hence the solution is $\\displaystyle{y=\\left(\\frac{x}{2}\\right)^{1/\\var{a1}}}$

\n

b)

\n

$\\displaystyle{\\frac{dy}{dx}=-\\var{a2}\\frac{y}{x} \\Rightarrow \\int \\frac{1}{y}\\;dy = -\\var{a2}\\int\\frac{1}{x}\\;dx \\Rightarrow \\ln(y)=-\\var{a2}\\ln(x)+C}$

\n

Exponentiation of both sides then gives $y=Ax^{-\\var{a2}}$ where we have renamed the constant of integration.

\n

The particular solution satisfying $y=1$ at $x=2$, gives $A = 2^{\\var{a2}}$

\n

Hence the solution is $\\displaystyle{y=\\left(\\frac{2}{x}\\right)^{\\var{a2}}}$

\n

c)

\n

$\\displaystyle{\\frac{dy}{dx}=\\var{a3}\\frac{x}{y} \\Rightarrow \\int y\\;dy = \\var{a3}\\int x\\;dx \\Rightarrow \\frac{y^2}{2}=\\var{a3}\\frac{x^2}{2}+C\\Rightarrow y^2=\\var{a3}x^2+A}$

\n

The particular solution satisfying $y=1$ at $x=2$, gives $A = \\var{1-4*a3}$.

\n

Hence the solution is $\\displaystyle{y^2=\\simplify[std]{{a3}x^2+{1-4*a3}}}$.

\n

d)

\n

$\\displaystyle{\\frac{dy}{dx}=-\\var{a4}\\frac{x}{y} \\Rightarrow \\int y\\;dy = -\\var{a4}\\int x\\;dx \\Rightarrow y^2=-\\var{a4}x^2+A}$

\n

The particular solution satisfying $y=1$ at $x=2$, gives $A = \\var{1+4*a4}$.

\n

Hence the solution is $\\displaystyle{y^2=\\simplify[std]{{-a4}x^2+{1+4*a4}}}$.

\n ", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "variables": {"a2": {"name": "a2", "group": "Ungrouped variables", "definition": "random(2..6)", "description": "", "templateType": "anything"}, "a4": {"name": "a4", "group": "Ungrouped variables", "definition": "random(2..6)", "description": "", "templateType": "anything"}, "a1": {"name": "a1", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything"}, "a3": {"name": "a3", "group": "Ungrouped variables", "definition": "random(2..6)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a1", "a3", "a2", "a4"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "\n

$\\displaystyle{\\frac{dy}{dx}=\\frac{y}{\\var{a1}x}}$

\n

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

\n

Do not enter decimals in your answer; use only fractions or integers.

\n ", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "(x/2)^(1/{a1})", "answerSimplification": "std", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "notallowed": {"strings": ["."], "showStrings": false, "partialCredit": 0, "message": "

Input numbers as fractions or integers, not as decimals

"}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "\n

$\\displaystyle{\\frac{dy}{dx}=-\\var{a2}\\frac{y}{x}}$

\n

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

\n

Do not enter decimals in your answer; use only fractions or integers.

\n ", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "(2/x)^({a2})", "answerSimplification": "std", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [1, 2], "checkVariableNames": false, "notallowed": {"strings": ["."], "showStrings": false, "partialCredit": 0, "message": "

Input numbers as fractions or integers, not as decimals

"}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "\n

$\\displaystyle{\\frac{dy}{dx}=\\var{a3}\\frac{x}{y}}$

\n

The solution can be written in the form $y^2=f(x)$. Enter $f(x)$ in the box below

\n

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

\n

Do not enter decimals in your answer; use only fractions or integers.

\n ", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{1-4*a3} + {a3} * (x ^ 2)", "answerSimplification": "std", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "notallowed": {"strings": ["."], "showStrings": false, "partialCredit": 0, "message": "

Input numbers as fractions or integers, not as decimals

"}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "\n

$\\displaystyle{\\frac{dy}{dx}=-\\var{a4}\\frac{x}{y}}$

\n

The solution can be written in the form $y^2=g(x)$. Enter $g(x)$ in the box below

\n

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

\n

Do not enter decimals in your answer; use only fractions or integers.

\n ", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{1+4*a4} + {-a4} * (x ^ 2)", "answerSimplification": "std", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "notallowed": {"strings": ["."], "showStrings": false, "partialCredit": 0, "message": "

Input numbers as fractions or integers, not as decimals

"}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}]}, {"name": "Kieran's copy of Julie's copy of First order differential equations 4", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Kieran Mulchrone", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1243/"}], "advice": "\n

We can separate the variables to get

\n

\\[\\frac{dy}{dx}= \\simplify[std]{(1+y^2)/({a}+{b}x)} \\Rightarrow \\frac{1}{1+y^2}\\frac{dy}{dx}=\\simplify[std]{{a}+{b}x}\\]

\n

On integrating we get:
\\[\\arctan(y)=\\frac{1}{\\var{b}}\\ln\\left(\\left|\\var{a}+\\var{b}x\\right|\\right)+A \\Rightarrow y=\\tan\\left(\\frac{1}{\\var{b}}\\ln\\left(\\left|\\var{a}+\\var{b}x\\right|\\right)+A\\right)\\]
To fix the arbitrary constant of integration we use the condition $y(1)=\\var{u}$.

\n

As $\\arctan(\\var{u})=\\var{v}$ we see that $\\displaystyle{A = \\var{v}-\\frac{1}{\\var{b}}\\ln(|\\var{a+b}|)}$.

\n

Hence the solution is

\n

\\[y=\\simplify[std]{tan(({((t * (t -1)) / 2)} * (pi / 3)) + ({((t -1) * (t -2)) / 2} * (pi / 4)) + ((1 / {b}) * ln(abs(({a} + ({b} * x)) / {a + b}))))}\\]

\n ", "parts": [{"prompt": "\n

Solution is:

\n


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

\n

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

\n ", "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true, "gaps": [{"checkingtype": "absdiff", "type": "jme", "variableReplacements": [], "showCorrectAnswer": true, "answersimplification": "std", "checkvariablenames": false, "notallowed": {"message": "

Input all numbers as integers or fractions.

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "vsetrangepoints": 5, "answer": "tan(({((t * (t -1)) / 2)} * (pi / 3)) + ({((t -1) * (t -2)) / 2} * (pi / 4)) + ((1 / {b}) * ln(abs(({a} + ({b} * x)) / {a + b}))))", "vsetrange": [0, 1], "showpreview": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "checkingaccuracy": 1e-06, "marks": 3, "expectedvariablenames": []}], "variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 0}], "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question", "preamble": {"js": "", "css": ""}, "tags": ["1st order differential equation", "arctan", "boundary condition", "boundary condition on a first order differential equation", "Calculus", "calculus", "Differential equations", "differential equations", "first order differential equation", "logarithms", "ode", "ODE", "separable variables", "separation of variables", "solving a differential equation using separation of variables", "solving equations", "Solving equations"], "ungrouped_variables": ["a", "b", "u", "t", "v"], "statement": "

Separate the variables:

\n

Find the solution of:

\n

\\[\\frac{dy}{dx}=\\simplify[std]{(1+y^2)/({a}+{b}x)}\\]
which satisfies $y(1)=\\var{u}$

\n

Note that if $\\pi$ is in your expression you enter it as pi.

", "question_groups": [{"pickQuestions": 0, "name": "", "pickingStrategy": "all-ordered", "questions": []}], "showQuestionGroupNames": false, "variables": {"b": {"description": "", "definition": "random(2..9)", "group": "Ungrouped variables", "name": "b", "templateType": "anything"}, "t": {"description": "", "definition": "random(0,1,2)", "group": "Ungrouped variables", "name": "t", "templateType": "anything"}, "u": {"description": "", "definition": "switch(t=0,1,t=1,0,'$\\\\sqrt{3}$')", "group": "Ungrouped variables", "name": "u", "templateType": "anything"}, "a": {"description": "", "definition": "random(1..9)", "group": "Ungrouped variables", "name": "a", "templateType": "anything"}, "v": {"description": "", "definition": "switch(t=0,'$\\\\pi/4$',t=1,0,'$\\\\pi/3$')", "group": "Ungrouped variables", "name": "v", "templateType": "anything"}}, "functions": {}, "metadata": {"description": "

Find the solution of $\\displaystyle \\frac{dy}{dx}=\\frac{1+y^2}{a+bx}$ which satisfies $y(1)=c$

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "variable_groups": []}, {"name": "Julie's copy of First order differential equations 5", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}], "functions": {}, "ungrouped_variables": ["a", "c", "b", "n"], "tags": ["1st order differential equation", "boundary condition", "boundary conditions", "Calculus", "calculus", "Differential equations", "differential equations", "first order differential equation", "integrating factor", "integrating factor method", "linear first order differential equation", "ODE", "ode", "solving differential equations", "steps", "Steps"], "advice": "\n\n\n

$\\displaystyle{x\\frac{dy}{dx}+\\var{a}y=\\simplify[std]{{b}x^{n}}}$ is a linear equation of the special type where we can multiply both sides by $\\simplify[std]{x^{a-1}}$ to get:
\\[\\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:
\\[A = \\simplify[std]{{b*(c+1)}/{a+n} - {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})}\\]

\n\n\n", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "\n

Solution is:

\n

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

\n

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

\n

You can get help by clicking on Steps – you will not lose any marks by doing so.

\n", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"notallowed": {"message": "

Input all numbers as integers or fractions.

", "showStrings": false, "strings": ["."], "partialCredit": 0}, "variableReplacements": [], "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "({b} / {(a + n)}) * (x ^ {n} + ({c} * (x ^ { - a})))", "marks": 3, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0.5, 1]}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "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}}}$

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "random(2..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(1..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "n": {"definition": "random(1..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "n", "description": ""}}, "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"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Julie's copy of Second order differential equations 1", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}], "functions": {"graphsolution": {"definition": "var c = Numbas.jme.unwrapValue(scope.variables.c);\n\n//var m=Math.abs((c-d*Math.exp(a))/(-a)*Math.exp(-(1-c*a/(d*Math.exp(a)-c))));\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox:[-5,30,5,-30],\n axis:false,\n showNavigation:true,\n grid:true});\nvar brd = div.board; \n var xas = brd.create('line',[[0,0],[1,0]], { strokeColor: 'black',fixed:true});\n var xticks = brd.create('ticks',[xas,1],{\ndrawLabels: true,\nlabel: {offset: [-4, -10]},\nminorTicks: 0\n });\n var yas = brd.create('line',[[0,0],[0,1]], { strokeColor: 'black',fixed:true});\n var yticks = brd.create('ticks',[yas,5],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n }); \nvar p=brd.create('point',[0,1],{fixed:true,name:''});\nvar q=brd.create('line',[[0,0],[1,c]],{fixed:true,name:'',dash:2});\nvar tree;\n//x is the variable in the equation to be input\n var nscope = new Numbas.jme.Scope([scope,{variables:{x:new Numbas.jme.types.TNum(0)}}]);\n//create a functiongraph from the student input\nfunction userf(t){\nif(tree) {\n try {\nnscope.variables.x.value = t;\n//the user input is evaluated at x=t\n var val = Numbas.jme.evaluate(tree,nscope).value;\n return val;\n }\n catch(e) {\nreturn 0;\n }\n}\nelse\n return 0;\n}\nvar curve=brd.create('functiongraph',[userf,-10,10],{strokeColor:'red',strokeWidth:2});\n\n //pick up the student answer and is parsed\n question.signals.on('HTMLAttached',function(e) {\nko.computed(function(){\nvar expr = question.parts[0].gaps[0].display.studentAnswer();\ntry {\n tree = Numbas.jme.compile(expr,scope);\n}\ncatch(e) {\n tree = null;\n}\ncurve.updateCurve();\n\nbrd.update();\n});\n }); \n\nreturn div;\n ", "type": "html", "parameters": [], "language": "javascript"}}, "ungrouped_variables": ["a", "c", "b"], "tags": ["2nd order differential equation", "auxiliary equation", "boundary conditions on differential equation", "Calculus", "calculus", "complex roots of auxiliary equation", "constant coefficients", "Differential equations", "differential equations", "exponential function", "finding the auxiliary equation", "linear differential equation", "ode", "ODE", "quadratic equation", "second order differential equation", "solving differential equations", "solving quadratic equation", "trigonometric functions"], "advice": "

The auxillary equation is $\\simplify[std]{lambda^2+{2*a}lambda+{a^2+b^2}}=0$.

\n

On solving this equation we get $\\lambda=\\simplify[std]{{-a}+{b}i}$ and $\\lambda=\\simplify[std]{{-a}-{b}i}$.

\n

Hence the general solution is:
\\[y = \\simplify[std]{e^({-a}x)(A*sin({b}x)+B*cos({b}x))}\\]
Note that
\\[y'(x)=\\simplify[std]{-{a}e^({-a}x)(A*sin({b}x)+B*cos({b}x))+e^({-a}x)({b}*A*cos({b}x)-{b}*B*sin({b}x))}\\]
Using the conditions $y(0)=1$ and $y'(0)=\\var{c}$ gives:
\\[\\begin{eqnarray*} B &=& 1\\\\ \\simplify[std]{{b}A+{-a}B}&=& \\var{c} \\end{eqnarray*} \\]
This gives $\\displaystyle{A = \\simplify[std]{{c+a}/{b}}}$.

\n

Hence the solution is:

\n

\\[y=\\simplify[std]{exp({- a} * x) * (cos({b} * x) + ({c+a} / {b}) * sin({b} * x))}\\]

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "\n

Solution is:

\n

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

\n

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

\n ", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"notallowed": {"message": "

Input all numbers as integers or fractions.

", "showStrings": false, "strings": ["."], "partialCredit": 0}, "variableReplacements": [], "expectedvariablenames": [], "checkingaccuracy": 1e-05, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "exp({- a} * x) * (cos({b} * x) + ({c+a} / {b}) * sin({b} * x))", "marks": 3, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "

Method of undertermined coefficients

\n

Solve:
\\[\\simplify[std]{(d^2y/dx^2)+{2*a}*(dy/dx)+{a^2+b^2}y}=0\\]
which satisfies $y(0)=1$ and $y'(0)=\\var{c}$ (where prime denotes the derivative).

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "random(-5..5 except 0)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(1..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(1..7)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}}, "metadata": {"description": "

Solve: $\\displaystyle \\frac{d^2y}{dx^2}+2a\\frac{dy}{dx}+(a^2+b^2)y=0,\\;y(0)=1$ and $y'(0)=c$. 

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Julie's copy of Second order differential equations 2", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}], "functions": {"graphdisplay": {"definition": "var c = Numbas.jme.unwrapValue(scope.variables.c);\nvar d = Numbas.jme.unwrapValue(scope.variables.d);\nvar a = Numbas.jme.unwrapValue(scope.variables.a);\nvar m = Numbas.jme.unwrapValue(scope.variables.m);\nvar ytick= Numbas.jme.unwrapValue(scope.variables.ytick);\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox:[-5,m+2,5,-5],\n axis:false,\n showNavigation:true,\n grid:true});\nvar brd = div.board; \n var xas = brd.create('line',[[0,0],[1,0]], { strokeColor: 'black',fixed:true});\n var xticks = brd.create('ticks',[xas,1],{\ndrawLabels: true,\nlabel: {offset: [-4, -10]},\nminorTicks: 0\n });\n var yas = brd.create('line',[[0,0],[0,1]], { strokeColor: 'black',fixed:true});\n var yticks = brd.create('ticks',[yas,ytick],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n }); \nvar p=brd.create('point',[0,c],{fixed:true,name:''});\nvar q=brd.create('point',[1,d],{fixed:true,name:''});\nvar tree;\n//x is the variable in the equation to be input\n var nscope = new Numbas.jme.Scope([scope,{variables:{x:new Numbas.jme.types.TNum(0)}}]);\n//create a functiongraph from the student input\nfunction userf(t){\nif(tree) {\n try {\nnscope.variables.x.value = t;\n//the user input is evaluated at x=t\n var val = Numbas.jme.evaluate(tree,nscope).value;\n return val;\n }\n catch(e) {\nreturn 0;\n }\n}\nelse\n return 0;\n}\nvar curve=brd.create('functiongraph',[userf,-5,5],{strokeColor:'red',strokeWidth:3});\n\n //pick up the student answer and is parsed\n question.signals.on('HTMLAttached',function(e) {\nko.computed(function(){\nvar expr = question.parts[0].gaps[0].display.studentAnswer();\ntry {\n tree = Numbas.jme.compile(expr,scope);\n}\ncatch(e) {\n tree = null;\n}\ncurve.updateCurve();\n\nbrd.update();\n});\n }); \n\nreturn div;\n ", "type": "html", "parameters": [], "language": "javascript"}, "advicedisplay": {"definition": "var c = Numbas.jme.unwrapValue(scope.variables.c);\nvar d = Numbas.jme.unwrapValue(scope.variables.d);\nvar a = Numbas.jme.unwrapValue(scope.variables.a);\nvar m = Numbas.jme.unwrapValue(scope.variables.m);\nvar f1 = Numbas.jme.unwrapValue(scope.variables.f1);\nvar ytick= Numbas.jme.unwrapValue(scope.variables.ytick);\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox:[-5,m+2,5,-5],\n axis:false,\n showNavigation:true,\n grid:true});\nvar brd = div.board; \n var xas = brd.create('line',[[0,0],[1,0]], { strokeColor: 'black',fixed:true});\n var xticks = brd.create('ticks',[xas,1],{\ndrawLabels: true,\nlabel: {offset: [-4, -10]},\nminorTicks: 0\n });\n var yas = brd.create('line',[[0,0],[0,1]], { strokeColor: 'black',fixed:true});\n var yticks = brd.create('ticks',[yas,ytick],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n }); \nvar p=brd.create('point',[0,c],{fixed:true,name:''});\nvar q=brd.create('point',[1,d],{fixed:true,name:''});\n\nfunction userf(x){return c * Math.exp( - a * x) + f1 * x * Math.exp(- a * x);}\nvar curve=brd.create('functiongraph',[userf,-5,5],{strokeColor:'red',strokeWidth:3});\nreturn div;", "type": "html", "parameters": [], "language": "javascript"}}, "ungrouped_variables": ["a", "f1", "c", "d", "g", "f", "m", "s", "ytick"], "tags": ["2nd order differential equation", "auxiliary equation", "auxiliary equation with equal roots", "boundary condition", "Calculus", "calculus", "constant coefficients", "differential equations", "Differential equations", "equal roots", "exponential function", "general solution", "graphs", "jsxgraph", "Jsxgraph", "linear differential equation", "linear differential equations with constant coefficients", "ode", "ODE", "plot solutions", "quadratic function", "repeated roots for auxiliary equation", "second order differential equations", "solving differential equations", "solving quadratic equation", "trigonometric functions"], "advice": "

The auxillary equation is $\\simplify[std]{lambda^2+{2*a}lambda+{a^2}}=0$.

\n

On solving this equation we get $\\lambda=\\var{-a}$ twice.

\n

Hence the general solution is:
\\[y = \\simplify[std]{A*e^({-a}x)+B*x*e^({-a}x)}\\]
The boundary conditions give:

\n

$y(0)=\\var{c} \\Rightarrow A=\\var{c}$

\n

$y(1)=\\var{d} \\Rightarrow \\simplify[std]{Ae^{-a}+Be^{-a}={d}}\\Rightarrow A+B = \\simplify[std1]{{d}e^{a}}$

\n

So $B=\\simplify[std1]{{d}e^{a}-{c}}=\\var{f1}$ to 3 decimal places.

\n

Hence the solution is:
\\[y=\\simplify[std1]{(({c} * Exp(({( - a)} * x))) + ({f1} * x * Exp(({( - a)} * x))))}\\]

\n

{advicedisplay()}

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"], "std1": ["all", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "

{graphdisplay()}

\n

Solution is:

\n

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

\n

Input all numbers correct to 3 decimal places.

\n

Your solution is graphed above once you have input the solution before submitting.

\n

Note that the points $(0,\\var{c}),\\;(1,\\var{d})$ which the curve has to go through are marked on the graph.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 1e-05, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "answersimplification": "std1", "scripts": {}, "answer": "{c} * Exp({ - a} * x) + {f1} * x * Exp({- a} * x)", "marks": 3, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "

Method of undetermined coefficients:

\n

Find the solution of:
\\[\\simplify[std]{(d^2y/dx^2)+{2*a}*(dy/dx)+{a^2}y}=0\\]
which satisfies $y(0)=\\var{c}$ and $y(1)=\\var{d}$.

\n

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "s*random(1..7)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "f1": {"definition": "precround(f,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "f1", "description": ""}, "c": {"definition": "random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "d": {"definition": "random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "g": {"definition": "(f1-a*c)/f1", "templateType": "anything", "group": "Ungrouped variables", "name": "g", "description": ""}, "f": {"definition": "d*exp(a)-c", "templateType": "anything", "group": "Ungrouped variables", "name": "f", "description": ""}, "m": {"definition": "(f1/a)*e^(-g)", "templateType": "anything", "group": "Ungrouped variables", "name": "m", "description": ""}, "s": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s", "description": ""}, "ytick": {"definition": "if(m>10,round(m/10),1)", "templateType": "anything", "group": "Ungrouped variables", "name": "ytick", "description": ""}}, "metadata": {"description": "

Method of undermined coefficients:

\n

Solve: $\\displaystyle \\frac{d^2y}{dx^2}+2a\\frac{dy}{dx}+a^2y=0,\\;y(0)=c$ and $y(1)=d$.  (Equal roots example). Includes an interactive plot.

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Julie's copy of Second order differential equations 5", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}], "functions": {}, "ungrouped_variables": ["q1", "p", "q"], "tags": ["2nd order differential equation", "Calculus", "calculus", "CF", "complementary function", "constant coefficients", "Differential equations", "differential equations", "general solution", "linear differential equation", "ODE", "ode", "particular integral", "PI", "rebelmaths", "second order differential equation", "solving differential equations"], "advice": "\n

First we find the Complementary Function (CF) i.e. the solution of:

\n

\\[\\simplify[std]{d^2y/dx^2+{2*p}*(dy/dx)+{p^2-q^2}y=0}\\]

\n

The auxillary equation is $\\simplify[std]{lambda^2+{2*p}lambda+{p^2-q^2}=0} \\Rightarrow \\simplify[std]{(lambda+{p-q})(lambda+{p+q})=0}\\Rightarrow \\lambda = \\var{q-p}\\textrm{ or }\\lambda = \\var{-q-p} $

\n

Hence the CF is $\\displaystyle{y_{CF}(x)=\\simplify[std]{A*e^({q-p}x)+ B*e^({-q-p}x)}}$ for $A$, $B$ arbitrary constants.

\n

So $a=\\var{q-p}$ and $b=\\var{-q-p}$ as we required $a \\gt b$.

\n

To find the Particular Integral (PI) for $\\displaystyle{\\simplify[std]{d^2y/dx^2+{2*p}*(dy/dx)+{p^2-q^2}y=x}}$, we observe that

\n

$y_{PI}(x)=cx+d$ is a possible PI for constants $c,\\;d$ to be found.

\n

Substituting $y_{PI}(x)=cx+d$ in to the equation gives:

\n

$\\displaystyle \\simplify[std]{{2*p}c+{p^2-q^2}*(cx+d)} =x \\Rightarrow \\simplify[std]{{p^2-q^2}cx+{p^2-q^2}d+{2*p}c}= x \\Rightarrow c=\\simplify[std]{1/{p^2-q^2}},\\;\\;d = \\simplify[std]{{-2p}/{(p^2-q^2)^2}}$

\n

So the particular integral is $\\displaystyle{\\simplify[std]{x/{p^2-q^2}-{2*p}/{(p^2-q^2)^2}}}$

\n ", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "\n \n \n

$a=\\;\\;$[[0]]$\\;\\;\\;b=\\;\\;$[[1]]. Remember that we require $a \\gt b$

\n \n \n \n ", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "{q-p}", "minValue": "{q-p}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "{-q-p}", "minValue": "{-q-p}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"prompt": "\n \n \n

$\\displaystyle{y_{PI}=\\;\\;}$[[0]].

\n \n \n \n

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

\n \n \n \n ", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"notallowed": {"message": "

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

", "showStrings": false, "strings": ["."], "partialCredit": 0}, "variableReplacements": [], "expectedvariablenames": [], "checkingaccuracy": 1e-05, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "x/{p^2-q^2}-{2*p}/{(p^2-q^2)^2}", "marks": 3, "checkvariablenames": false, "checkingtype": "reldiff", "vsetrange": [0, 1]}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "\n

Find the complete general solution of the equation:
\\[\\simplify[std]{d^2y/dx^2+{2*p}*(dy/dx)+{p^2-q^2}y=x}\\]
in the form $\\displaystyle{Ae^{ax}+Be^{bx}+y_{PI}(x)}$ where $A$ and $B$ are arbitrary constants and $y_{PI}$ is a particular integral.

\n

Note that we require that $a \\gt b$.

\n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"q1": {"definition": "random(1..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "q1", "description": ""}, "p": {"definition": "random(-6..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "p", "description": ""}, "q": {"definition": "if(q1=abs(p),q1+1,q1)", "templateType": "anything", "group": "Ungrouped variables", "name": "q", "description": ""}}, "metadata": {"description": "

Find the general solution of $y''+2py'+(p^2-q^2)y=x$ in the form  $Ae^{ax}+Be^{bx}+y_{PI}(x),\\;y_{PI}(x)$ a particular integral.

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}]}], "feedback": {"intro": "", "showactualmark": true, "showanswerstate": true, "showtotalmark": true, "allowrevealanswer": true, "advicethreshold": 0, "feedbackmessages": []}, "name": "MA1002 Differential Equations ", "navigation": {"showresultspage": "oncompletion", "browse": true, "allowregen": true, "onleave": {"message": "", "action": "none"}, "showfrontpage": true, "reverse": true, "preventleave": true}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Differential equations.

\n

rebelmaths

\n

"}, "showstudentname": true, "duration": 0, "type": "exam", "contributors": [{"name": "Kieran Mulchrone", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1243/"}], "extensions": ["jsxgraph"], "custom_part_types": [], "resources": []}