// Numbas version: exam_results_page_options {"name": "Simon's copy of Logarithms: Solving equations 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "name": "Simon's copy of Logarithms: Solving equations 2", "tags": [], "variablesTest": {"condition": "", "maxRuns": 100}, "functions": {}, "extensions": [], "preamble": {"css": "", "js": ""}, "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}})$ which is OK.

\n

Substituting this value for $x$ into $\\log_{\\var{a}}(\\simplify{x+{c}})$ we get $\\log_{\\var{a}}(\\simplify{{4*a^d}})$ which is 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}})$ which is NOT OK (we cannot take logs of a negative number)

\n

Substituting this value for $x$ into $\\log_{\\var{a}}(\\simplify{x+{c}})$ we get $\\log_{\\var{a}}(\\simplify{{a^d}})$ which is 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}$.

", "variables": {"sol2": {"group": "Ungrouped variables", "name": "sol2", "description": "", "templateType": "anything", "definition": "-c+a^d"}, "sol1": {"group": "Ungrouped variables", "name": "sol1", "description": "", "templateType": "anything", "definition": "c-2*b"}, "c": {"group": "Ungrouped variables", "name": "c", "description": "", "templateType": "anything", "definition": "b+2*a^(d)"}, "d": {"group": "Ungrouped variables", "name": "d", "description": "", "templateType": "anything", "definition": "random(1,2)"}, "b": {"group": "Ungrouped variables", "name": "b", "description": "", "templateType": "anything", "definition": "s*random(1..20)"}, "s": {"group": "Ungrouped variables", "name": "s", "description": "", "templateType": "anything", "definition": "random(1,-1)"}, "a": {"group": "Ungrouped variables", "name": "a", "description": "", "templateType": "anything", "definition": "random(2,3)"}}, "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers"]}, "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 ", "parts": [{"sortAnswers": false, "scripts": {}, "gaps": [{"answer": "{sol1}", "vsetRangePoints": 5, "scripts": {}, "checkingType": "absdiff", "showPreview": true, "customMarkingAlgorithm": "", "answerSimplification": "std", "notallowed": {"showStrings": false, "strings": ["."], "partialCredit": 0, "message": "

Input as an integer, not as a decimal.

"}, "unitTests": [], "showCorrectAnswer": true, "expectedVariableNames": [], "vsetRange": [0, 1], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "jme", "checkVariableNames": false, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": "3", "checkingAccuracy": 0.0001, "failureRate": 1}], "stepsPenalty": 1, "customMarkingAlgorithm": "", "steps": [{"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$.

", "extendBaseMarkingAlgorithm": true, "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "type": "information", "variableReplacements": [], "marks": 0, "unitTests": [], "showCorrectAnswer": true}], "unitTests": [], "showCorrectAnswer": true, "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 ", "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}], "ungrouped_variables": ["a", "c", "b", "d", "s", "sol2", "sol1"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "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"}, "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}