// Numbas version: exam_results_page_options {"variable_groups": [], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Complex numbers in real-imaginary form", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"modn4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mod(n,4)", "description": "", "name": "modn4"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "7000+random(1..4)", "description": "", "name": "n"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "name": "a"}, "moda4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mod(a,4)", "description": "", "name": "moda4"}}, "ungrouped_variables": ["a", "n", "moda4", "modn4"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "i", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$\\frac{1+i}{1-i}=$ [[0]]

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "i^{a}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$\\left(\\frac{1+i}{1-i}\\right)^\\var{a}=$ [[0]]

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "i^{modn4}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$\\left(\\frac{1+i}{1-i}\\right)^{\\var{n}}=$ [[0]]

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Write the following complex numbers in real-imaginary ($x+iy$) form.

", "tags": ["MAS2103", "checked2015"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Write complex numbers in real-imaginary form.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

To write $z=\\frac{1+i}{1-i}$ in real-imaginary form, multiply $z$ by the complex conjugate of the denominator, to obtain

\n

\\[z=\\frac{(1+i)(1+i)}{(1-i)(1+i)}=\\frac{1+2i-1}{1+1}=i.\\]

\n

b)

\n

To express $z=\\left(\\frac{1+i}{1-i}\\right)^\\var{a}$ in real-imaginary form, use part a), so that we only need to write $i^\\var{a}$ in real-imaginary form.

\n

The result of raising $i$ to an arbitrary integer power $n$ can be determined by using the fact that $i^2=-1$, $i^3=-i$, and $i^4=i$.

\n

Divide the power by $4$, and calculate the remainder (i.e. calculate $n\\mod 4$), which will be either $0$, $1$, $2$, or $3$.  If the remainder is $0$, then $i^n=1$; if the remainder is $1$, then $i^n=i$; if the remainder is $2$, then $i^n=-1$; if the remainder is $3$, then $i^n=-i$.

\n

Here, $n \\bmod 4 =\\var{moda4}$, so $i^\\var{a}=\\simplify{i^{a}}$.

\n

c)

\n

Using the method from part b), $n \\bmod 4=\\var{n} \\bmod 4=\\var{modn4}$, so $i^{\\var{n}}=i^{\\var{modn4}}=\\simplify{i^{modn4}}$.

"}, {"name": "Modulus and argument of a complex number", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"absz": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(abs(z),3)", "description": "", "name": "absz"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "imzlg0": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch (\n im(z)<0, \"$\\\\mathrm{Im}(z)<0$\",\n im(z)>0, \"$\\\\mathrm{Im}(z)>0$\"\n )", "description": "", "name": "imzlg0"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "name": "a"}, "argz": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(arg(z),3)", "description": "", "name": "argz"}, "z": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a+a*i*sign(random(-1,1))", "description": "", "name": "z"}}, "ungrouped_variables": ["a", "argz", "absz", "tol", "imzlg0", "z"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "absz+tol", "minValue": "absz-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

$\\lvert z \\rvert=$ [[0]] (Enter your answer to 3 d.p.)

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "argz+tol", "minValue": "argz-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

$\\theta=$ [[0]] (Enter your answer to 3d.p.)

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Find the modulus $\\lvert z \\rvert$ and argument $\\arg z = \\theta$ (with $-\\pi<\\theta\\leqslant\\pi$) of the complex number $\\var{z}$.

", "tags": ["MAS2103", "checked2015"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

\n

This question combines the original questions 2 and 3 from MAS2103 CBA 1.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Modulus and argument of a single complex number, where $\\mathrm{Re}(z)=\\mathrm{Im}(z)$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

For a complex number $z=a \\pm ai$, the modulus is given by $\\lvert z \\rvert=\\sqrt{a^2+a^2}=a\\sqrt{2}$.  In this part, therefore,

\n

\\[\\lvert z \\rvert=\\sqrt{(\\var{re(z)})^2+(\\var{im(z)})^2}=\\sqrt{2}\\times\\var{a}=\\var{absz}\\;\\text{to 3d.p.}\\]

\n

b)

\n

The argument of a complex number $z=a \\pm ai$ is given by

\n

\\[\\theta=\\arctan\\left(\\frac{\\pm a}{a}\\right)=\\arctan(\\pm 1)=\\pm\\frac{\\pi}{4}\\]

\n

regardless of the value of $a$.

\n

In this case {imzlg0}, so $\\theta=\\var{argz}$ to 3d.p.

"}, {"name": "Modulus and argument of a complex number II", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"absz": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(abs(z1/z2),3)", "description": "", "name": "absz"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "name": "b"}, "argz": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(arg(z1/z2),3)", "description": "", "name": "argz"}, "z2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "b-b*i", "description": "", "name": "z2"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "description": "", "name": "a"}, "z1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a+a*i", "description": "", "name": "z1"}}, "ungrouped_variables": ["a", "argz", "b", "absz", "tol", "z1", "z2"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "absz+tol", "minValue": "absz-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

$\\lvert z \\rvert=$ [[0]] (Enter your answer to 3 d.p.)

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "argz+tol", "minValue": "argz-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

$\\theta=$ [[0]] (Enter your answer to 3 d.p.)

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Find the modulus $\\lvert z \\rvert$ and argument $\\theta$ (with $-\\pi<\\theta\\leqslant\\pi$) of the complex number

\n

\\[\\var{z}=\\frac{\\var{z1}}{\\var{z2}}.\\]

", "tags": ["MAS2103", "checked2015"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Modulus and argument of a single complex number $z=z_1/z_2$, where $\\mathrm{Re}(z_1)=\\mathrm{Im}(z_1)$ and $\\mathrm{Re}(z_2)=-\\mathrm{Im}(z_2)$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

For a complex number $z=\\frac{a+ai}{b+bi}$, the modulus is given by

\n

\\[\\lvert z \\rvert=\\frac{\\sqrt{a^2+a^2}}{\\sqrt{b^2+b^2}}=\\frac{a\\sqrt{2}}{b\\sqrt{2}}=\\frac{a}{b}\\]

\n

In this part $a=\\var{a}$ and $b=\\var{b}$, so $\\lvert z \\rvert=\\frac{\\var{a}}{\\var{b}}=\\var{absz}$ to 3 d.p.

\n

b)

\n

To calculate the argument of a complex number $z=\\frac{a+ai}{b-bi}$, with $a>0$, $b>0$, first write $z$ in the form $z=c+di$.

\n

To do this, multiply $z=\\frac{a+ai}{b-bi}$ by $\\frac{b+bi}{b+bi}$, so that

\n

\\[z=\\frac{(a+ai)(b+bi)}{(b-bi)(b+bi)}=\\frac{2abi}{2b^2}=\\frac{a}{b}i\\]

