// Numbas version: exam_results_page_options {"name": "Solve an equation in logarithms", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

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

\n

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

"}, "preamble": {"css": "", "js": ""}, "advice": "

We use the following three rules for logs :

\n

1. $n\\log_a(m)=\\log_a(m^n)$

\n

2. $\\log_a(b)-\\log_a(c)=\\log_a(b/c)$

\n

3. $\\log_a(p)=r \\Rightarrow p=a^r$

\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}$.

", "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers"]}, "extensions": [], "name": "Solve an equation in logarithms", "ungrouped_variables": ["a", "c", "b", "d", "s", "sol2", "sol1"], "functions": {}, "tags": [], "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "variables": {"b": {"name": "b", "group": "Ungrouped variables", "definition": "s*random(1..8)", "description": "", "templateType": "anything"}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(1,-1)", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2,3)", "description": "", "templateType": "anything"}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(1,2)", "description": "", "templateType": "anything"}, "sol1": {"name": "sol1", "group": "Ungrouped variables", "definition": "c-2*b", "description": "", "templateType": "anything"}, "sol2": {"name": "sol2", "group": "Ungrouped variables", "definition": "-c+a^d", "description": "", "templateType": "anything"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "b+2*a^(d)", "description": "", "templateType": "anything"}}, "statement": "

Solve the following equation for $x$.

\n

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

", "parts": [{"customName": "", "type": "gapfill", "customMarkingAlgorithm": "", "steps": [{"customName": "", "type": "information", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "marks": 0, "showFeedbackIcon": true, "prompt": "

Three rules for logs should be used:

\n

1. $n\\log_a(m)=\\log_a(m^n)$

\n

2. $\\log_a(b)-\\log_a(c)=\\log_a(b/c)$

\n

3. $\\log_a(p)=r \\Rightarrow p=a^r$

\n

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

", "scripts": {}, "useCustomName": false, "showCorrectAnswer": true, "unitTests": [], "variableReplacements": [], "extendBaseMarkingAlgorithm": true}], "variableReplacementStrategy": "originalfirst", "marks": 0, "showFeedbackIcon": true, "gaps": [{"customName": "", "type": "jme", "vsetRangePoints": 5, "answer": "{sol1}", "showFeedbackIcon": true, "failureRate": 1, "checkingType": "absdiff", "checkVariableNames": false, "notallowed": {"showStrings": false, "message": "

Input as an integer, not as a decimal.

", "partialCredit": 0, "strings": ["."]}, "showCorrectAnswer": true, "useCustomName": false, "customMarkingAlgorithm": "", "answerSimplification": "std", "variableReplacementStrategy": "originalfirst", "marks": 2, "valuegenerators": [], "checkingAccuracy": 0.0001, "scripts": {}, "extendBaseMarkingAlgorithm": true, "showPreview": true, "unitTests": [], "variableReplacements": [], "vsetRange": [0, 1]}], "sortAnswers": false, "prompt": "

\\[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.

", "scripts": {}, "useCustomName": false, "stepsPenalty": 1, "showCorrectAnswer": true, "unitTests": [], "variableReplacements": [], "extendBaseMarkingAlgorithm": true}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}