// Numbas version: exam_results_page_options {"name": "Solve for x in equation with subtraction of logs", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Solve for x in equation with subtraction of logs", "tags": [], "metadata": {"description": "

Given an equation with log terms added together, the student must solve for x. Hints are included in the question to aid the student as needed.

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

Solve for $x$ in the following equation, rounding your answer to $\\var{decimal_places}$ decimal place(s):

\n

\\[ \\log_{\\var{base}}(\\var{a}x+\\var{b}) - \\log_{\\var{base}}(\\simplify{{c}x+{n*d}}) = \\var{f} \\]

", "advice": "

Beginning with the equation given:

\n

\n

\\[ \\log_{\\var{base}}(\\var{a}x+\\var{b}) - \\log_{\\var{base}}(\\simplify{{c}x+{n*d}}) = \\var{f} ,\\]

\n

\n

note the following rule of logs that allows us to convert between the log of a quotient and the subtraction of two separate log terms:

\n

\n\n\n\n\n\n\n
\\[ \\begin{align*} \\log_a \\left( \\frac{x}{y} \\right) & = \\log_a x - \\log_a y\\\\ \\\\ \\text{e.g., } \\log_3 \\left( \\frac{x}{9} \\right) & = \\log_3 (x) - \\log_3 (9) \\end{align*}  \\]
\n

\n

Remember, we can go from left to right or from right to left with this rule. The important thing is that the $\\textbf{BASE}$ is the same in the two log terms we are subtracting.

\n

\n

\n

Applying this to the left-hand side of the equation above:

\n

$\\begin{align*} \\underbrace{\\color{black}{\\log_{\\var{base}}(\\var{a}x+\\var{b}) - \\log_{\\var{base}}(\\simplify{{c}x+{n*d}})}} &= \\var{f}\\\\ \\searrow \\\\ & \\log_{\\var{base}}(\\var{a}x+\\var{b}) - \\log_{\\var{base}}(\\simplify{{c}x+{n*d}}) =\\log_{\\var{base}} \\left(\\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right) \\end{align*}$ 

\n

\n

In other words,

\n

\\[ \\log_{\\var{base}}\\left(\\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right)= \\var{f} \\]

\n

\n

Next, note the following rule of logs that allows us to cancel a base and a log to the same base:

\n

\n\n\n\n\n\n\n
\\[ \\begin{align*} a^{\\log_a (x)} & = x\\\\ \\\\ \\text{e.g., } 3^{\\log_3 (7)} & = 7 \\end{align*}  \\]
\n

\n

Therefore, to cancel out the $\\textbf{LOG}$ to base $\\var{base}$, we must take both sides as a $\\textbf{POWER}$ on $\\var{base}$:

\n

\n

\\[ \\begin{align*}\\log_{\\var{base}} \\left( \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right) & = \\var{f}\\\\ \\phantom{.}^{\\var{base}^{(\\ \\ \\ )}} \\bigg\\downarrow  &  \\hspace{0.5cm}  \\bigg\\downarrow \\phantom{.}^{\\var{base}^{(\\ \\ \\ )}} \\\\ \\var{base}^{\\log_{\\var{base}} \\left( \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} \\right)} & = \\var{base}^{\\var{f}} \\end{align*}\\]

\n

\n

\n

We can now use rule of logs mentioned above to cancel the $\\log_{\\var{base}}$ with the base $\\var{base}$ on the left-hand side:

\n

\\[ \\begin{align*} \\var{base}^{\\log_{\\var{base}} \\left( \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right)} & = \\var{base}^{\\var{f}} \\\\ \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} & = \\var{base}^{\\var{f}} \\end{align*} \\]

\n

\n

In other words,

\n

\\[ \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} = \\simplify{{base}^{f}} \\]

\n

\n

We can now get rid of the fraction by $\\textbf{MULTIPLYING}$ both sides by the denominator $\\simplify{{c}x+{n*d}}$:

\n

\n

\\[ \\begin{align*} \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} \\cdot (\\simplify{{c}x+{n*d}}) & =  \\simplify{{base}^{f}} \\cdot (\\simplify{{c}x+{n*d}})\\\\ \\var{a}x+\\var{b} & = \\simplify{{base}^{f}} \\cdot (\\simplify{{c}x+{n*d}}) \\end{align*} \\]

\n

\n

Now let's $\\textbf{MULTIPLY OUT}$ the brackets on the right-hand side:

\n

\n