\n

So, given that $a$ and $b$ are both positive, $\\mathrm{Im}(z)>0$, and because $\\mathrm{Re}(z)=0$, the argument is $\\theta=\\frac{\\pi}{2}$.

"}, {"name": "Operations on two complex numbers", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "tags": ["checked2015"], "metadata": {"description": "

Calculation of modulus, argument, multiplication by complex conjugate, given two complex numbers.

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

Given the complex numbers $z_1=\\var{z1}$ and $z_2=\\var{z2}$, calculate the following quantities.  In what follows, an asterisk denotes the complex conjugate.

", "advice": "

a) and b)

\n

The modulus of a complex number $z=a+bi$ is given by

\n

\\[\\lvert z \\rvert=\\sqrt{a^2+b^2}\\]

\n

In these parts, $z_1 = \\var{z1}$ and $z_2 = \\var{z2}$, so

\n

\\begin{align}
\\lvert z_1 \\rvert &=\\sqrt{(\\var{re(z1)})^2+(\\var{im(z1)})^2} \\\\
&= \\var{absz1}
\\end{align}

\n

and

\n

\\begin{align}
\\lvert z_2 \\rvert &= \\sqrt{(\\var{re(z2)})^2+(\\var{im(z2)})^2} \\\\
&= \\var{absz2}
\\end{align}

\n

(both to 3d.p.).

\n

c)

\n

In general

\n

\\[\\lvert z_1z_2 \\rvert=\\lvert z_1 \\rvert\\lvert z_2 \\rvert\\]

\n

so, in this part,

\n

\\[ \\lvert z_1z_2 \\rvert=\\sqrt{(\\var{re(z1)})^2+(\\var{im(z1)})^2}\\sqrt{(\\var{re(z2)})^2+(\\var{im(z2)})^2}=\\var{absz1z2} \\]

\n

to 3 d.p.

\n

d)

\n

If $z=a+bi$, then $z^\\ast=a-bi$, so 

\n

\\[z_1^\\ast=\\var{conjz1}\\]

\n

e)

\n

In general, $zz^\\ast=(a+bi)(a-bi)=a^2+b^2$, so

\n

\\[z_1z_1^\\ast=(\\var{z1})(\\var{conjz1})=(\\var{re(z1)})^2+(\\var{im(z1)})^2=\\var{z1conjz1}.\\]

", "rulesets": {}, "variables": {"tol": {"name": "tol", "group": "Ungrouped variables", "definition": "0.001", "description": "", "templateType": "anything"}, "absz2": {"name": "absz2", "group": "Ungrouped variables", "definition": "precround(abs(z2),3)", "description": "", "templateType": "anything"}, "z1conjz1": {"name": "z1conjz1", "group": "Ungrouped variables", "definition": "z1*conj(z1)", "description": "", "templateType": "anything"}, "absz1": {"name": "absz1", "group": "Ungrouped variables", "definition": "precround(abs(z1),3)", "description": "", "templateType": "anything"}, "z2": {"name": "z2", "group": "Ungrouped variables", "definition": "random(1..9)*sign(random(-1,1))+random(1..9)*sign(random(-1,1))*i", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Ungrouped variables", "definition": "random(1..9)*sign(random(-1,1))+random(1..9)*sign(random(-1,1))*i", "description": "", "templateType": "anything"}, "conjz1": {"name": "conjz1", "group": "Ungrouped variables", "definition": "conj(z1)", "description": "", "templateType": "anything"}, "absz1z2": {"name": "absz1z2", "group": "Ungrouped variables", "definition": "precround(abs(z1*z2),3)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["absz2", "absz1", "z1", "absz1z2", "tol", "conjz1", "z1conjz1", "z2"], "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": "

$\\lvert z_1 \\rvert=$ [[0]] (Enter your answer to 3 d.p.)

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "absz1-tol", "maxValue": "absz1+tol", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"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": "

$\\lvert z_2 \\rvert=$ [[0]] (Enter your answer to 3 d.p.)

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "absz2-tol", "maxValue": "absz2+tol", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"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": "

$\\lvert z_1z_2 \\rvert=$ [[0]] (Enter your answer to 3 d.p.)

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "absz1z2-tol", "maxValue": "absz1z2+tol", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"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": "

$z_1^\\ast=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{conjz1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}], "sortAnswers": false}, {"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": "

$z_1z_1^\\ast=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{z1conjz1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Polar form of a complex number", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"absz": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(abs(z),3)", "description": "", "name": "absz"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0..5)*sign(random(-1,1))", "description": "", "name": "a"}, "argz": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(arg(z),3)", "description": "", "name": "argz"}, "z": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a+b*i", "description": "", "name": "z"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0..5 except a)*sign(random(-1,1))", "description": "", "name": "b"}}, "ungrouped_variables": ["a", "argz", "b", "absz", "tol", "z"], "functions": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "parts": [{"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

$r=$ [[0]] (Enter your answer to 3 d.p.)

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "absz-tol", "maxValue": "absz+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

$\\theta=$ [[0]] (Enter your answer to 3 d.p.)

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "argz-tol", "maxValue": "argz+tol", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}], "statement": "

Write the complex number $z=\\var{z}$ in polar form $z=r\\mathrm{e}^{i\\theta}$, with $r>0$, $-\\pi<\\theta\\leqslant\\pi$, by calculating $r$ and $\\theta$.

", "tags": ["checked2015"], "rulesets": {}, "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Polar form of a complex number.

"}, "advice": "

To write a complex number $z=a+bi$ in polar form $z=r\\mathrm{e}^{i\\theta}$, we calculate the modulus $r = \\lvert z \\rvert$ and argument $\\theta = \\arg(z)$.

\n

Hence

\n

\\[r=\\lvert z \\rvert=\\sqrt{a^2+b^2}=\\sqrt{(\\var{a})^2+(\\var{b})^2}=\\var{absz}\\;\\text{to 3d.p.}\\]

\n

and, in general,

\n

\\[\\theta=\\arg(z)=\\arctan\\left(\\frac{b}{a}\\right).\\]

\n

If $a=0$, however, then $\\mathrm{Re}(z)=0$, so $\\arg(z)=\\pm\\frac{\\pi}{2}$, depending on whether $\\mathrm{Im}(z)$ is positive or negative.

\n

In this case $a=\\var{a}$, and $b=\\var{b}$, so $\\arg(z)=\\var{argz}$.

