text: # WeBWorK problem written by Alex Jordan 
  # Portland Community College
  # ENDDESCRIPTION
  
  ## DBsubject(Algebra)
  ## DBchapter(Functions)
  ## DBsection(Exponential)
  ## Institution(PCC)
  ## Author(Alex Jordan)
  ## MO(1)
  
  
  
  ##############################################
  
  DOCUMENT();
  
  loadMacros(
    "PGstandard.pl",
    "MathObjects.pl",
    "parserAssignment.pl",
    "PGML.pl",
    "PGcourse.pl",
  
  );
  
  
  TEXT(beginproblem());
  
  ##############################################
  
  
  Context("Numeric");
  Context()->flags->set(reduceConstants=>0);
  parser::Assignment->Allow;
  
  $a = random(1,100,1);
  $b = random(1.01,1.8,0.001);
  $c = 2*$a+10;
  
  
  $ans = ln($c/$a)/ln($b);
  
  $ans = Formula("x=$ans");
  
  
  
  ##############################################
  
  BEGIN_PGML
  
  Solve the equation by using logarithms.  Remember, when solving an equation for [`x`], your answer should be in the form *x=...*.  When exponents are involved, it becomes very important to be precise.  Use at least four significant digits in your answers.
  
      [`[$a]([$b])^{x}=[$c]`]
  
      [____________________]
  
  
  END_PGML
  
  ##############################################
  
  $showPartialCorrectAnswers = 1;
  
  Context()->flags->set(formatStudentAnswers=>parsed);
  
  ANS($ans->cmp);
  
  ##############################################
  
  BEGIN_PGML_SOLUTION
  
  We can being by applying [`\log`] to both sides:
  
      [`\begin{aligned}
  [$a]([$b])^{x}&=[$c]\\
  \log\left([$a]([$b])^{x}\right)&=\log([$c])\\
  \log([$a])+\log\left([$b]^{x}\right)&=\log([$c])\\
  \log([$a])+x\log([$b])&=\log([$c])\\
  x\log([$b])&=\log([$c])-\log([$a])\\
  x&=\frac{\log([$c])-\log([$a])}{\log([$b])}\\
  x&\approx[@(log($c)-log($a))/log($b)@]
  \end{aligned}`]
  
  END_PGML_SOLUTION
  
  ENDDOCUMENT();