# Integrating WeBWorK into Textbooks: Sample Exercises

## Section1.4Antidifferentiation

### Subsection1.4.1A Few More Features

This subsection demonstrates a few more features.

#### Definition1.4.1.Antiderivative of a Function.

Suppose that $$f(x)$$ and $$F(x)$$ are two functions such that
\begin{equation*} F^\prime(x) = f(x). \end{equation*}
Then we say $$F$$ is an antiderivative of $$f\text{.}$$
The Fundamental Theorem of Calculus in one of the high points of a course in single-variable course.

#### Proof.

We state an equivalent version of the FTC, which is less-suited for computation, but which perhaps is a more interesting theoretical statement.

#### Proof.

We simply take the indicated derivative, applying Theorem 1.4.2 at (1.4.2).
\begin{align} \frac{d}{dx}\definiteintegral{a}{x}{f(t)}{t}&=\frac{d}{dx}\left(F(x)-F(a)\right)\tag{1.4.2}\\ &=\frac{d}{dx}F(x)-\frac{d}{dx}F(a)\notag\\ &=f(x)-0 = f(x)\tag{1.4.3} \end{align}

### Exercises1.4.2WeBWorK Exercises

The first problem in this list is coming from the WeBWorK Open Problem Library. One implication of this is that we might want to provide some commentary that connects the problem to the text. The other two ask for essay answers, which would be graded by an instructor, so in the HTML output there is no opportunity to provide an answer.

#### 1.Antiderivatives.

Consult Definition 1.4.1 and the The Fundamental Theorem of Calculus to assist you with the following problem.
$$\displaystyle \int_0^{5} (4 e^x+5 \sin x)\, dx$$ =
$$593.23432548299$$
Solution.
SOLUTION
\begin{equation*} \begin{array}{rcl} \displaystyle \int_0^{5} (4 e^x+5 \sin x)\, dx \amp =\amp \displaystyle 4 e^x-5 \cos x \Big]_0^{5} \\ \amp =\amp (4 e^{5} - 5 \cos 5) - (4 e^0 - 5 \cos0 ) \\ \amp =\amp 4 e^{5} - 5 \cos 5 + 1 \end{array} \end{equation*}
Unless the OPL has changed this problem out from under us, note the “SOLUTION” appearing in the solution. That is hard-coded into the OPL version of the problem. This is an example of something undesirable that may happen when using OPL problems that were not originally written with PreTeXt in mind.

#### 2.Every Continuous Function has an Antiderivative.

WeBWorK problems can allow for open-ended essay responses that are intended to be assessed later by the instructor. For anonymous access, no text field is provided. But if this problem were used within WeBWorK as part of a homework set, users could submit an answer.
Explain how we can use Corollary 1.4.3 to say that every continuous function always has a derivative. (And we will demonstrate here that you can use a macro from docinfo: $$\definiteintegral{1}{2}{\frac{1}{x}}{x}=\ln(2)\text{.}$$ It will work in the WeBWorK problem, regardless of whether you are using images, MathJax, or hardcopy.)

#### 3.Inverse Processes.

“Differentiation and integration are inverse processes.” Cite specific results from this section in an explanation of how they justify this (somewhat imprecise) claim.

#### Exercise Group.

For the given function $$f\text{,}$$ find $$\indefiniteintegral{f(x)}{x}\text{.}$$
Note that these common instructions are phrased in such a way that they would read well if they were applied to only one exercise at a time. That will happen if these exercises are exported as .pg files, for example to be used in online homework from a WeBWorK server.
##### 4.
$$f(x)=\sin(x)$$
$$-\cos\!\left(x\right)+C$$
##### 5.
$$f(x)=e^x$$
$$e^{x}+C$$
Sometimes you would like a student to give a “simple” answer that WeBWorK can automatically assess, but you would also like the student to show their work or reasoning. Perhaps there is a particular method that you want to see the student use to find the answer. So you have a regular answer blank and also an essay blank. For practical reasons, you may wish to use the same problem on your WeBWorK server, but omit the essay part. For example, if you want to use that problem but leave out the manual grading. For this, WeBWorK has the explanation_box tool, demonstrated here.
Use the definition of the derivative to find $$\frac{d}{dx}x^2\text{.}$$
$$2x$$