"}, {"name": "Function in real-imaginary form", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5 except a1)", "description": "", "name": "b1"}, "n3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch (\n n=2, 0,\n n=3, 1\n)", "description": "", "name": "n3"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "a1"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2,3)", "description": "", "name": "n"}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch (\n n=2, 1,\n n=3, 0\n)", "description": "", "name": "n2"}}, "ungrouped_variables": ["a1", "n2", "n3", "b1", "n"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "{n2}*({a1}*(x^2-y^2)+{b1}*y) + {n3}*({a1}*(x^3-3*x*y^2)+{2*b1}*x*y)", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": true, "expectedvariablenames": ["x", "y"], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "std", "marks": 1, "vsetrangepoints": 5}, {"answer": "{n2}*({2*a1}*x*y-{b1}*x)+{n3}*({3*a1}*x^2*y-{a1}*y^3-{b1}*(x^2-y^2))", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": true, "expectedvariablenames": ["x", "y"], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "std", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$g(x,y)=$ [[0]].

\n

$h(x,y)=$ [[1]].

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Express the function $f(z)=\\simplify{{a1}*z^{n}-i*{b1}*z^{n-1}}$ in real-imaginary form $f(z)=g(x,y)+ih(x,y)$, given that $z=x+iy$.

", "tags": ["MAS2103", "checked2015"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

\n

25/02/2014

\n

Enable unexpected variable names. AJY

\n

17/02/2014

\n

Fix typo in solution to $h(x,y)$. AJY

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Express $f(z)$ in real-imaginary form, given that $z=x+iy$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

All that is required in this question is to substitute $z=x+iy$ into the expression for $f(z)$, and rearrange to the form $f(z)=g(x,y)+ih(x,y)$, hence

\n

\\[\\begin{align}f(z)&=f(x+iy)\\\\&=\\simplify{{a1}*(x+iy)^{n}-i*{b1}*(x+iy)^{n-1}}\\\\&=\\simplify{{n2}*({a1}*(x^2-y^2)+{b1}*y) + {n3}*({a1}*(x^3-3*x*y^2)+{2*b1}*x*y)+i*({n2}*({2*a1}*x*y-{b1}*x)+{n3}*({3*a1}*x^2*y-{a1}*y^3-{b1}*(x^2+y^2)))}.\\end{align}\\]

"}, {"name": "Hyperbolic function in real-imaginary form", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..9)", "description": "", "name": "b1"}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0..1 except a1)", "description": "", "name": "c1"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "name": "a1"}, "d1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..9)", "description": "", "name": "d1"}}, "ungrouped_variables": ["a1", "c1", "b1", "d1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "{a1}*sinh({b1}*x)*cos({b1}*y)+{c1}*cosh({d1}*x)*cos({d1}*y)", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": true, "expectedvariablenames": ["x", "y"], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"answer": "{a1}*cosh({b1}*x)*sin({b1}*y)+{c1}*sinh({d1}*x)*sin({d1}*y)", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": true, "expectedvariablenames": ["x", "y"], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "\n

$g(x,y)=$ [[0]].

\n

$h(x,y)=$ [[1]].

\n", "showCorrectAnswer": true, "marks": 0}], "statement": "

Express the function $f(z)=\\simplify{{a1}*sinh({b1}*z)+{c1}*cosh({d1}*z)}$ in real-imaginary form $f(z)=g(x,y)+ih(x,y)$, given that $z=x+iy$.

", "tags": ["MAS2103", "checked2015"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

\n

25/02/2014

\n

Enable unexpected variable names. AJY

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Express $f(z)$ in real-imaginary form, given that $z=x+iy$, where $f(z)$ involves hyperbolic functions.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

Substitute $z=x+iy$ into the expression for $f(z)$, so that

\n

\\[f(z)=f(x+iy)=\\simplify{{a1}*sinh({b1}*(x+iy))+{c1}*cosh({d1}*(x+iy))},\\]

\n

then use the identity

\n

\\[\\simplify{{a1}*sinh(u+i*v)+{c1}*cosh(u+i*v)}=\\simplify{{a1}*(sinh(u)*cos(v)+i*cosh(u)*sin(v))+{c1}*(cosh(u)*cos(v)+i*sinh(u)*sin(v))},\\]

\n

and rearrange to give

\n

\\[f(z)=\\simplify{{a1}*sinh({b1}*x)*cos({b1}*y)+{a1}*i*cosh({b1}*x)*sin({b1}*y)+{c1}*cosh({d1}*x)*cos({d1}*y)+{c1}*i*sinh({d1}*x)*sin({d1}*y)}.\\]

