// Numbas version: exam_results_page_options {"name": "Logarithms: Solving equations 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"js": "", "css": ""}, "ungrouped_variables": ["a", "c", "b", "d", "s", "sol2", "sol1"], "advice": "

We use the following rules for logs:

\n

1. $\\log_a(x^q)=q\\log_a(x)$

\n

2. $\\log_a(\\frac{x}{y})=\\log_a(x)-\\log_a(y)$

\n

3. $a^x=y \\iff \\log_a y=x$

\n

Using rule 1 we get
\\[2\\log_{\\var{a}}(\\simplify{x+{b}})- \\log_{\\var{a}}(\\simplify{(x+{c})})=\\log_{\\var{a}}((\\simplify{x+{b}})^2)- \\log_{\\var{a}}(\\simplify{(x+{c})})\\]
Using rule 2 gives
\\[\\log_{\\var{a}}(\\simplify{(x+{b})^2})- \\log_{\\var{a}}(\\simplify{(x+{c})})=\\log_{\\var{a}}\\left(\\simplify{(x+{b})^2/(x+{c})}\\right)\\]
So the equation to solve becomes:
\\[\\log_{\\var{a}}\\left(\\simplify{(x+{b})^2/(x+{c})}\\right)=\\var{d}\\]
and using rule 3 this gives:
\\[ \\begin{eqnarray} \\simplify{(x+{b})^2/(x+{c})}&=&{\\var{a}}^{\\var{d}}\\Rightarrow\\\\ \\simplify{(x+{b})^2}&=&{\\var{a}}^{\\var{d}}(\\simplify{x+{c}})=\\simplify{{a^d}(x+{c})}\\Rightarrow\\\\ \\simplify{x^2+{2*b-a^(d)}x+{b^2-a^(d)*c}}&=&0 \\end{eqnarray} \\]
Solving this quadratic we get two solutions:

\n

$x=\\var{sol1}$ and $x=\\var{sol2}$

\n

We should check that these solutions gives positive values for $\\simplify{x+{b}}$ and $\\simplify{x+{c}}$ as otherwise the logs are not defined.

\n

The value $x=\\var{sol1}$ gives: 

\n

Substituting this value for $x$ into $\\log_{\\var{a}}(\\simplify{x+{b}})$ we get $\\log_{\\var{a}}(\\simplify{{2*a^d}})$ so OK.

\n

Substituting this value for $x$ into $\\log_{\\var{a}}(\\simplify{x+{c}})$ we get $\\log_{\\var{a}}(\\simplify{{4*a^d}})$ so OK.

\n

Hence $x=\\var{sol1}$ is a solution to our original equation.

\n

The value $x=\\var{sol2}$ gives:

\n

Substituting this value for $x$ into $\\log_{\\var{a}}(\\simplify{x+{b}})$ we get $\\log_{\\var{a}}(\\simplify{{-a^d}})$ so NOT OK.

\n

Substituting this value for $x$ into $\\log_{\\var{a}}(\\simplify{x+{c}})$ we get $\\log_{\\var{a}}(\\simplify{{a^d}})$ so OK.

\n

Hence $x=\\var{sol2}$ is NOT a solution to our original equation as $\\log_{\\var{a}}(\\simplify{x+{b}})$ is not defined for this value of $x$.

\n

So there is only one solution $x=\\var{sol1}$.

", "metadata": {"description": "\n \t\t

Solve for $x$: $\\displaystyle 2\\log_{a}(x+b)- \\log_{a}(x+c)=d$. 

\n \t\t

Make sure that your choice is a solution by substituting back into the equation.

\n \t\t", "licence": "Creative Commons Attribution 4.0 International"}, "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"customName": "", "stepsPenalty": 1, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "customMarkingAlgorithm": "", "scripts": {}, "showFeedbackIcon": true, "steps": [{"customName": "", "variableReplacementStrategy": "originalfirst", "type": "information", "customMarkingAlgorithm": "", "scripts": {}, "showFeedbackIcon": true, "useCustomName": false, "variableReplacements": [], "prompt": "

Three rules for logs should be used:

\n

1. $\\log_a(x^q)=q\\log_a(x)$

\n

2. $\\log_a(\\frac{x}{y})=\\log_a(x)-\\log_a(y)$

\n

3. $a^x=y \\iff \\log_a y=x$

\n

So use rule 1 followed by rules 2 and 3 to get an equation for $x$.

", "unitTests": [], "showCorrectAnswer": true, "marks": 0, "extendBaseMarkingAlgorithm": true}], "useCustomName": false, "variableReplacements": [], "prompt": "\n

\\[2\\log_{\\var{a}}(\\simplify{x+{b}})- \\log_{\\var{a}}(\\simplify{(x+{c})})=\\var{d}\\]

\n

$x=\\;$ [[0]].

\n

If you want help in solving the equation, click on Show steps. If you do so then you will lose 1 mark.

\n

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

\n ", "unitTests": [], "gaps": [{"notallowed": {"strings": ["."], "message": "

Input as an integer, not as a decimal.

", "partialCredit": 0, "showStrings": false}, "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "customMarkingAlgorithm": "", "type": "jme", "showFeedbackIcon": true, "useCustomName": false, "checkingAccuracy": 0.0001, "vsetRangePoints": 5, "showCorrectAnswer": true, "marks": 2, "checkVariableNames": false, "valuegenerators": [], "customName": "", "answer": "{sol1}", "showPreview": true, "scripts": {}, "variableReplacements": [], "unitTests": [], "vsetRange": [0, 1], "extendBaseMarkingAlgorithm": true, "failureRate": 1, "answerSimplification": "std"}], "showCorrectAnswer": true, "marks": 0, "extendBaseMarkingAlgorithm": true, "sortAnswers": false}], "tags": [], "statement": "\n

Solve the following equation for $x$.

\n

Input your answer as a fraction or an integer as appropriate and not as a decimal.

\n ", "variables": {"c": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "b+2*a^(d)", "name": "c"}, "sol2": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "-c+a^d", "name": "sol2"}, "d": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(1,2)", "name": "d"}, "b": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "s*random(1..20)", "name": "b"}, "a": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(2,3)", "name": "a"}, "sol1": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "c-2*b", "name": "sol1"}, "s": {"templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(1,-1)", "name": "s"}}, "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers"]}, "functions": {}, "extensions": [], "name": "Logarithms: Solving equations 2", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}