\\[ \\var{a}x+\\var{b} = \\simplify{{base}^{f}*{c}*x+{base}^{f}*{n*d}} \\]

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
PLAN: 
Group all $x$-terms on one side
and all number terms on the other side.
BE VERY CAREFUL WITH THE SIGNS HERE!
\n

\n

\\[ \\begin{align*} \\simplify[!noLeadingMinus,unitFactor]{{a}*x-{{base}^{f}*{c}}*x} &= \\simplify[!noLeadingMinus]{{{base}^{f}*{n*d}}-{b}}\\\\ \\simplify[unitFactor]{{a-base^f*c}*x} & = \\simplify{{base^f*n*d-b}}\\\\ \\\\ \\text{Now, if there is a number in front of } & x, \\text{ we can divide both sides by this number to get: }\\\\ \\\\ x & = \\frac{\\var{numerator}}{\\var{denominator}}\\\\ & \\hspace{-1cm}\\phantom{.}^{\\text{Calculator work}} \\bigg\\downarrow\\\\ x &= \\var{ans} \\end{align*} \\]

\n

\n

$\\textbf{Want some more practice? Click the \"Try another question like this one\" button at the end of the question.}$

\n

\n

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"base": {"name": "base", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "

Base of log terms in the equation.

", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2..6)", "description": "

Multiple for x in the first log term.

", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1..8)", "description": "

Integer to be added to x in the first log term.

", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(2..9 except a)", "description": "

Multiple for x in the second log term.

", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(-1,1)", "description": "

Multiplier to assign random sign to the variable d.

", "templateType": "anything", "can_override": false}, "x": {"name": "x", "group": "Ungrouped variables", "definition": "(g*n*d-b)/(a-g*c)", "description": "

Variable the student must solve for.

", "templateType": "anything", "can_override": false}, "decimal_places": {"name": "decimal_places", "group": "Ungrouped variables", "definition": "random(1..3)", "description": "

Number of decimal places the student must round their answer to.

", "templateType": "anything", "can_override": false}, "numerator": {"name": "numerator", "group": "Ungrouped variables", "definition": "g*n*d-b", "description": "

Numerator of fraction in the second last line of the solution.

", "templateType": "anything", "can_override": false}, "denominator": {"name": "denominator", "group": "Ungrouped variables", "definition": "a-g*c", "description": "

Denominator of fraction in the second last line of the solution.

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(1..5 except b)", "description": "

Integer to be added to or subtracted from x in the second log term.

", "templateType": "anything", "can_override": false}, "f": {"name": "f", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "

Difference between the two log terms in the equation.

", "templateType": "anything", "can_override": false}, "g": {"name": "g", "group": "Ungrouped variables", "definition": "base^f", "description": "", "templateType": "anything", "can_override": false}, "ans": {"name": "ans", "group": "Ungrouped variables", "definition": "precround(x,decimal_places)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "a*x+b>0 and c*x+n*d>0", "maxRuns": 100}, "ungrouped_variables": ["base", "a", "b", "c", "d", "f", "g", "n", "decimal_places", "x", "numerator", "denominator", "ans"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Solve for $x$", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Hint 1 - how to start", "rawLabel": "", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Hint 2 - a little more help", "rawLabel": "", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Hint 3 - finishing the question", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

See if you can start the question by yourself first. If you need a hint, click on \"Hint 1 - how to start\" below.

\n

Don't forget to round your answer to $\\var{decimal_places}$ decimal place(s).

\n

$x = $ [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "studentNumber (The student's answer, parsed as a number):\n if(settings[\"allowFractions\"],\n parsedecimal_or_fraction(studentAnswer,settings[\"notationStyles\"])\n ,\n parsedecimal(studentAnswer,settings[\"notationStyles\"])\n )\n\nisInteger (Is the student's answer an integer?):\n countDP(studentAnswer)=0\n\nisFraction (Is the student's answer a fraction?):\n \"/\" in studentAnswer\n\nnumerator (The numerator of the student's answer, or 0 if not a fraction):\n if(isFraction,\n parseNumber(split(studentAnswer,\"/\")[0],settings[\"notationStyles\"])\n ,\n 0\n )\n\ndenominator (The numerator of the student's answer, or 0 if not a fraction):\n if(isFraction,\n parseNumber(split(studentAnswer,\"/\")[1],settings[\"notationStyles\"])\n ,\n 0\n )\n\ncancelled (Is the student's answer a cancelled fraction?):\n assert(isFraction and gcd(numerator,denominator)=1,\n assert(not settings[\"mustBeReduced\"],\n multiply_credit(settings[\"mustBeReducedPC\"],translate(\"part.numberentry.answer not reduced\"))\n );\n false\n )\n\ncleanedStudentAnswer:\n cleannumber(studentAnswer, settings[\"notationStyles\"])\n\nstudentPrecision:\n switch(\n settings[\"precisionType\"]=\"dp\", max(settings[\"precision\"],countDP(cleanedStudentAnswer)),\n settings[\"precisionType\"]=\"sigfig\", max(settings[\"precision\"],countsigfigs(cleanedStudentAnswer)),\n 0\n )\n\nraw_minvalue:\n switch(\n settings[\"precisionType\"]=\"dp\", precround(settings[\"minvalue\"],studentPrecision),\n settings[\"precisionType\"]=\"sigfig\", siground(settings[\"minvalue\"],studentPrecision),\n settings[\"minvalue\"]\n )\n\nraw_maxvalue:\n switch(\n settings[\"precisionType\"]=\"dp\", precround(settings[\"maxvalue\"],studentPrecision),\n settings[\"precisionType\"]=\"sigfig\", siground(settings[\"maxvalue\"],studentPrecision),\n settings[\"maxvalue\"]\n )\n\nminvalue: min(raw_minvalue,raw_maxvalue)\n\nmaxvalue: max(raw_minvalue,raw_maxvalue)\n\nvalidNumber (Is the student's answer a valid number?):\n if(isNaN(studentNumber),\n warn(translate(\"part.numberentry.answer invalid\"));\n fail(translate(\"part.numberentry.answer invalid\"))\n ,\n true\n )\n\nnumberInRange (Is the student's number in the allowed range?):\n if(studentNumber>=minvalue and studentNumber<=maxvalue,\n correct(\"Well done! For some more practice, click on the $``$Try another question like this one$\\\"$ button at the end of the question.\")\n ,\n incorrect(\"Not there yet. Have you looked at the hints provided below?\");\n end()\n )\n\ncorrectPrecision (Has the student's answer been given to the desired precision?): \n if(togivenprecision(cleanedStudentAnswer,settings['precisionType'],settings['precision'],settings[\"strictPrecision\"]),\n true\n ,\n multiply_credit(settings[\"precisionPC\"],settings[\"precisionMessage\"]);\n false\n )\n\nmark (Mark the student's answer):\n apply(validNumber);\n apply(numberInRange);\n assert(numberInRange,end());\n if(isFraction,\n apply(cancelled)\n ,\n apply(correctPrecision)\n )\n \ninterpreted_answer (The student's answer, to be reused by other parts):\n apply(validNumber);\n studentNumber\n", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Solve for $x$", "minValue": "{ans}", "maxValue": "{ans}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "information", "useCustomName": true, "customName": "Hint 1 - how to start", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Hint 2 - a little more help", "rawLabel": "", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Hint 3 - finishing the question", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Beginning with the equation given:

\n

\n

\\[ \\log_{\\var{base}}(\\var{a}x+\\var{b}) - \\log_{\\var{base}}(\\simplify{{c}x+{n*d}}) = \\var{f} ,\\]

\n

\n

note the following rule of logs that allows us to convert between the log of a quotient and the subtraction of two separate log terms:

\n

\n\n\n\n\n\n\n
\\[ \\begin{align*} \\log_a \\left( \\frac{x}{y} \\right) & = \\log_a x - \\log_a y\\\\ \\\\ \\text{e.g., } \\log_3 \\left( \\frac{x}{9} \\right) & = \\log_3 (x) - \\log_3 (9) \\end{align*}  \\]
\n

\n

Remember, we can go from left to right or from right to left with this rule. The important thing is that the $\\textbf{BASE}$ is the same in the two log terms we are subtracting.

\n

\n

\n

Applying this to the left-hand side of the equation above:

\n

$\\begin{align*} \\underbrace{\\color{black}{\\log_{\\var{base}}(\\var{a}x+\\var{b}) - \\log_{\\var{base}}(\\simplify{{c}x+{n*d}})}} &= \\var{f}\\\\ \\searrow \\\\ & \\log_{\\var{base}}(\\var{a}x+\\var{b}) - \\log_{\\var{base}}(\\simplify{{c}x+{n*d}}) =\\log_{\\var{base}} \\left(\\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right) \\end{align*}$ 

\n

\n

In other words,

\n

\\[ \\log_{\\var{base}}\\left(\\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right)= \\var{f} \\]

\n

\n

Can you think about how you might use another rule of logs to tidy up the left-hand side a little more? To continue on with the question yourself, click \"Go back to the previous part\" below or select \"Solve for $x$\" in the question progress bar at the top of the question. Otherwise, if you need some more help with this part, click \"Hint 2 - a little more help\" below.

"}, {"type": "information", "useCustomName": true, "customName": "Hint 2 - a little more help", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Hint 1 - how to start", "rawLabel": "", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Hint 3 - finishing the question", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

We have now simplified the left-hand side a little bit and our equation now looks like:

\n

\\[ \\log_{\\var{base}}\\left(\\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right)= \\var{f} \\]

\n

Next, note the following rule of logs that allows us to cancel a base and a log to the same base:

\n

\n\n\n\n\n\n\n
\\[ \\begin{align*} a^{\\log_a (x)} & = x\\\\ \\\\ \\text{e.g., } 3^{\\log_3 (7)} & = 7 \\end{align*}  \\]
\n

\n

Therefore, to cancel out the $\\textbf{LOG}$ to base $\\var{base}$, we must take both sides as a $\\textbf{POWER}$ on $\\var{base}$:

\n

\n

\\[ \\begin{align*}\\log_{\\var{base}} \\left( \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right) & = \\var{f}\\\\ \\phantom{.}^{\\var{base}^{(\\ \\ \\ )}} \\bigg\\downarrow  &  \\hspace{0.5cm}  \\bigg\\downarrow \\phantom{.}^{\\var{base}^{(\\ \\ \\ )}} \\\\ \\var{base}^{\\log_{\\var{base}} \\left( \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} \\right)} & = \\var{base}^{\\var{f}} \\end{align*}\\]

\n

\n

\n

We can now use rule of logs mentioned above to cancel the $\\log_{\\var{base}}$ with the base $\\var{base}$ on the left-hand side:

\n

\\[ \\begin{align*} \\var{base}^{\\log_{\\var{base}} \\left( \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}}\\right)} & = \\var{base}^{\\var{f}} \\\\ \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} & = \\var{base}^{\\var{f}} \\end{align*} \\]