"}, {"name": "Principle value of a complex number", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"v": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(exp(-b1*pi/4)*sin(b1*ln(a1*sqrt(2))),3)", "name": "v", "description": ""}, "tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.001", "name": "tol", "description": ""}, "u": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(exp(-b1*pi/4)*cos(b1*ln(a1*sqrt(2))),3)", "name": "u", "description": ""}, "a1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..4)", "name": "a1", "description": ""}, "b1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..4)", "name": "b1", "description": ""}}, "ungrouped_variables": ["a1", "u", "b1", "tol", "v"], "rulesets": {}, "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "u-tol", "showCorrectAnswer": true, "marks": 1, "maxValue": "u+tol"}, {"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "v-tol", "showCorrectAnswer": true, "marks": 1, "maxValue": "v+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "

$u=$ [[0]].  (Enter your answer to 3d.p.)

\n

$v=$ [[1]].  (Enter your answer to 3d.p.)

", "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

Find the principal value of the complex number $z=(\\simplify{{a1}+i*{a1}})^{\\simplify{i*{b1}}}$, in the form $u+iv$.

", "tags": ["MAS2103", "checked2015"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Calculate the principal value of a complex number.

"}, "advice": "

The complex number $z=(a+bi)^n$ can be written in the form

\n

\\[z=r^n\\mathrm{e}^{in\\left(\\theta+2k\\pi\\right)},\\]

\n

where $r$ is the modulus of $a+bi$, $\\theta$ is the argument, and where $-\\pi<\\theta\\leqslant\\pi$, and $k=0,1,2,\\ldots$.

\n

The principal value of $z$ is that which corresponds to $k=0$, so in this question

\n

\\[z=(\\simplify{{a1}+i*{a1}})^{\\simplify{i*{b1}}}=r^{\\simplify{i*{b1}}}\\mathrm{e}^{\\simplify{{-b1}*theta}}.\\]

\n

Then, $r$ is given by

\n

\\[r=\\sqrt{(\\var{a1})^2+(\\var{a1})^2}=\\simplify{{a1}*sqrt(2)},\\]

\n

and the argument $\\theta$ is given by

\n

\\[\\theta=\\arctan\\left(\\frac{\\var{a1}}{\\var{a1}}\\right)=\\arctan(1)=\\frac{\\pi}{4}.\\]

\n

Therefore

\n

\\[z=(\\simplify{{a1}*sqrt(2)})^{\\simplify{i*{b1}}}\\mathrm{e}^{\\simplify{{-b1}*pi/4}}.\\]

\n

Next, note that

\n

\\[(\\simplify{{a1}*sqrt(2)})^{\\simplify{i*{b1}}}=\\mathrm{e}^{\\simplify{i*{b1}}\\ln(\\simplify{{a1}*sqrt(2)})}.\\]

\n

Now use the identity

\n

\\[\\mathrm{e}^{i\\phi}=\\cos(\\phi)+i\\sin(\\phi),\\]

\n

so

\n

\\[(\\simplify{{a1}*sqrt(2)})^{\\simplify{i*{b1}}}\\mathrm{e}^{\\simplify{{-b1}*pi/4}}=\\Biggl(\\cos\\biggl(\\simplify{{b1}*ln({a1}*sqrt(2))}\\biggr)+i\\sin\\biggl(\\simplify{{b1}*ln({a1}*sqrt(2))}\\biggr)\\Biggr)\\mathrm{e}^{\\simplify{{-b1}*pi/4}}\\]

\n

which, when evaluated numerically gives

\n

\\[z=\\simplify{{u}+{v}i}\\;\\text{to 3d.p.}\\]

"}, {"name": "Principle values of log", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "name": "b1"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "u": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ln(a1),3)", "description": "", "name": "u"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "a1"}}, "ungrouped_variables": ["a1", "u", "b1", "tol"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "u+tol", "minValue": "u-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"answer": "pi*(1+4*n)/{2*b1}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "notallowed": {"message": "

Do not use decimals in your answer.

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$u=$ [[0]].  (Enter your answer to 3d.p.)

\n

$v=$ [[1]].  (Do not use decimals in your answer.  Use $n$ for the index, and if you need to use $\\pi$ in your answer, write pi.)

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Write the expression $\\log\\left(\\simplify{{a1}*i^(1/{b1})}\\right)$ in the form $u+iv$, where $u$ and $v$ are to be determined, and $v$ depends on some index $n=0,\\pm 1,\\pm 2,\\ldots$, say.

", "tags": ["MAS2103", "checked2015"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Expressing $\\log(f(i))$ in the form $u+iv$.  Principal values of log.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

First write the expression $z=\\log\\left(\\simplify{{a1}*i^(1/{b1})}\\right)$ as

\n

\\[z=\\ln(\\var{a1})+\\log\\left(\\simplify{i^(1/{b1})}\\right),\\]

\n

then

\n

\\[z=\\ln(\\var{a1})+\\frac{1}{\\var{b1}}\\log(i).\\]

\n

Now

\n

\\[\\log(i)=\\operatorname{Log}(i)+2n\\pi i, \\quad n=0,\\pm 1,\\pm 2,\\ldots,\\]

\n

where $\\operatorname{Log}(i)$ is the principal value of $\\log(i)$.

\n

Then

\n

\\[\\operatorname{Log}(i)=\\ln\\lvert i\\rvert+i\\operatorname{Arg}(i)=0+\\frac{\\pi}{2}i,\\]

\n

so

\n

\\[\\log(i)=0+\\frac{\\pi}{2}i+2n\\pi i=\\frac{(1+4n)\\pi i}{2}, \\quad n=0,\\pm 1,\\pm 2,\\ldots.\\]

\n

Therefore

\n

\\[z=\\log\\left(\\simplify{{a1}*i^(1/{b1})}\\right)=\\ln(\\var{a1})+\\frac{(1+4n)\\pi i}{\\var{2*b1}}, \\quad n=0,\\pm 1,\\pm 2,\\ldots.\\]

"}, {"name": "Roots of sin(z)=a", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..9)", "description": "", "name": "a1"}, "v2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ln(a1-sqrt(a1^2-1)),3)", "description": "", "name": "v2"}, "v1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ln(a1+sqrt(a1^2-1)),3)", "description": "", "name": "v1"}}, "ungrouped_variables": ["a1", "v1", "v2", "tol"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "(1+4*n)*pi/2", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "notallowed": {"message": "

Do not enter decimals in your answer.

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "v1+tol", "minValue": "v1-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "v2+tol", "minValue": "v2-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

$u=$ [[0]].  (Do not enter decimals in your answer.  Use $n$ for the index, and if you need to enter $\\pi$, write pi.)

\n

There are two possible numerical answers $v_1$ and $v_2$ for the imaginary part.  Enter the larger value in the first box, and the smaller value in the second box, both to 3d.p.

\n

$v_1=$ [[1]].  (Enter your answer to 3d.p.)

\n

$v_2=$ [[2]].  (Enter your answer to 3d.p.)

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Find the roots of the equation $\\sin(z)=\\var{a1}$, in the form $u+iv$, where $u$ and $v$ are real, but $u$ depends on some index $n=0,\\pm 1,\\pm 2,\\ldots$, say.

", "tags": ["MAS2103", "checked2015"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Find the roots of $\\sin(z)=a$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

The equation $\\sin(z)=\\var{a1}$ can be solved by making the substitution $z=x+iy$, and using the identity

\n

\\[\\sin(x+iy)=\\sin(x)\\cosh(y)+i\\cos(x)\\sinh(y),\\]

\n

so then

\n

\\[\\sin(x)\\cosh(y)+i\\cos(x)\\sinh(y)=\\var{a1}.\\]

\n

Now equate real and imaginary parts, so

\n

\\[\\begin{align}\\sin(x)\\cosh(y)&=\\var{a1},\\tag{1}\\\\\\cos(x)\\sinh(y)&=0.\\tag{2}\\end{align}\\]

\n

From equation (2), either $\\cos(x)=0$ or $\\sinh(y)=0$.

\n

If $\\sinh(y)=0$, then $y=0$, which would imply $\\sin(x)=\\var{a1}$ from equation (1).  This is impossible, however, because $-1\\leqslant\\sin(x)\\leqslant 1$.  We must have $\\cos(x)=0$, therefore, and so

\n

\\[x=\\frac{(1+2n)\\pi}{2},\\quad n=0,\\pm 1,\\pm 2,\\ldots.\\]

\n

Substituting this value of $x$ into equation (1) implies that $\\pm\\cosh(y)=\\var{a1}$, because $\\sin(x)=\\pm 1$.

\n

Because $\\cosh(y)>0\\;\\forall y$, however, $\\sin(x)=-1$ is not permitted.  This occurs for $n=\\pm 1,\\pm 3,\\ldots$.  These values of $x$ are not permitted, therefore, so we must have

\n

\\[x=\\frac{(1+4n)\\pi}{2},\\quad n=0,\\pm 1,\\pm 2,\\ldots.\\]

\n

then $\\cosh(y)=\\var{a1}$, and therefore

\n

\\[y=\\operatorname{arcosh}(\\var{a1})\\;\\text{or}\\;y=-\\operatorname{arcosh}(\\var{a1}).\\]

\n

The roots are then $u+iv$, with

\n

\\[u=\\frac{(1+4n)\\pi}{2},\\quad n=0,\\pm 1,\\pm 2,\\ldots\\]

\n

and

\n

\\[v_{1,2}=\\pm\\operatorname{arcosh}(\\var{a1})=\\pm\\var{v1}\\;\\text{to 3d.p.}\\]

"}, {"name": "Cauchy integral theorem for complex functions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "", "name": "b3"}, "a4switch": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch (\n a4=2, [1,0,0],\n a4=3, [0,1,0],\n a4=4, [0,0,1]\n )", "description": "", "name": "a4switch"}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..6)", "description": "", "name": "n1"}, "b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "b1"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "a1"}, "b2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "", "name": "b2"}, "n3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..3)", "description": "", "name": "n3"}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..3)", "description": "", "name": "n2"}, "in4p2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch (\n n4=1, -i,\n n4=2, 1,\n n4=3, i,\n n4=4, -1\n )", "description": "", "name": "in4p2"}, "in4p1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch (\n n4=1, -1,\n n4=2, -i,\n n4=3, 1,\n n4=4, i\n )", "description": "", "name": "in4p1"}, "a3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "a3"}, "a4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "", "name": "a4"}, "n4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "n4"}, "a2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "a2"}}, "ungrouped_variables": ["a4switch", "in4p2", "in4p1", "a1", "a3", "a2", "b1", "b2", "b3", "n1", "n2", "n3", "n4", "a4"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "0", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

