Skip to content
Binary file removed .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions javascript/latexContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export const preamble = `\\documentclass[7x10]{../mitpress/mit}
\\par%
\\vspace{12pt}%
\\noindent%
\\begin{minipage}{1.0\\linewidth}\\vspace*{-0.85\\baselineskip}\\normalcodesize\\begin{eqnarray*}}{%
\\end{eqnarray*}%
\\begin{minipage}{1.0\\linewidth}\\vspace*{-0.85\\baselineskip}\\normalcodesize\\[\\begin{array}{rcl}}{%
\\end{array}\\]%
\\end{minipage}%
\\par%
\\vspace{12pt}%
Expand Down
4 changes: 3 additions & 1 deletion xml/chapter1/section1/subsection6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,9 @@ a === 4
</SPLITINLINE>
<LATEX>
\[
\frac{5+4+\left(2-\left(3-(6+\frac{4}{5})\right)\right)}{3 (6-2) (2-7)}
\begin{array}{l}
\dfrac{5+4+\left(2-\left(3-(6+\frac{4}{5})\right)\right)}{3 (6-2) (2-7)}
\end{array}
\]
</LATEX>
<SOLUTION>
Expand Down
6 changes: 5 additions & 1 deletion xml/chapter1/section1/subsection7.xml
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,11 @@ sqrt(3);
approximation to the cube root of <LATEXINLINE>$x$</LATEXINLINE>, then a better approximation is
given by the value
<LATEX>
\[ \frac{x/y^{2}+2y} {3} \]
\[
\begin{array}{lll}
\dfrac{x/y^{2}+2y} {3}
\end{array}
\]
</LATEX>
Use this formula to implement a cube-root
<SPLITINLINE>
Expand Down
22 changes: 16 additions & 6 deletions xml/chapter1/section2/subsection1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@
<INDEX>factorial</INDEX>
factorial function, defined by
<LATEX>
\[ n!=n\cdot(n-1)\cdot(n-2)\cdots3\cdot2\cdot1 \]
\[
\begin{array}{lll}
n! &amp;=&amp; n\cdot(n-1)\cdot(n-2)\cdots3\cdot2\cdot1
\end{array}
\]
</LATEX>
There are many ways to compute factorials. One way is to make use of
the observation that <LATEXINLINE>$n!$</LATEXINLINE> is equal to
<LATEXINLINE>$n$</LATEXINLINE> times <LATEXINLINE>$(n-1)!$</LATEXINLINE> for
any positive integer<SPACE/><LATEXINLINE>$n$</LATEXINLINE>:
<LATEX>
\[ n!=n\cdot\left[(n-1)\cdot(n-2)\cdots3\cdot2\cdot1\right]=n\cdot(n-1)! \]
\[
\begin{array}{lll}
n! &amp;=&amp; n\cdot\left[(n-1)\cdot(n-2)\cdots3\cdot2\cdot1\right] \quad = \quad n \cdot(n-1)!
\end{array}
\]
</LATEX>
Thus, we can compute <LATEXINLINE>$n!$</LATEXINLINE> by computing
<LATEXINLINE>$(n-1)!$</LATEXINLINE> and multiplying the
Expand Down Expand Up @@ -97,10 +105,12 @@ factorial(5);
the computation by saying that the counter and the product simultaneously
change from one step to the next according to the rule
<LATEX>
\begin{align*}
\textrm{product} &amp; \leftarrow \textrm{counter} \cdot \textrm{product}\\
\textrm{counter} &amp; \leftarrow \textrm{counter} + 1
\end{align*}
\[
\begin{array}{lll}
\textrm{product} &amp; \leftarrow &amp; \textrm{counter} \cdot \textrm{product}\\
\textrm{counter} &amp; \leftarrow &amp; \textrm{counter} + 1
\end{array}
\]
</LATEX>
and stipulating that <LATEXINLINE>$n!$</LATEXINLINE> is the value of the
product when the counter exceeds <LATEXINLINE>$n$</LATEXINLINE>.
Expand Down
4 changes: 2 additions & 2 deletions xml/chapter1/section2/subsection2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ fib(6);
<LATEXINLINE>$\textrm{Fib}(n)$</LATEXINLINE> is the closest integer to
<LATEXINLINE>$\phi^{n} /\sqrt{5}$</LATEXINLINE>, where
<LATEX>
\[\begin{array}{lll}
\phi&amp;=&amp;(1+\sqrt{5})/2\approx 1.6180
\[\begin{array}{lllll}
\phi&amp;=&amp;(1+\sqrt{5})/2 &amp; \approx &amp; 1.6180
\end{array}\]
</LATEX>
is the
Expand Down
12 changes: 10 additions & 2 deletions xml/chapter1/section2/subsection3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
<LATEXINLINE>$k_2$</LATEXINLINE> independent of
<LATEXINLINE>$n$</LATEXINLINE> such that
<LATEX>
\[k_1f(n) \leq R(n) \leq k_2f(n)\]
\[
\begin{array}{lllll}
k_1\,f(n) &amp; \leq &amp; R(n) &amp; \leq &amp; k_2\,f(n)
\end{array}
\]
</LATEX>
for any sufficiently large value of <LATEXINLINE>$n$</LATEXINLINE>.
(In other words, for large <LATEXINLINE>$n$</LATEXINLINE>,
Expand Down Expand Up @@ -281,7 +285,11 @@
if <LATEXINLINE>$x$</LATEXINLINE> is sufficiently small, and the
trigonometric identity
<LATEX>
\[\sin x=3\sin {\frac{x}{3}}-4\sin^3{\frac{x}{3}}\]
\[
\begin{array}{lll}
\sin x &amp;=&amp; 3\sin {\dfrac{x}{3}}-4\sin^3{\dfrac{x}{3}}
\end{array}
\]
</LATEX>
to reduce the size of the argument of <LATEXINLINE>$\sin$</LATEXINLINE>.
(For purposes of this exercise an angle is considered <QUOTE>sufficiently
Expand Down
18 changes: 12 additions & 6 deletions xml/chapter1/section3/subsection1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function $name$(a, b) {
notation,</QUOTE> for example
<LATEX>
\[\begin{array}{lll}
\sum_{n=a}^{b}\ f(n)&amp;=&amp;f(a)+\cdots+f(b)
\displaystyle\sum_{n=a}^{b}\ f(n)&amp;=&amp;f(a)+\cdots+f(b)
\end{array}\]
</LATEX>
to express this concept. The power of sigma notation is that it allows
Expand Down Expand Up @@ -477,10 +477,12 @@ function pi_sum(a, b) {
be approximated numerically using the formula
<LATEX>
\[
\int_{a}^{b}f =
\left[ f\left( a+\frac{dx}{2} \right) + f \left(a+dx+\frac{dx}{2}
\right) + f \left( a+2dx+\frac{dx}{2} \right)+\cdots
\begin{array}{lll}
\displaystyle\int_{a}^{b}f &amp; = &amp;
\left[\,f\!\left( a+\dfrac{dx}{2} \right)\,+\,f\!\left(a+dx+\dfrac{dx}{2}
\right)\,+\,f\!\left( a+2dx+\dfrac{dx}{2}\right)\,+\,\cdots
\right] dx
\end{array}
\]
</LATEX>
for small values of <LATEXINLINE>$dx$</LATEXINLINE>. We can express this
Expand Down Expand Up @@ -760,8 +762,12 @@ sum_cubes(1, 10);
<INDEX>Wallis, John</INDEX>
John Wallis.</FOOTNOTE>
<LATEX>
\[\frac{\pi}{4}\ =\ \frac{2\cdot 4\cdot 4\cdot 6\cdot 6\cdot 8\cdots}{3\cdot
3\cdot 5\cdot 5\cdot 7\cdot 7\cdots}\]
\[
\begin{array}{lll}
\dfrac{\pi}{4} &amp; = &amp; \dfrac{2 \cdot 4\cdot 4\cdot 6\cdot 6\cdot 8\cdots}{3\cdot
3\cdot 5\cdot 5\cdot 7\cdot 7\cdots}
\end{array}
\]
</LATEX>
</LI>
<LI>
Expand Down
14 changes: 11 additions & 3 deletions xml/chapter1/section3/subsection3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,11 @@ half_interval_method(x => x * x * x - 2 * x - 3, 1, 2);
beginning with an initial guess and applying <LATEXINLINE>$f$</LATEXINLINE>
repeatedly,
<LATEX>
\[ f(x), f(f(x)), f(f(f(x))), \ldots \]
\[
\begin{array}{l}
f(x), \ f(f(x)), \ f(f(f(x))), \ \ldots
\end{array}
\]
</LATEX>
until the value does not change very much. Using this idea, we can devise a
<SPLITINLINE>
Expand Down Expand Up @@ -737,9 +741,11 @@ fixed_point_with_average_dampening(x => math_log(1000) / math_log(x), 2.0);
<EM>continued fraction</EM> is an expression of the form
<LATEX>
\[
f={\dfrac{N_1}{D_1+
\begin{array}{lll}
f &amp; = &amp; {\dfrac{N_1}{D_1+
\dfrac{N_2}{D_2+
\dfrac{N_3}{D_3+\cdots }}}}
\end{array}
\]
</LATEX>
As an example, one can show that the infinite continued fraction
Expand Down Expand Up @@ -920,10 +926,12 @@ cont_frac(i => 1, i => 1, 20);
J.H. Lambert:
<LATEX>
\[
\tan x={\dfrac{x}{1-
\begin{array}{lll}
\tan x &amp; = &amp; {\dfrac{x}{1-
\dfrac{x^2}{3-
\dfrac{x^2}{5-
\dfrac{x^2}{ \ddots }}}}}
\end{array}
\]
</LATEX>
where <LATEXINLINE>$x$</LATEXINLINE> is in radians.
Expand Down
10 changes: 8 additions & 2 deletions xml/chapter1/section3/subsection4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ cube_root(27);
fixed point of the function <LATEXINLINE>$x\mapsto f(x)$</LATEXINLINE> where
<LATEX>
\[
f(x)\ =\ x - \frac{g(x)}{Dg(x)}
\begin{array}{lll}
f(x) &amp; = &amp; x - \dfrac{g(x)}{Dg(x)}
\end{array}
\]
</LATEX>
and <LATEXINLINE>$Dg(x)$</LATEXINLINE> is the derivative of
Expand Down Expand Up @@ -351,7 +353,11 @@ cube_root(27);
function whose value at any number <LATEXINLINE>$x$</LATEXINLINE> is given
(in the limit of small <LATEXINLINE>$dx$</LATEXINLINE>) by
<LATEX>
\[Dg(x)\ =\ \frac {g(x+dx) - g(x)}{dx} \]
\[
\begin{array}{lll}
Dg(x) &amp; = &amp; \dfrac {g(x+dx) - g(x)}{dx}
\end{array}
\]
</LATEX>
Thus, we can express the idea of derivative (taking
<LATEXINLINE>$dx$</LATEXINLINE> to be, say, 0.00001) as the
Expand Down
42 changes: 12 additions & 30 deletions xml/chapter2/section1/subsection1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,36 +83,18 @@

<LATEX>
\[
\frac{n_{1}}{d_{1}}+\frac{n_{2}}{d_{2}}
=\frac{n_{1}d_{2}+n_{2}d_{1}}{d_{1}d_{2}}
\]
</LATEX>

<LATEX>
\[
\frac{n_{1}}{d_{1}}-\frac{n_{2}}{d_{2}}
=\frac{n_{1}d_{2}-n_{2}d_{1}}{d_{1}d_{2}}
\]
</LATEX>

<LATEX>
\[
\frac{n_{1}}{d_{1}}\cdot\frac{n_{2}}{d_{2}}
=\frac{n_{1}n_{2}}{d_{1}d_{2}}
\]
</LATEX>

<LATEX>
\[
\frac{n_{1}/d_{1}}{n_{2}/d_{2}}
=\frac{n_{1}d_{2}}{d_{1}n_{2}}
\]
</LATEX>

<LATEX>
\[
\frac{n_{1}}{d_{1}}
=\frac{n_{2}}{d_{2}}\ \textrm{if and only if} \ n_{1}d_{2}=n_{2}d_{1}
\begin{array}{rll}
\dfrac{n_{1}}{d_{1}}+\dfrac{n_{2}}{d_{2}}
&amp;=&amp;\dfrac{n_{1}d_{2}+n_{2}d_{1}}{d_{1}d_{2}}\\[15pt]
\dfrac{n_{1}}{d_{1}}-\dfrac{n_{2}}{d_{2}}
&amp;=&amp;\dfrac{n_{1}d_{2}-n_{2}d_{1}}{d_{1}d_{2}}\\[15pt]
\dfrac{n_{1}}{d_{1}}\cdot\dfrac{n_{2}}{d_{2}}
&amp;=&amp;\dfrac{n_{1}n_{2}}{d_{1}d_{2}}\\[15pt]
\dfrac{n_{1}/d_{1}}{n_{2}/d_{2}}
&amp;=&amp;\dfrac{n_{1}d_{2}}{d_{1}n_{2}}\\[15pt]
\dfrac{n_{1}}{d_{1}}
&amp;=&amp;\dfrac{n_{2}}{d_{2}}\ \quad \textrm{if and only if}\ \ \ n_{1}d_{2}\ =\ n_{2}d_{1}
\end{array}
\]
</LATEX>
</TEXT>
Expand Down
16 changes: 10 additions & 6 deletions xml/chapter2/section1/subsection3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,22 @@
<JAVASCRIPT>
<LATEX>
\[
\frac{\texttt{numer}(\texttt{x})}{\texttt{denom}(\texttt{x})}
=
\frac{\texttt{n}}{\texttt{d}}
\begin{array}{lll}
\dfrac{\texttt{numer}(\texttt{x})}{\texttt{denom}(\texttt{x})}
&amp;=&amp;
\dfrac{\texttt{n}}{\texttt{d}}
\end{array}
\]
</LATEX>
</JAVASCRIPT>
<SCHEME>
<LATEX>
\[
\frac{(\texttt{numer}~\texttt{x})}{(\texttt{denom}~\texttt{x})}
=
\frac{\texttt{n}}{\texttt{d}}
\begin{array}{lll}
\dfrac{(\texttt{numer}~\texttt{x})}{(\texttt{denom}~\texttt{x})}
&amp;=&amp;
\dfrac{\texttt{n}}{\texttt{d}}
\end{array}
\]
</LATEX>
</SCHEME>
Expand Down
8 changes: 5 additions & 3 deletions xml/chapter2/section1/subsection4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
using the formula
<LATEX>
\[
R_{p}\ =\ \frac{1}{1/R_{1}+1/R_{2}}
\begin{array}{lll}
R_{p} &amp; = &amp; \dfrac{1}{1/R_{1}+1/R_{2}}
\end{array}
\]
</LATEX>
Resistance values are usually known only up to some
Expand Down Expand Up @@ -583,13 +585,13 @@ percent(my_interval);
algebraically equivalent ways:
<LATEX>
\[
\frac{R_{1}R_{2}}{R_{1}+R_{2}}
\dfrac{R_{1}R_{2}}{R_{1}+R_{2}}
\]
</LATEX>
and
<LATEX>
\[
\frac{1}{1/R_{1}+1/R_{2}}
\dfrac{1}{1/R_{1}+1/R_{2}}
\]
</LATEX>
He has written the following two programs, each of which computes the
Expand Down
30 changes: 20 additions & 10 deletions xml/chapter2/section3/subsection2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@
<INDEX>differentiation<SUBINDEX>rules for</SUBINDEX></INDEX>
reduction rules:
<LATEX>
\begin{align*}
\frac{dc}{dx} &amp; =
0\text{ for $c$ a constant or a variable different from $x$} \\[3mm]
\frac{dx}{dx} &amp; = 1 \\[3mm]
\frac{d(u+v)}{dx} &amp; = \frac{du}{dx}+\frac{dv}{dx} \\[3mm]
\frac{d(uv)}{dx} &amp; = u\left( \frac{dv}{dx}\right)+v\left(
\frac{du}{dx}\right)
\end{align*}
\[
\begin{array}{rll}
\dfrac{dc}{dx} &amp; = &amp;
0\quad \text{for $c$ a constant or a variable different from $x$} \\[12pt]
\dfrac{dx}{dx} &amp; = &amp; 1 \\[12pt]
\dfrac{d(u+v)}{dx} &amp; = &amp; \dfrac{du}{dx}+\dfrac{dv}{dx} \\[12pt]
\dfrac{d(uv)}{dx} &amp; = &amp; u\left( \dfrac{dv}{dx}\right)+v\left(
\dfrac{du}{dx}\right)
\end{array}
\]
</LATEX>
Observe that the latter two rules are recursive in nature. That is, to
obtain the derivative of a sum we first find the derivatives of the terms
Expand Down Expand Up @@ -724,7 +726,11 @@ list("+", list("*", list("*", "x", "y"),
The program produces answers that are correct; however, they are
unsimplified. It is true that
<LATEX>
\[ \frac{d(xy)}{dx} = x\cdot 0+1\cdot y \]
\[
\begin{array}{lll}
\dfrac{d(xy)}{dx} &amp; = &amp; x\cdot 0+1\cdot y
\end{array}
\]
</LATEX>
but we would like the program to know that
<LATEXINLINE>$x\cdot 0 = 0$</LATEXINLINE>,
Expand Down Expand Up @@ -992,7 +998,11 @@ list("+",
<INDEX>differentiation<SUBINDEX>rules for</SUBINDEX></INDEX>
For instance, implement the differentiation rule
<LATEX>
\[ \frac {d(u^{n})}{dx} = nu^{n-1}\left( \frac{du}{dx}\right) \]
\[
\begin{array}{lll}
\dfrac {d(u^{n})}{dx} &amp; = &amp; nu^{n-1}\left( \dfrac{du}{dx}\right)
\end{array}
\]
</LATEX>
by adding a new clause to the <SCHEMEINLINE>deriv</SCHEMEINLINE> program
and defining appropriate
Expand Down
Loading