<>= ## parameters a <- sample(2:9, 1) b <- sample(2:4, 1)/10 c <- sample(6:9, 1)/10 ## solution res <- exp(b * c) * (a * c^(a-1) + b * c^a) @ \begin{question} What is the derivative of $f(x) = x^{\Sexpr{a}} e^{\Sexpr{b} x}$, evaluated at $x = \Sexpr{c}$? \end{question} \begin{solution} Using the product rule we obtain \[ f'(x) = e^{\Sexpr{b} x} \cdot (\Sexpr{a} \cdot x^\Sexpr{a-1} + \Sexpr{b} \cdot x^\Sexpr{a}). \] Evaluated at $x = \Sexpr{c}$ and rounded to two digits the answer is $f'(\Sexpr{c}) = \Sexpr{fmt(res, 6)} \approx \Sexpr{fmt(res, 2)}$. \end{solution} \extype{num} \exsolution{\Sexpr{fmt(res, 2)}} \exname{exp derivative} \extol{0.01}