\\[f(z)=\\simplify{{a1}*z^{n1}-{b1}*z^{n1-1}}\\]

\n

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "0", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

\\[f(z)=\\simplify{{a2}*z^{n2}/(z-{b2})}\\]

\n

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "i*pi*{2*a3}/({b3}^{1+n3})", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

\\[f(z)=\\simplify{{a3}*z^{n3}/({b3}*z-1)}\\]

\n

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "2*pi/{a4^(n4+1)}*(({in4p1*a4switch[1]}/2+{in4p1*a4switch[2]}/sqrt(2))+({in4p2*a4switch[0]}+{in4p2*a4switch[1]}*sqrt(3)/2+{in4p2*a4switch[2]}/sqrt(2)))", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "notallowed": {"message": "

Do not enter decimals, the exponential function, or any trigonometric functions in your answer.

", "showStrings": false, "partialCredit": 0, "strings": [".", "e", "exp", "cos", "sin", "tan", "sec", "cosec", "cot"]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

\\[f(z)=\\frac{\\simplify{z^{n4}}\\mathrm{e}^{\\pi z}}{\\simplify{{a4}*z}-i}\\]

\n

$I=$ [[0]].

\n

Do not use decimals, the exponential function, or any trigonometric functions in your answer.  If you need to enter $\\pi$ write pi, and if you need to enter a square root, e.g. $\\sqrt{x}$, enter sqrt(x).

", "showCorrectAnswer": true, "marks": 0}], "statement": "

For each of the following functions $f(z)$, use Cauchy's Integral Theorem or Cauchy's Integral Formula (as appropriate) to evaluate

\n

\\[I=\\oint_C{\\!f(z)\\,\\mathrm{d}z},\\]

\n

where $C$ is the unit circle $\\lvert z\\rvert=1$ mapped counter-clockwise.

", "tags": ["MAS2103", "checked2015"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Cauchy's integral theorem/formula for several functions $f(z)$ and $C$ the unit circle.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

Cauchy's Integral Theorem

\n
If $f(z)$ is analytic in a simply connected domain $D$, then for every simple closed path $C$ in $D$ \\[\\oint_C{\\!f(z)\\,\\mathrm{d}z}=0.\\]
\n

Cauchy's Integral Formula

\n
Let $g(z)$ be analytic in a simply connected domain $D$. Then for any point $z_0$ in $D$, and any simple closed path $C$ in $D$ that encloses $z_0$ \\[\\oint_C{\\!\\frac{g(z)}{z-z_0}\\,\\mathrm{d}z}=2\\pi i g(z_0),\\] where the integration is performed counter-clockwise.
\n

a)

\n

$f(z)=\\simplify{{a1}*z^{n1}-{b1}*z^{n1-1}}$ is analytic for all $z$, so we can use the theorem to obtain $I=0$.

\n

 

\n

b)

\n

$f(z)=\\simplify{{a2}*z^{n2}/(z-{b2})}$ is not analytic at $z=\\var{b2}$, but this point is outside $C$, so we can again use the theorem to obtain $I=0$.

\n

 

\n

c)

\n

$f(z)=\\simplify{{a3}*z^{n3}/({b3}*z-1)}$ is not analytic at $z=\\simplify{1/{b3}}$, and this point is inside $C$, so we cannot use the theorem.

\n

Instead, we must use the formula, so

\n

\\[I=\\oint{\\!\\frac{g(z)}{z-z_0}\\,\\mathrm{d}z}=2\\pi i g(z_0),\\]

\n

where $g(z)=\\simplify{{a3}/{b3}*z^{n3}}$ and $z_0=\\simplify{1/{b3}}$, and therefore

\n

\\[I=2\\pi i\\times\\simplify{{a3}/{b3}}\\times\\simplify{1/{b3}^{n3}}=\\simplify{i*pi*{2*a3}/({b3}^{1+n3})}.\\]

\n

 

\n

d)

\n

$f(z)=\\frac{\\simplify{z^{n4}}\\mathrm{e}^{\\pi z}}{\\simplify{{a4}*z}-i}$ is not anayltic at $z=\\frac{i}{\\var{a4}}$, and this point is inside $C$, so we again cannot use the theorem.

\n

Using the formula, we have $g(z)=\\simplify{1/{a4}z^{n4}}\\mathrm{e}^{\\pi z}$, and $z_0=\\frac{i}{\\var{a4}}$, so

\n

\\[I=2\\pi i\\times\\simplify{1/{a4}}\\times\\simplify{(i/{a4})^{n4}}\\mathrm{e}^{\\frac{i\\pi}{\\var{a4}}}=\\simplify{2*pi/{a4^(n4+1)}*(({in4p1*a4switch[1]}/2+{in4p1*a4switch[2]}/sqrt(2))+({in4p2*a4switch[0]}+{in4p2*a4switch[1]}*sqrt(3)/2+{in4p2*a4switch[2]}/sqrt(2)))}.\\]

\n

