```{r data generation, echo = FALSE, results = "hide"}
sc <- NULL
while(is.null(sc)) {
## 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)
## schoice
err1 <- a * c^(a-1) * exp(b * c)
err2 <- a * c^(a-1) * exp(b * c) + c^a * exp(b * c)
rg <- if(res < 4) c(0.5, 5.5) else res * c(0.5, 1.5)
sc <- num_to_schoice(res, wrong = c(err1, err2), range = rg, delta = 0.1)
}
sc$questions[5] <- "None of the above."
```

Question
========
What is the derivative of $f(x) = x^{`r a`} e^{`r b` x}$, evaluated at $x = `r c`$?

```{r questionlist, echo = FALSE, results = "asis"}
answerlist(sc$questions, markup = "markdown")
```

Solution
========
Using the product rule we obtain
$$ f'(x) = e^{`r b` x} \cdot (`r a` \cdot x^`r a-1` + `r b` x^`r a`). $$
Evaluated at $x = `r c`$ and rounded to two digits the answer is
$f'(`r c`) = `r fmt(res, 6)` = `r fmt(res, 2)`$.

```{r solutionlist, echo = FALSE, results = "asis"}
answerlist(ifelse(sc$solutions, "True", "False"), markup = "markdown")
```

Meta-information
================
extype: schoice
exsolution: `r mchoice2string(sc$solutions)`
exname: exp derivative
