summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/lmacs/lmacs_aeb.tex
blob: 87d6bfec94e1602a40c3e46fe11b229836d8695f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
%
% This is the file webeqtst.tex that is distributed with the AeB Bundle
%
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[tight,designi]{web}  % dvipsone, dvips, pdftex, dvipdfm
\usepackage{exerquiz}

\usepackage[def=lmacs_aeb,js=lmacs_aeb]{lmacs}

\begin{document}

\maketitle

\tableofcontents


\section{Introduction}

The \textsf{lmacs} is designed to clean up the preamble of a source file.
For this file, we have
\begin{verbatim}
    \usepackage[def=lmacs_aeb,js=lmacs_aeb]{lmacs}
\end{verbatim}
The preamble definitions are in the file \texttt{lmacs\_aeb.def} and a
document JavaScript is imported with the file \texttt{lmacs\_aeb.js}.

\medskip\noindent We'll test the JavaScript first, press this button:
\pushButton[\CA{Press Me}\A{\JS{%
    makeAlert("Hooray for the lmacs package!")
}}]{alertBtn}{}{11bp}

\medskip\noindent The next section is taken from the file
\texttt{webeqtst.tex}. The problem environment is defined in the file
\texttt{lmacs\_aeb.def}, other definitions and customizations can be found
in that file.

\medskip\noindent Though I am using the \textsf{web} and \textsf{exerquiz} package, lmacs
does not require them; \textsf{lmacs} is a general purpose package for inputting
local definitions.

\section{Online Exercises}

A well-designed sequences of exercises can be of aid to the
student.  The \texttt{exercise} environment makes it easy to
produce electronic exercises.  By using the \texttt{forpaper}
option, you can also make a paper version of your exercises.

\begin{exercise}
Evaluate the integral \(\displaystyle\int x^2 e^{2x}\,dx\).
\begin{solution}
We evaluate by \texttt{integration by parts}:\normalsize
\begin{alignat*}{2}
 \int x^2 e^{2x}\,dx &
   = \tfrac12 x^2 e^{2x} - \int x e^{2x}\,dx &&\quad
           \text{$u=x^2$, $dv=e^{2x}\,dx$}\\&
   = \tfrac12 x^2 e^{2x} -
           \Bigl[\tfrac12 x e^{2x}-\int \tfrac12 e^{2x}\,dx\Bigr] &&\quad
           \text{integration by parts}\\&
   = \tfrac12 x^2 e^{2x} - \tfrac12 x e^{2x} + \tfrac12\int e^{2x}\,dx &&\quad
           \text{$u=x^2$, $dv=e^{2x}\,dx$}\\&
   = \tfrac12 x^2 e^{2x} - \tfrac12 x e^{2x} + \tfrac14 e^{2x} &&\quad
           \text{integration by parts}\\&
   = \tfrac14(2x^2-2x+1)e^{2x} &&\quad
           \text{simplify!}
\end{alignat*}
\end{solution}
\end{exercise}

In the preamble of this document, we defined a \texttt{problem}
environment with its own counter.  Here is an example of it.

\begin{problem}
Is $F(t)=\sin(t)$ an antiderivative of $f(x)=\cos(x)$?  Explain
your reasoning.
\begin{solution}
The answer is yes. The definition states that $F$ is an
antiderivative of $f$ if $F'(x)=f(x)$.  Note that
$$
       F(t)=\sin(t) \implies F'(t) = \cos(t)
$$
hence, $F(x) = \cos(x) = f(x)$.
\end{solution}
\end{problem}

\begin{problem}
Is $F(t)=\sin(t)$ an antiderivative of $f(x)=\cos(x)$?  Explain
your reasoning.
\begin{solution}
The answer is yes. The definition states that $F$ is an
antiderivative of $f$ if $F'(x)=f(x)$.  Note that
$$
       F(t)=\sin(t) \implies F'(t) = \cos(t)
$$
hence, $F(x) = \cos(x) = f(x)$.
\end{solution}
\end{problem}

\noindent By modifying the \texttt{exercise} environment, you can
also create an \texttt{example} environment.  The one defined in
the preamble of this document has no associated counter.

\begin{example}
Give an example of a set that is \textit{clopen}.
\begin{solution}
The real number line is both closed and open in the usual topology of the
real line.%
\end{solution}
\end{example}

There is a \texttt*-option with the \texttt{exercise} environment,
using it signals the presence of a multiple part exercise
question. The following exercise illustrates this option.

\begin{exercise}*\label{ex:parts}
Suppose a particle is moving along the $s$-axis, and that its position
at any time $t$ is given by $s=t^2 - 5t + 1$.
\begin{parts}
\item[h]\label{item:part} Find the velocity, $v$, of the particle at any time
$t$.
\begin{solution}
Velocity is the rate of change of position with respect to time. In
symbols:
$$
                    v = \frac{ds}{dt}
$$
For our problem, we have
$$
        v = \frac{ds}{dt} =\frac d{dt}(t^2 - 5t + 1) = 2t-5.
$$
The velocity at time $t$ is given by $\boxed{v=2t-5}$.
\end{solution}

\item Find the acceleration, $a$, of the particle at any time $t$.
\begin{solution}
Acceleration is the rate of change of velocity with respect to time.
Thus,
$$
                    a = \frac{dv}{dt}
$$
For our problem, we have
$$
        a = \frac{dv}{dt} =\frac d{dt}(2t-5)=2.
$$
The acceleration at time $t$ is constant: $\boxed{a=2}$.
\end{solution}
\end{parts}
\end{exercise}

References can be made to a particular part of an exercise; for example,
``see \hyperref[item:part]{Exercise~\ref*{ex:parts}(\ref*{item:part})}.''
Part (a) is in \textcolor{webblue}{blue}; the solutions for that part is
``hidden''.  This is a new option for the \texttt{exercise} environment.

There is now an option for listing multipart question in tabular form.
This problem style does not obey the \texttt{solutions\-after} option.

\begin{exercise}*
Simplify each of the following expressions in the complex number
system. \textit{Note}: $\bar z$ is the conjugate of $z$;
$\operatorname{Re} z$ is the real part of $z$ and
$\operatorname{Im} z$ is the imaginary part of $z$.
\begin{parts}[2]
\item $i^2$
\begin{solution} $i^2 = -1$ \end{solution}
&
\item $i^3$ \begin{solution} $i^3 = i i^2 = -i$\end{solution}
\\
\item $z+\bar z$
\begin{solution} $z+\bar z=\operatorname{Re} z$\end{solution}
&
\item[h] $1/z$
\begin{solution}
$\displaystyle\frac 1z=\frac 1z\frac{\bar z}{\bar z}=\frac z{z\bar z}=\frac z{|z|^2}$
\end{solution}
\end{parts}
\end{exercise}


\end{document}