"}, {"name": "Contour integral of a complex function", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "b1"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0..5)", "description": "", "name": "a1"}}, "ungrouped_variables": ["a1", "b1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "-({a1^3}+i*{b1^3})/3", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "notallowed": {"message": "

Do not enter decimals in your answer.

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$I=$ [[0]].  (Do not enter decimals in your answer.)

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Find the value of the integral

\n

\\[I=\\int_C{\\!z^2\\,\\mathrm{d}z},\\]

\n

along any path $C$ from $z=\\var{a1}$ to $z=\\simplify{{b1}*i}$.

", "tags": ["checked2015", "MAS2103"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Contour integral of $z^2$ along any path.

"}, "variablesTest": {"condition": "b1=1", "maxRuns": 100}, "advice": "

This is an exercise in integration, so

\n

\\[\\begin{align}I&=\\int_C{\\!z^2\\,\\mathrm{d}z}\\\\&=\\int_{\\var{a1}}^{\\simplify{{b1}*i}}{\\!z^2\\,\\mathrm{d}z}\\\\&=\\left[\\frac{1}{3}z^3\\right]_{\\var{a1}}^{\\simplify{{b1}*i}}\\\\&=\\frac{1}{3}\\left(\\simplify{{b1^3}*i^3}-\\var{a1}^3\\right)\\\\&=-\\frac{1}{3}\\left(\\simplify{{a1^3}+{b1^3}*i}\\right).\\end{align}\\]

"}, {"name": "Contour integral of a complex function II", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "c1"}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(exp(-b1)*sin(c1),3)", "description": "", "name": "v"}, "b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "b1"}, "u": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(exp(-a1)-exp(-b1)*cos(c1),3)", "description": "", "name": "u"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "a1"}}, "ungrouped_variables": ["a1", "u", "b1", "tol", "v", "c1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "u+tol", "minValue": "u-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "v+tol", "minValue": "v-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

$I=$[[0]]$+i$[[1]].  (Enter your answers to 3d.p.)

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Find the value of the integral

\n

\\[I=\\int_C{\\!\\mathrm{e}^{-z}\\,\\mathrm{d}z},\\]

\n

along any path $C$ from $z=\\var{a1}$ to $z=\\simplify{{b1}+{c1}*i}$.

", "tags": ["checked2015", "MAS2103"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Contour integral of $\\mathrm{e}^{-z}$ along any path.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

This is an exercise in integration, so

\n

\\[\\begin{align}I&=\\int_C{\\!\\mathrm{e}^{-z}\\,\\mathrm{d}z}\\\\&=\\int_{\\var{a1}}^{\\simplify{{b1}+{c1}*i}}{\\!\\mathrm{e}^{-z}\\,\\mathrm{d}z}\\\\&=-\\left[\\mathrm{e}^{-z}\\right]_{\\var{a1}}^{\\simplify{{b1}+{c1}*i}}\\\\&=\\mathrm{e}^{\\var{-a1}}-\\mathrm{e}^{\\simplify{{-b1}+{-c1}*i}}.\\end{align}\\]

\n

This can be rewritten as

\n

\\[I=\\mathrm{e}^{\\var{-a1}}-\\mathrm{e}^{\\var{-b1}}\\biggl(\\cos(\\var{c1})-i\\sin(\\var{c1})\\biggr)=\\simplify{{u}+{v}*i}\\;\\text{to 3d.p.}\\]

"}, {"name": "Complex-valued function, pair of pure imaginary poles", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "b1"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "a1"}}, "ungrouped_variables": ["a1", "b1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "{b1}*i", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"answer": "{-b1}*i", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

There are two poles $z_0$ and $z_1$.  Enter the pole with the greatest imaginary part first.

\n

$z_0=$ [[0]].

\n

$z_1=$ [[1]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "-i*{cos(a1*b1*pi)}/{2*b1}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 1, "vsetrangepoints": 5}, {"answer": "i*{cos(a1*b1*pi)}/{2*b1}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

Corresponding residue $\\underset{z=z_0}{\\operatorname{Res}}f(z)=$ [[0]].

\n

Corresponding residue $\\underset{z=z_1}{\\operatorname{Res}}f(z)=$ [[1]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "0", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "notallowed": {"message": "

Do not use the exponential function, or any trigonometric functions in your answer.

", "showStrings": false, "partialCredit": 0, "strings": ["e", "exp", "cos", "sin", "tan", "sec", "cosec", "cot"]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$I=$ [[0]].

\n

Do not use the exponential function, or any trigonometric functions in your answer.

", "showCorrectAnswer": true, "marks": 0}], "statement": "

For the function

\n

\\[f(z)=\\frac{\\mathrm{e}^{\\simplify{{a1}*pi*z}}}{\\simplify{z^2+{b1^2}}},\\]

\n

identify the poles (singular points) $z_0$, the corresponding residues $\\underset{z=z_0}{\\operatorname{Res}}f(z)$, and evaluate the integral

\n

\\[I=\\oint{\\!f(z)\\,\\mathrm{d}z},\\]

\n

where $C$ is the contour $\\lvert z \\rvert=5$ mapped counter-clockwise.

", "tags": ["checked2015", "MAS2103"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Poles, residues, and contour integral of a complex-valued function.  Pair of pure imaginary poles.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

The given function has two simple poles at $z=\\simplify{{b1}*i}$ and $z=\\simplify{{-b1}*i}$.

\n

 

\n

b)

\n

For a simple pole $z=z_0$, the residue can be calculated using the formula

\n

\\[\\underset{z=z_0}{\\operatorname{Res}}=\\lim_{z\\rightarrow z_0}(z-z_0)f(z).\\]

\n

In this case, the corresponding residue for $z=\\simplify{{b1}*i}$ is

\n

\\[\\underset{z=\\simplify{{b1}*i}}{\\operatorname{Res}}=\\lim_{z\\rightarrow\\simplify{{b1}*i}}(z-\\simplify{{b1}*i})f(z)=\\lim_{z\\rightarrow\\simplify{{b1}*i}}\\left(\\frac{\\mathrm{e}^{\\simplify{{a1}*pi*z}}}{\\simplify{z+{b1}*i}}\\right)=\\simplify{-i/{2*b1}}\\mathrm{e}^{\\simplify{{a1*b1}*pi*i}}=\\frac{1}{\\var{2*b1}}\\biggl(\\sin(\\simplify{{a1*b1}*pi})-i\\cos(\\simplify{{a1*b1}*pi})\\biggr)=\\simplify{-i*cos({a1*b1*pi})/{2*b1}},\\]

\n

and the corresponding residue for $z=\\simplify{{-b1}*i}$ is

\n

\\[\\underset{z=\\simplify{{-b1}*i}}{\\operatorname{Res}}=\\lim_{z\\rightarrow\\simplify{{-b1}*i}}(z+\\simplify{{b1}*i})f(z)=\\lim_{z\\rightarrow\\simplify{{-b1}*i}}\\left(\\frac{\\mathrm{e}^{\\simplify{{a1}*pi*z}}}{\\simplify{z-{b1}*i}}\\right)=\\simplify{i/{2*b1}}\\mathrm{e}^{\\simplify{{-a1*b1*pi*i}}}=\\frac{1}{\\var{2*b1}}\\biggl(\\sin(\\simplify{{a1*b1}*pi})+i\\cos(\\simplify{{a1*b1}*pi})\\biggr)=\\simplify{i*cos({a1*b1*pi})/{2*b1}}.\\]

\n

 

\n

c)

\n

Now use the Residue Theorem to calculate the integral $I$.

\n

Residue Theorem

\n
Let $f(z)$ be analytic inside a closed path $C$, and on $C$, except at finitely many singular points $z_n=z_1,z_2,\\ldots,z_k$ inside $C$.  Then the integral of $f(z)$ taken counter-clockwise around $C$ equals $2\\pi i$ times the sum of the residues of $f(z)$ at $z_n=z_1,z_2,\\ldots,z_k$, i.e. \\[\\oint_C{\\!f(z)\\,\\mathrm{d}z}=2\\pi i\\sum_{n=1}^k{\\underset{z=z_n}{\\operatorname{Res}}f(z)}.\\]
\n

Therefore

\n

\\[I=2\\pi i\\left(\\simplify{i*cos({a1*b1*pi})/{2*b1}}-\\simplify{i*cos({a1*b1*pi})/{2*b1}}\\right)=0.\\]

"}, {"name": "Complex-valued function, pair of real poles", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0..3)", "description": "", "name": "b1"}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "c1"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "a1"}, "d1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "d1"}}, "ungrouped_variables": ["a1", "c1", "b1", "d1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "0", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"answer": "{d1}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