\n

\n

In other words,

\n

\\[ \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} = \\simplify{{base}^{f}} \\]

\n

We now have a much more straightforward equation that no longer involves logs. Can you now solve this equation for $x$? To continue on with the question yourself, click \"Solve for $x$\" in the question progress bar at the top of the question. Otherwise, if you need some help finishing the question, click \"Hint 3 - finishing the question\" below.

"}, {"type": "information", "useCustomName": true, "customName": "Hint 3 - finishing the question", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Our equation now looks like:

\n

\\[ \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} = \\simplify{{base}^{f}} \\]

\n

\n

We can now get rid of the fraction by $\\textbf{MULTIPLYING}$ both sides by the denominator $\\simplify{{c}x+{n*d}}$:

\n

\n

\\[ \\begin{align*} \\frac{\\var{a}x+\\var{b}}{\\simplify{{c}x+{n*d}}} \\cdot (\\simplify{{c}x+{n*d}}) & =  \\simplify{{base}^{f}} \\cdot (\\simplify{{c}x+{n*d}})\\\\ \\var{a}x+\\var{b} & = \\simplify{{base}^{f}} \\cdot (\\simplify{{c}x+{n*d}}) \\end{align*} \\]

\n

\n

Now let's $\\textbf{MULTIPLY OUT}$ the brackets on the right-hand side:

