// Numbas version: exam_results_page_options {"name": "Calculate line integral over a straight line", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"b1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "s*random(1..9)", "description": "", "name": "b1"}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(a=b1,b1+1,b1)", "description": "", "name": "b"}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..9)", "description": "", "name": "a"}, "s": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1,-1)", "description": "", "name": "s"}}, "ungrouped_variables": ["a", "s", "b", "b1"], "name": "Calculate line integral over a straight line", "functions": {}, "preamble": {"css": "", "js": ""}, "parts": [{"customMarkingAlgorithm": "", "showCorrectAnswer": true, "prompt": "

(a) What is the equation of the line joining $(0,0)$ to $(\\var{a},\\var{b})$?

\n

$y=\\;\\;$[[0]] Input all numbers in your answer as integers or fractions, not as decimals.

\n

(b) Evaluate the line integral for $I$:

\n

$I=\\;\\;$[[1]] Input your answer as an integer or a fraction, not as a decimal

", "unitTests": [], "sortAnswers": false, "scripts": {}, "gaps": [{"answer": "{b}/{a}*x", "failureRate": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showPreview": true, "notallowed": {"showStrings": false, "message": "

Input all numbers in your answer as integers or fractions, not as decimals.

", "strings": ["."], "partialCredit": 0}, "checkingType": "absdiff", "checkVariableNames": false, "vsetRange": [0, 1], "type": "jme", "vsetRangePoints": 5, "unitTests": [], "scripts": {}, "answerSimplification": "std", "expectedVariableNames": [], "checkingAccuracy": 0.001, "showCorrectAnswer": true, "variableReplacements": [], "marks": 2, "showFeedbackIcon": true}, {"answer": "{a^2+b^2}/{2}", "failureRate": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showPreview": true, "notallowed": {"showStrings": false, "message": "

Input all numbers in your answer as integers or fractions, not as decimals.

", "strings": ["."], "partialCredit": 0}, "checkingType": "absdiff", "checkVariableNames": false, "vsetRange": [0, 1], "type": "jme", "vsetRangePoints": 5, "unitTests": [], "scripts": {}, "answerSimplification": "std", "expectedVariableNames": [], "checkingAccuracy": 0.001, "showCorrectAnswer": true, "variableReplacements": [], "marks": 6, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0, "showFeedbackIcon": true}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

Consider the line integral:
\\[I=\\int_{\\Gamma} \\left( \\left(\\simplify[std]{x+y} \\right)\\;dx+\\left(\\simplify[std]{y-x}\\right)\\;dy\\right)\\]

\n

where $\\Gamma$ is the path given by the straight line from $(0,0)$ to $(\\var{a},\\var{b})$

", "tags": ["Calculus", "calculus", "checked2015", "integration", "line integral", "path", "straight line", "Straight Line", "tested1"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Find $\\displaystyle \\int_{\\Gamma} \\left(x+y \\right)\\;dx+\\left(y-x\\right)\\;dy,\\;\\Gamma$ is the line from $(0,0)$ to $(a,b)$.

\n

"}, "type": "question", "extensions": [], "advice": "

For a line passing through points $(x_1,y_1)$ and $(x_2,y_2)$, the line equation is $\\displaystyle{y-y_1 = m(x-x_1)}$, where the gradient $\\displaystyle{m=\\frac{y_2-y_1}{x_2-x_1}}$.  Hence the equation of our line is:

\n

\\[\\simplify[std]{y=({b}/{a})*x}\\]

\n

Since $\\displaystyle{\\simplify[std]{y=({b}/{a})*x}}$ we have that $\\displaystyle{\\simplify[std]{dy=({b}/{a})*dx}}$.  Using these relations we can write the integrand of the line integral in terms of just $x$ or just $y$.  We will use $x$.  The integrand then becomes:
\\[\\begin{eqnarray*} (x+y)\\;dx+(y-x)\\;dy&=&\\simplify[std]{(x+({b}/{a})*x)dx+(({b}/{a})*x-x)*({b}/{a})*dx}\\\\  &=&\\simplify{{a^2+b^2}/{a^2}}x\\;dx \\end{eqnarray*} \\]

\n

In $x$, our line integral exists over the range $0 \\leq x\\leq\\var{a}$, and so we write our line integral as:
\\[\\begin{eqnarray*} I&=&\\int_\\Gamma\\simplify{{a^2+b^2}/{a^2}}x\\;dx =\\int_0^{\\var{a}}\\simplify{{a^2+b^2}/{a^2}}x\\;dx  \\\\ &=&\\simplify{{a^2+b^2}/{a^2}}\\left[\\frac{x^2}{2}\\right]_0^{\\var{a}}\\;dx =\\simplify{{a^2+b^2}/{a^2}}\\times \\frac{\\var{a^2}}{2}=\\simplify[std]{{a^2+b^2}/2} \\end{eqnarray*} \\]

", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}