There are two poles $z_0$ and $z_1$.  Enter the pole with the least real part first.

\n

$z_0=$ [[0]].

\n

$z_1=$ [[1]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "-{a1}/{d1}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 1, "vsetrangepoints": 5}, {"answer": "{a1+b1*d1+c1*d1^2}/{d1}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

Corresponding residue $\\underset{z=z_0}{\\operatorname{Res}}f(z)=$ [[0]].

\n

Corresponding residue $\\underset{z=z_1}{\\operatorname{Res}}f(z)=$ [[1]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "{2*(b1+c1*d1)*pi*i}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}], "statement": "

For the function

\n

\\[f(z)=\\simplify{({a1}+{b1}*z+{c1}*z^2)/(z^2-{d1}*z)},\\]

\n

identify the poles (singular points) $z_0$, the corresponding residues $\\underset{z=z_0}{\\operatorname{Res}}f(z)$, and evaluate the integral

\n

\\[I=\\oint{\\!f(z)\\,\\mathrm{d}z},\\]

\n

where $C$ is the contour $\\lvert z \\rvert=5$ mapped counter-clockwise.

", "tags": ["checked2015", "MAS2103"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Poles, residues, and contour integral of a complex-valued function.  Pair of real poles.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

The given function has two simple poles at $z=0$ and $z=\\var{d1}$.

\n

 

\n

b)

\n

For a simple pole $z=z_0$, the residue can be calculated using the formula

\n

\\[\\underset{z=z_0}{\\operatorname{Res}}=\\lim_{z\\rightarrow z_0}(z-z_0)f(z).\\]

\n

In this case, the corresponding residue for $z=0$ is

\n

\\[\\underset{z=0}{\\operatorname{Res}}=\\lim_{z\\rightarrow 0}zf(z)=\\lim_{z\\rightarrow0}\\left(\\simplify{({a1}+{b1}*z+{c1}*z^2)/(z-{d1})}\\right)=\\simplify{-{a1}/{d1}}.\\]

\n

and the corresponding residue for $z=\\var{d1}$ is

\n

\\[\\underset{z=\\var{d1}}{\\operatorname{Res}}=\\lim_{z\\rightarrow\\var{d1}}(z-\\var{d1})f(z)=\\lim_{z\\rightarrow\\var{d1}}\\left(\\simplify{({a1}+{b1}*z+{c1}*z^2)/z}\\right)=\\simplify{{a1+b1*d1+c1*d1^2}/{d1}}.\\]

\n

c)

\n

Now use the Residue Theorem to calculate the integral $I$.

\n

Residue Theorem

\n
Let $f(z)$ be analytic inside a closed path $C$, and on $C$, except at finitely many singular points $z_n=z_1,z_2,\\ldots,z_k$ inside $C$.  Then the integral of $f(z)$ taken counter-clockwise around $C$ equals $2\\pi i$ times the sum of the residues of $f(z)$ at $z_n=z_1,z_2,\\ldots,z_k$, i.e. \\[\\oint_C{\\!f(z)\\,\\mathrm{d}z}=2\\pi i\\sum_{n=1}^k{\\underset{z=z_n}{\\operatorname{Res}}f(z)}.\\]
\n

Therefore

\n

\\[I=2\\pi i\\left(\\simplify{-{a1}/{d1}}+\\simplify{{a1+b1*d1+c1*d1^2}/{d1}}\\right)=\\simplify{{2*pi*i*(b1+c1*d1)}}.\\]

"}, {"name": "Complex-valued function, single, simple pole", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "b1"}, "res": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a1+b1*c1^n1", "description": "", "name": "res"}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "c1"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "a1"}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "", "name": "n1"}}, "ungrouped_variables": ["a1", "n1", "c1", "b1", "res"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "{c1}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

Pole $z_0=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "{res}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

Corresponding residue $\\underset{z=z_0}{\\operatorname{Res}}f(z)=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "{2*res}*pi*i", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}], "statement": "

For the function

\n

\\[f(z)=\\simplify{({a1}+{b1}*z^{n1})/(z-{c1})},\\]

\n

identify the poles (singular points) $z_0$, the corresponding residues $\\underset{z=z_0}{\\operatorname{Res}}f(z)$, and evaluate the integral

\n

\\[I=\\oint{\\!f(z)\\,\\mathrm{d}z},\\]

\n

where $C$ is the contour $\\lvert z \\rvert=5$ mapped counter-clockwise.

", "tags": ["checked2015", "MAS2103"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Poles, residues, and contour integral of a complex-valued function.  Single, simple pole.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

The given function has a simple pole at $z=\\var{c1}$.

\n

 

\n

b)

\n

For a simple pole $z=z_0$, the residue can be calculated using the formula

\n

\\[\\underset{z=z_0}{\\operatorname{Res}}=\\lim_{z\\rightarrow z_0}(z-z_0)f(z).\\]

