// Numbas version: finer_feedback_settings {"name": "CN05 Writing a complex number in polar form", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "feedback": {"showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showpartfeedbackmessageswhen": "always", "allowrevealanswer": true, "showexpectedanswerswhen": "inreview", "showadvicewhen": "inreview"}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "CN05 Writing a complex number in polar form", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Write $\\simplify[basic,zeroFactor,zeroTerm]{{a}+{b}i}$ in polar form.

\n

That is, give your answer in the form $re^{i\\theta}$ where $r\\geq 0$ and $\\theta$ is between $-\\pi$ and $\\pi$.

", "advice": "

To write a complex number in polar form we need to work out the modulus and the argument.

\n

First the modulus of a number $z$ is simply given by $|z|$. Here that means we have

\n

\\[\\left|\\simplify[basic,zeroFactor,zeroTerm]{{a}+{b}i}\\right|=\\sqrt{\\simplify[basic,zeroFactor,zeroTerm]{{a}^2+{b}^2}}=\\var{Modulus}.\\]

\n

Next we need to calculate the argument. Recall that the argument of a complex number $\\arg(a+bi)$ is given by $\\tan^{-1}\\left(\\frac{a}{b}\\right)$. {AdviceToAdd}

\n

Putting this in polar form this gives us a final answer of

\n

\\[\\simplify[basic,zeroFactor,zeroTerm]{{a}+{b}i}=\\var{Ans}.\\]

\n

Use this link to find resources to help you revise complex numbers.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"Modulus": {"name": "Modulus", "group": "Ungrouped variables", "definition": "random(1..10)", "description": "", "templateType": "anything", "can_override": false}, "ArgumentWithoutPi": {"name": "ArgumentWithoutPi", "group": "Ungrouped variables", "definition": "random(-1,1)*random(1..4)*1/4", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "if(ArgumentWithoutPi=1/4, expression(Modulus+\"/sqrt(2)\"),\n if(ArgumentWithoutPi=1/2, expression(\"0\"),\n if(ArgumentWithoutPi=3/4, expression(\"-\"+Modulus+\"/sqrt(2)\"),\n if(ArgumentWithoutPi=1, expression(\"-\"+Modulus),\nif(ArgumentWithoutPi=-1/4, expression(Modulus+\"/sqrt(2)\"),\n if(ArgumentWithoutPi=-1/2, expression(\"0\"),\n if(ArgumentWithoutPi=-3/4, expression(\"-\"+Modulus+\"/sqrt(2)\"),\n if(ArgumentWithoutPi=-1, expression(\"-\"+Modulus),\nexpression(Modulus+\"1\")))))))))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "if(ArgumentWithoutPi=1/4, expression(Modulus+\"/sqrt(2)\"),\n if(ArgumentWithoutPi=1/2, expression(Modulus+\"1\"),\n if(ArgumentWithoutPi=3/4, expression(Modulus+\"/sqrt(2)\"),\n if(ArgumentWithoutPi=1, expression(\"0\"),\nif(ArgumentWithoutPi=-1/4, expression(\"-\"+Modulus+\"/sqrt(2)\"),\n if(ArgumentWithoutPi=-1/2, expression(\"-\"+Modulus),\n if(ArgumentWithoutPi=-3/4, expression(\"-\"+Modulus+\"/sqrt(2)\"),\n if(ArgumentWithoutPi=-1, expression(\"0\"),\nexpression(\"0\")))))))))", "description": "", "templateType": "anything", "can_override": false}, "Ans": {"name": "Ans", "group": "Ungrouped variables", "definition": "simplify(expression(Modulus+\"e^(i*\"+ArgumentWithoutPi+\"*pi)\"),[\"all\",\"!otherNumbers\"])", "description": "", "templateType": "anything", "can_override": false}, "AdviceIfbIs0": {"name": "AdviceIfbIs0", "group": "Ungrouped variables", "definition": "\"

We cannot divide by 0 but if the $b$ part of $a+bi$ is 0 it means the argument is either 0 if $a$ is positive or $\\\\pi$ if $a$ is negative. Hence the argument of $\\\\simplify[basic,zeroFactor,zeroTerm]{{a}+{b}i}$ is $\\\\simplify[!all,fractionNumbers]{{ArgumentWithoutPi}pi}$.

\"", "description": "", "templateType": "long string", "can_override": false}, "AdviceIfbIsNot0": {"name": "AdviceIfbIsNot0", "group": "Ungrouped variables", "definition": "\"

Hence, the argument of $\\\\simplify[basic,zeroFactor,zeroTerm]{{a}+{b}i}$ is

\\n

\\\\[\\\\tan^{-1}\\\\left(\\\\var{a}\\\\div\\\\var{b}\\\\right)=\\\\simplify[fractionNumbers,!all]{{ArgumentWithoutPi}pi}.\\\\]

\"", "description": "", "templateType": "long string", "can_override": false}, "AdviceToAdd": {"name": "AdviceToAdd", "group": "Ungrouped variables", "definition": "if(b=expression(\"0\"),AdviceIfbIs0,AdviceIfbIsNot0)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "ArgumentWithoutPi<>-1", "maxRuns": 100}, "ungrouped_variables": ["Modulus", "ArgumentWithoutPi", "a", "b", "Ans", "AdviceIfbIs0", "AdviceIfbIsNot0", "AdviceToAdd"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"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": "{Ans}", "answerSimplification": "basic", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": true, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "mustmatchpattern": {"pattern": "($n`? `: 1)*e^(((`*/ `+- $n)`*;x)*i)", "partialCredit": 0, "message": "", "nameToCompare": "", "warningTime": "submission"}, "valuegenerators": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "showAllParts": false, "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}], "resources": []}]}], "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}]}