\n

\n

\\[ \\var{a}x+\\var{b} = \\simplify{{base}^{f}*{c}*x+{base}^{f}*{n*d}} \\]

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
PLAN: 
Group all $x$-terms on one side
and all number terms on the other side.
BE VERY CAREFUL WITH THE SIGNS HERE!
\n

\n

\\[ \\begin{align*} \\simplify[!noLeadingMinus,unitFactor]{{a}*x-{{base}^{f}*{c}}*x} &= \\simplify[!noLeadingMinus]{{{base}^{f}*{n*d}}-{b}}\\\\ \\simplify[unitFactor]{{a-base^f*c}*x} & = \\simplify{{base^f*n*d-b}}\\\\ \\\\ \\text{Now, if there is a number in front of } & x, \\text{ we can divide both sides by this number to get: }\\\\ \\\\ x & = \\frac{\\var{numerator}}{\\var{denominator}}\\\\ & \\hspace{-1cm}\\phantom{.}^{\\text{Calculator work}} \\bigg\\downarrow\\\\ x &= \\var{ans} \\end{align*} \\]

\n

\n

$\\textbf{Want some more practice? Click the \"Try another question like this one\" button at the end of the question.}$

"}], "partsMode": "explore", "maxMarks": "2", "objectives": [{"name": "Solve for $x$", "limit": "2"}], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}]}]}], "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}]}