\n

In this case, the corresponding residue for $z=\\var{c1}$ is

\n

\\[\\underset{z=\\var{c1}}{\\operatorname{Res}}=\\lim_{z\\rightarrow\\var{c1}}(z-\\var{c1})f(z)=\\lim_{z\\rightarrow\\var{c1}}\\left(\\simplify{{a1}+{b1}*z^{n1}}\\right)=\\var{res}.\\]

\n

 

\n

c)

\n

Now use the Residue Theorem to calculate the integral $I$.

\n

Residue Theorem

\n
Let $f(z)$ be analytic inside a closed path $C$, and on $C$, except at finitely many singular points $z_n=z_1,z_2,\\ldots,z_k$ inside $C$.  Then the integral of $f(z)$ taken counter-clockwise around $C$ equals $2\\pi i$ times the sum of the residues of $f(z)$ at $z_n=z_1,z_2,\\ldots,z_k$, i.e. \\[\\oint_C{\\!f(z)\\,\\mathrm{d}z}=2\\pi i\\sum_{n=1}^k{\\underset{z=z_n}{\\operatorname{Res}}f(z)}.\\]
\n

Therefore

\n

\\[I=2\\pi i\\times\\simplify{{a1}+{b1}*{c1}^{n1}}=\\simplify{2*pi*i*({a1}+{b1}*{c1}^{n1})}.\\]

"}, {"name": "Contour integral of a complex-valued function", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..6)", "description": "", "name": "b1"}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "name": "c1"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..6)", "description": "", "name": "a1"}}, "ungrouped_variables": ["a1", "c1", "b1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "0", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$z=0$ and $z=\\simplify{1/{c1}}$ are both outside $C$.

\n

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "{-2*a1}*pi*i", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$z=0$ is inside $C$, but $z=\\simplify{1/{c1}}$ is outside $C$.

\n

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "{2*(a1*c1+b1)}*pi*i/{c1}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "answersimplification": "all", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$z=0$ is outside $C$, but $z=\\simplify{1/{c1}}$ is inside $C$.

\n

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "{2*b1}*pi*i/{c1}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

$z=0$ and $z=\\simplify{1/{c1}}$ are both inside $C$.

\n

$I=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Evaluate the integral

\n

\\[I=\\oint_C{\\!\\simplify{({a1}+{b1}*z)/({c1}*z^2-z)}\\,\\mathrm{d}z},\\]

\n

where $C$, mapped counter-clockwise, has the following properties.

", "tags": ["checked2015", "MAS210"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

15/7/2012:

\n

Added tags.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Contour integral of a complex-valued function $f(z)$ with the poles of $f(z)$ either inside or outside the path $C$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

Cauchy's Integral Theorem

\n
If $f(z)$ is analytic in a simply connected domain $D$, then for every simple closed path $C$ in $D$ \\[\\oint_C{\\!f(z)\\,\\mathrm{d}z}=0.\\]
\n

Cauchy's Integral Formula

\n
Let $g(z)$ be analytic in a simply connected domain $D$. Then for any point $z_0$ in $D$, and any simple closed path $C$ in $D$ that encloses $z_0$ \\[\\oint_C{\\!\\frac{g(z)}{z-z_0}\\,\\mathrm{d}z}=2\\pi i g(z_0),\\] where the integration is performed counter-clockwise.
\n

Residue Theorem

\n
Let $f(z)$ be analytic inside a closed path $C$, and on $C$, except at finitely many singular points $z_n=z_1,z_2,\\ldots,z_k$ inside $C$.  Then the integral of $f(z)$ taken counter-clockwise around $C$ equals $2\\pi i$ times the sum of the residues of $f(z)$ at $z_n=z_1,z_2,\\ldots,z_k$, i.e. \\[\\oint_C{\\!f(z)\\,\\mathrm{d}z}=2\\pi i\\sum_{n=1}^k{\\underset{z=z_n}{\\operatorname{Res}}f(z)}.\\]
\n

a)

\n

The given function is not analytic at the points $z=0$ and $z=\\simplify{1/{c1}}$.

\n

In this part, both of these poles are outside the path $C$.  We can therefore use Cauchy's Integral Theorem to state that $I=0$.

\n

 

\n

b)

\n

In this part $z=0$ is inside the path $C$, and $z=\\simplify{1/{c1}}$ is outside, so we cannot use the theorem.  We can use Cauchy's Integral Formula, however.

\n

First rewrite $f(z)$ as $\\frac{g(z)}{z-z_0}$, where $z_0=0$ and $g(z)=\\simplify{({a1}+{b1}*z)/({c1}*z-1)}$.

\n

Then

\n

\\[I=2\\pi i g(z_0)=\\simplify{{-2*a1}*pi*i}.\\]

\n

 

\n

c)

\n

In this part $z=0$ is outside the path $C$, and $z=\\simplify{1/{c1}}$ is inside, so we again cannot use the theorem.  We can use Cauchy's Integral Formula, however.

\n

First rewrite $f(z)$ as $\\frac{g(z)}{z-z_0}$, where $z_0=\\simplify{1/{c1}}$ and $g(z)=\\simplify{({a1}+{b1}*z)/({c1}*z)}$.

\n

Then

\n

\\[I=2\\pi i g(z_0)=\\simplify{{2*(a1*c1+b1)}*pi*i/{c1}}.\\]

\n

 

\n

d)

\n

In this part, both $z=0$ and $z=\\simplify{1/{c1}}$ are inside the path $C$, so we must use the Residue Theorem to calculate the integral.

\n

The residue corresponding to $z=0$ is given by

\n

\\[\\underset{z=0}{\\operatorname{Res}}f(z)=\\lim_{z\\rightarrow 0}\\left(\\simplify{({a1}+{b1}*z)/({c1}*z-1)}\\right)=\\var{-a1},\\]

\n

and the residue corresponding to $z=\\simplify{1/{c1}}$ is given by

\n

\\[\\underset{z=\\simplify{1/{c1}}}{\\operatorname{Res}}f(z)=\\lim_{z\\rightarrow\\simplify{1/{c1}}}\\left(\\simplify{({a1}+{b1}*z)/({c1}*z)}\\right)=\\simplify{{a1*c1+b1}/{c1}}.\\]

\n

Therefore

\n

\\[I=2\\pi i\\left(\\var{-a1}+\\simplify{{a1*c1+b1}/{c1}}\\right)=\\simplify{{2*b1}*pi*i/{c1}}.\\]

"}], "name": "", "pickQuestions": 0}], "name": "Complex variables", "showQuestionGroupNames": false, "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Questions used in a university course titled \"Complex variables\""}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "extensions": [], "custom_part_types": [], "resources": []}