Multivariable Calculus with MATLAB With Applications to Geometry and Physics Ronald L. Lipsman - Download the ebook now for an unlimited reading experience
Multivariable Calculus with MATLAB With Applications to Geometry and Physics Ronald L. Lipsman - Download the ebook now for an unlimited reading experience
com
https://textbookfull.com/product/multivariable-calculus-
with-matlab-with-applications-to-geometry-and-physics-
ronald-l-lipsman/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/multivariable-advanced-calculus-
kenneth-l-kuttler/
textbookfull.com
https://textbookfull.com/product/calculus-problem-solutions-with-
matlab-1st-edition-dingyu-xue/
textbookfull.com
https://textbookfull.com/product/handbook-of-fractional-calculus-with-
applications-volume-4-applications-in-physics-part-a-tarasov/
textbookfull.com
https://textbookfull.com/product/introductory-solid-state-physics-
with-matlab-applications-1st-edition-javier-e-hasbun-author/
textbookfull.com
Math 302 Lecture Notes linear algebra and multivariable
calculus Kenneth L. Kuttler
https://textbookfull.com/product/math-302-lecture-notes-linear-
algebra-and-multivariable-calculus-kenneth-l-kuttler/
textbookfull.com
https://textbookfull.com/product/multivariable-advanced-calculus-
kuttler-k/
textbookfull.com
https://textbookfull.com/product/multivariable-calculus-8th-edition-
stewart/
textbookfull.com
https://textbookfull.com/product/multivariable-calculus-8th-edition-
james-stewart/
textbookfull.com
https://textbookfull.com/product/microeconomics-theory-and-
applications-with-calculus-fourth-edition-globaled-perloff/
textbookfull.com
Multivariable Calculus with MATLAB®
Ronald L. Lipsman · Jonathan M. Rosenberg
Multivariable Calculus
with MATLAB®
With Applications to Geometry and Physics
Ronald L. Lipsman Jonathan M. Rosenberg
Department of Mathematics Department of Mathematics
University of Maryland University of Maryland
College Park, MD, USA College Park, MD, USA
2
z
0
2
2
1
1
0 0
-1
y -1 -2 x
The preface of a book gives the authors their best chance to answer an extremely
important question: What makes this book special?
This book is a reworking and updating for MATLAB of our previous book ( joint
with Kevin R. Coombes) Multivariable Calculus with Mathematica®,
Springer, 1998. It represents our attempt to enrich and enliven the teaching of mul-
tivariable calculus and mathematical methods courses for scientists and engineers.
Most books in these subjects are not substantially different from those of fifty years
ago. (Well, they may include fancier graphics and omit several topics, but those
are minor changes.) This book is different. We do touch on most of the classical
topics; however, we have made a particular effort to illustrate each point with a
significant example. More importantly, we have tried to bring fundamental physi-
cal applications—Kepler’s laws, electromagnetism, fluid flow, energy estimation—
back to a prominent position in the subject. From one perspective, the subject of
multivariable calculus only exists because it can be applied to important problems
in science.
In addition, we have included a discussion of the geometric invariants of curves
and surfaces, providing, in effect, a brief introduction to differential geometry. This
material provides a natural extension to the traditional syllabus.
We believe that we have succeeded in resurrecting material that used to be in
the course while introducing new material. A major reason for that success is that
we use the computational power of the mathematical software system MATLAB to
carry a large share of the load. MATLAB is tightly integrated into every portion
of this book. We use its graphical capabilities to draw pictures of curves and sur-
faces; we use its symbolical capabilities to compute curvature and torsion; we use
its numerical capabilities to tackle problems that are well beyond the typical mun-
dane examples of textbooks that treat the subject without using a computer. Finally,
and this is something not done in any other books at this level, we give a serious
yet elementary explanation of how various numerical algorithms work, and what
their advantages and disadvantages are. Again, this is something that could not be
accomplished without a software package such as MATLAB.
v
vi Preface
Conventions
Throughout the book, MATLAB commands, such as solve, are printed in type-
writer boldface. Theorems and general principles, such as: derivatives measure
change, are printed in a slanted font. When new terms, such as torsion, are intro-
duced, they are printed in an italic font. File names and URLs (web addresses) are
printed in typewriter font. Everything else is printed in a standard font.
At the start of each chapter, below the title, is a small illustration. Each is a
graphic generated by a MATLAB command. Most are taken from the MATLAB
solution to one of the problems in the accompanying problem set. A few are taken
from the chapter itself. Finally, in this Preface, the graphic represents a more eclectic
choice. We leave it to the industrious reader to identify the source of these graphics,
as well as to reproduce the figure.
Acknowledgments
We above all want to thank our former collaborators for their contributions to this
project. Kevin Coombes (now at the Department of Biomedical Informatics at Ohio
State University) was a co-author of Multivariable Calculus with Mathematica®
and kindly agreed to let us adapt that book for MATLAB. Brian Hunt was a
co-author of A Guide to MATLAB and taught us many useful MATLAB tricks and
Preface vii
tips. Paul Green helped develop MATLAB exercises for multivariable calculus that
eventually worked their way into this book.
Jonathan Rosenberg thanks the National Science Foundation for its support under
grant DMS-1607162. Any opinions, findings, and conclusions or recommendations
expressed in this material are those of the authors and do not necessarily reflect the
views of the National Science Foundation.
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Benefits of Mathematical Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 What’s in This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Chapter Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 What’s Not in This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 How to Use This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 The MATLAB Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5.1 A Word on Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 Software Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Problem Set A. Review of One-Variable Calculus . . . . . . . . . . . . . . . . . . . . 9
Glossary of MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Options to MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Geometry of Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1 Parametric Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2 Geometric Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2.1 Arclength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2.2 The Frenet Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
ix
x Contents
4 Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.1 Newton’s Laws of Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.2 Kepler’s Laws of Planetary Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.3 Studying Equations of Motion with MATLAB . . . . . . . . . . . . . . . . . . 65
Problem Set D. Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Glossary of MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5 Directional Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.1 Visualizing Functions of Two Variables . . . . . . . . . . . . . . . . . . . . . . . . 75
5.1.1 Three-Dimensional Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.1.2 Graphing Level Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.2 The Gradient of a Function of Two Variables . . . . . . . . . . . . . . . . . . . . 80
5.2.1 Partial Derivatives and the Gradient . . . . . . . . . . . . . . . . . . . . . 80
5.2.2 Directional Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.3 Functions of Three or More Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Problem Set E. Directional Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Glossary of MATLAB Commands and Options . . . . . . . . . . . . . . . . . . . . . . 94
Options to MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
6 Geometry of Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.1 The Concept of a Surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.1.1 Basic Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
6.2 The Implicit Function Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.3 Geometric Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.4 Curvature Calculations with MATLAB . . . . . . . . . . . . . . . . . . . . . . . . 112
Problem Set F. Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Glossary of MATLAB Commands and Options . . . . . . . . . . . . . . . . . . . . . . 121
Options to MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Contents xi
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Chapter 1
Introduction
besselj (0, 2 x)
0.5
-0.5
-8 -6 -4 -2 0 2 4 6 8
x
We wrote this book with the third semester of a physical science or engineering
calculus sequence in mind. The book can be used as a supplement to a traditional
calculus book in such a course, or as the sole text in an “honors” course in the sub-
ject. It can equally well be used in a postcalculus course or problem seminar on
mathematical methods for scientists and engineers. Finally, it can serve as introduc-
tory source material for a modern course in differential geometry. The subject is
traditionally called Calculus of Several Variables, Vector Calculus, or Multivariable
Calculus. The usual content is
• Preliminary Theory of Vectors: Dot and Cross Products; Vectors, Lines, and
Planes in R3 .
• Vector-Valued Functions: Derivatives and Integrals of Vector-Valued Functions of
One Variable; Space Curves; Tangents and Normals; Arclength and Curvature.
• Partial Derivatives: Directional Derivatives; Gradients; Surfaces; Tangent Planes;
Multivariable Max/Min Problems; Lagrange Multipliers.
• Multiple Integrals: Double and Triple Integrals; Cylindrical and Spherical Coor-
dinates; Change of Variables.
• Calculus of Vector Fields: Line and Surface Integrals; Fundamental Theorem of
Line Integrals; Green’s, Stokes’, and Divergence Theorems.
Our goal is to modernize the course in two important ways. First, we adopt a
modern view, which emphasizes geometry as much as analysis. Second, we intro-
duce the mathematical software system MATLAB as a powerful computational and
visual tool. We include and emphasize MATLAB in order to
• remove the drudgery from tedious hand calculations that can now be done easily
by computer;
• improve students’ understanding of fundamental concepts in the traditional syl-
labus;
c Springer International Publishing AG 2017 1
R.L. Lipsman and J.M. Rosenberg, Multivariable Calculus with MATLAB ,
DOI 10.1007/978-3-319-65070-8 1
2 1 Introduction
• enhance students’ appreciation of the beauty and power of the subject by incor-
porating dramatic visual evidence; and
• introduce new geometrical and physical topics.
To elaborate, we describe some specific benefits that follow from introducing MAT-
LAB. First, the traditional multivariable calculus course has a tremendous geomet-
ric component. Students struggle to handle it. Unless they are endowed with artistic
gifts or uncanny geometric insight, they may fail to depict and understand the geo-
metric constructs. Often, they rely on illustrations in their text or prepared by their
instructor. While the quality of those illustrations may be superior to what they can
generate themselves, spoon-fed instruction does not lead to the same depth of un-
derstanding as self-discovery. Providing a software system like MATLAB enables
all students to draw, manipulate, and analyze the geometric shapes of multivariable
calculus.
Second, most of the numbers, formulas, and equations found in standard prob-
lems are highly contrived to make the computations tractable. This places an enor-
mous limitation on the faculty member trying to present meaningful applications,
and lends an air of untruthfulness to the course. (Think about the limited number
of examples for an arclength integral that can be integrated easily in closed form.)
With the introduction of MATLAB, this drawback is ameliorated. The numerical
and symbolic power of MATLAB greatly expands our ability to present realistic
examples and applications.
Third, the instructor can concentrate on non-rote aspects of the course. The stu-
dent can rely on MATLAB to carry out the mundane algebra and calculus that often
absorbed all of the student’s attention previously. The instructor can focus on theory
and problems that emphasize analysis, interpretation, and creative skills. Students
can do more than crank out numbers and pictures; they can learn to explain coher-
ently what the pictures mean. This capability is enhanced by either of the MATLAB
environments in which students will work—a published MATLAB script (formerly
called a script M-file) or a Live Script (created in the Live Editor). Either will afford
the student the capability to integrate MATLAB commands with output, graphics,
and textual commentary.
Fourth, the instructor has time to introduce modern, meaningful subject matter
into the course. Because we can rely on MATLAB to carry out the computations, we
are free to emphasize the ideas. In this book, we concentrate on aspects of geometry
and physics that are truly germane to the study of multivariable calculus. With the
introduction of MATLAB, this material can, for the first time, be presented effec-
tively at the sophomore level.
1.2 What’s in This Book 3
The bulk of the book consists of nine chapters (numbered 2–10) on multivariable
calculus and its applications. Some chapters cover standard material from a non-
standard point of view; others discuss topics that are hard to address without using
a computer and mathematical software, such as numerical methods.
Each chapter is accompanied by a problem set. The problem sets constitute an
integral part of the book. Solving the problems will expose you to the geometric,
symbolic, and numerical features of multivariable calculus. Many of the problems
(especially in Problem Sets C–J) are not routine.
Each problem set concludes with a Glossary of MATLAB commands, accompa-
nied by a brief description, which are likely to be useful in solving the problems in
that set. A more complete Glossary, with examples of how to use the commands, is
included in our website at
http://schol.math.umd.edu/MVCwMATLAB/
This Chapter, and Problem Set A, Review of One-Variable Calculus, describe the
purpose of the book and its prerequisites. The Problem Set reviews both the ele-
mentary MATLAB commands and the fundamental concepts of one-variable calcu-
lus needed to use MATLAB to study multivariable calculus.
Chapter 2, Vectors and Graphics, and Problem Set B, Vectors and Graphics,
introduce the mathematical idea of vectors in the plane and in space. We explain
how to work with vectors in MATLAB and how to graph curves and surfaces in
space.
Chapter 3, Geometry of Curves, and Problem Set C, Curves, examine parametric
curves, with an emphasis on geometric invariants like speed, curvature, and torsion,
which can be used to study and characterize the nature of different curves.
Chapter 4, Kinematics, and Problem Set D, Kinematics, apply the theory of
curves to the physical problems of moving particles and planets.
Chapter 5, Directional Derivatives, and Problem Set E, Directional Derivatives,
introduce the differential calculus of functions of several variables, including partial
derivatives, directional derivatives, and gradients. We also explain how to graph
functions and their level curves or surfaces with MATLAB.
4 1 Introduction
http://schol.math.umd.edu/MVCwMATLAB/
http://www.mathworks.com/support/
and at
https://matlabacademy.mathworks.com/ .
You might also enjoy reading the free e-books [6, 7] by Cleve Moler, the developer
of MATLAB.
6 1 Introduction
Once you have gone through the “Getting Started with MATLAB” and “MAT-
LAB Overview” videos, plus other tutorials of your choice, try working with the
software by yourself to get the hang of it. If you want additional help, there are
many good books available. We, of course, are biased and think that the best of
these is [5] by Brian Hunt and the two of us. Other options include [1–4, 8, 9], cited
in the bibliography below.
Remember that MATLAB comes with very extensive documentation and help.
Typing help followed by the name of a command in the Command Window gives
you concise help on that command. For more extensive help, including examples
and lists of possible options, use the help browser that comes with the software,
which you can call up with the button that looks like ? , or else the website
http://www.mathworks.com/help/ .
If this book is used as a stand-alone text, then most (but not all) of the material can
be covered in a single semester. If the book supplements a traditional text, then it
contains more material than can be covered in a single semester. To aid in selecting
a coherent subset of the material, here is a diagram showing the dependence among
the chapters:
3 4
1 2 6 9 10
5 8
We suggest that you work all the problems in Problem Set A, read Chapter 2,
and then work at least a quarter to a half of Problem Set B. After that, various
combinations of chapters are possible. Here are a few selections that we have found
suitable for a one-semester multivariable calculus course
• Geometry Emphasis: Chapters 3, 5, and 6 with Problem Sets C, E, and F. If time
permits, you could include portions of Chapter 4 and Problem Set D, or Chapter
8 and Problem Set H.
1.5 The MATLAB Interface 7
• Live Editor. This is where the output of your script commands are integrated,
from the start, with the corresponding input in a window in which you can do live
editing. You alter a command (with your mouse or keyboard), evaluate, and the
output is automatically updated. You can intersperse comments between different
output cells. This is like simultaneous script construction (i.e., programming) and
publishing. Either this method or the preceding is extremely handy for transmit-
ting (e.g., to an instructor) the results of your MATLAB investigations.
Until very recently, a MATLAB script was called an M-file. There were two fla-
vors: a script M-file—exactly what we are calling a script; and a function M-file—a
slightly different format in which a function is defined. The latter are still valid, but
they are just called function scripts. Contrast the latter with anonymous functions,
which are inputted at the command line via the @ construct.
For more on interface, terminology and MATLAB basics and protocols, see the
online help or any of the references listed below.
MATLAB and its accompanying products (such as the Symbolic Math Toolbox) are
constantly being updated. We prepared this book with versions R2016b and R2017a.
With each revision, the syntax for some commands may change, and occasionally
an old command is replaced by a new one with another name. For example, the
MATLAB command integral for numerical integration was only introduced in
version R2012a; before that, the relevant command was quadl. Live Editor scripts
were only introduced in R2016a. In the latest versions of MATLAB, fplot3 has
replaced ezplot3 and the new command fimplicit3 was introduced. We men-
tion this because different readers of this book will undoubtedly be using different
versions of MATLAB. For more than 90% of what we discuss, this will make no
difference. But occasionally you may notice that we refer to a command that has
either been superseded or does not exist in the version you are using. In almost all
cases, searching the documentation should enable you to find a close equivalent.
When major changes occur, we will discuss them on the book website.
Problem Set A. Review of One-Variable Calculus 9
Problem 1.1. Graph the following transcendental functions using fplot. Use
your judgment and some experimentation to find an appropriate range of values
of x so that the “main features” of the graph are visible.
(a) sin x.
(b) tan x.
(c) ln x. (Remember that the natural logarithm is called log in MATLAB.)
Hint: The logarithm is singular for x = 0 and undefined for x < 0. Allow your
range of values to start at x = 0 and then at some value x < 0. How well does
MATLAB cope?
(d) sinh x.
(e) tanh x.
(f) e−x .
2
(f) Find numerical values of the coordinates of the relative maximum points
and/or relative minimum points on the graph.
(g) Determine where the graph of f is concave upward and where it is concave
downward.
(c) lim x ln x.
x→0+
Problem 1.7. Use the taylor command to find the Taylor series of the function
sec(x) around the point x = 0, up to and including the term in x10 . Check the docu-
mentation on taylor to see how to get the right number of terms of the series; the
default is to go out only to the term in x4 .
1 1 1 1
1− + − + +···
2 3 4 5
is known to converge (slowly!!) to ln 2.
(a) Test this by adding the first 100 terms of the series and comparing with the
value of ln 2. Do the same with the first 1000 terms.
(b) The alternating series test says that the error in truncating an alternating
series (whose terms decrease steadily in absolute value) is less than the absolute
value of the last term included. Check this in the situation of (a). In other words,
verify that the difference between ln 2 and the sum of the first 100 terms of the
1
series is less than 100 in absolute value, and that the difference between ln 2 and
1
the sum of the first 1000 terms of the series is less than 1000 in absolute value.
Problem 1.11. Use the ezpolar command in MATLAB to graph the following
equations in polar coordinates
(a) r = sin θ .
(b) r = sin(6θ ).
(c) r = 4 sin θ − 2.
(d) r2 = sin 2θ .
References
1. S. Attaway, MATLAB: A Practical Introduction to Programming and Problem Solving, 4th edn.
(Elsevier, 2016)
2. W. Gander, Learning MATLAB: A Problem Solving Approach (Springer, 2015)
3. A. Gilat, MATLAB: An Introduction with Applications, 5th edn. (Wiley, 2015)
4. B. Hahn, D. Valentine, Essential MATLAB for Engineers and Scientists, 5th edn. (Academic
Press, 2013)
5. B. Hunt, R. Lipsman, J. Rosenberg, A Guide to MATLAB: For Beginners and Experienced
Users, 3rd edn. (Cambridge Univesity Press, 2014)
6. C. Moler, Numerical Computing with MATLAB (2004), http://www.mathworks.com/moler/
chapters.html
7. C. Moler, Experiments with MATLAB (2011), http://www.mathworks.com/moler/exm/
8. H. Moore, MATLAB for Engineers, 5th edn. (Pearson, 2018)
9. R. Pratap, Getting Started with MATLAB, 7th edn. (Oxford University Press, 2016)
Chapter 2
Vectors and Graphics
We start this chapter by explaining how to use vectors in MATLAB, with an empha-
sis on practical operations on vectors in the plane and in space. Remember that
n-dimensional vectors are simply ordered lists of n real numbers; the set of all such
is denoted by Rn . We discuss the standard vector operations, and give several appli-
cations to the computations of geometric quantities such as distances, angles, areas,
and volumes. The bulk of the chapter is devoted to instructions for graphing curves
and surfaces.
2.1 Vectors
>> 5*c
ans =
15 0 -10
c Springer International Publishing AG 2017 15
R.L. Lipsman and J.M. Rosenberg, Multivariable Calculus with MATLAB ,
DOI 10.1007/978-3-319-65070-8 2
16 2 Vectors and Graphics
>> dot(a, b)
ans =
-14
The dot(a, b) command computes the dot product of the vectors a and b (the
sum of the products of corresponding entries). As usual, you can use the dot product
to compute lengths of vectors (also known as vector norms).
>> lengthofa = sqrt(dot(a, a))
ans =
3.7417
Actually, MATLAB has an internal command that automates the numerical compu-
tation of vector norms.
>> [norm(a), norm(b), norm(c)]
ans =
3.7417 5.9161 3.6056
Our attention throughout this book will be directed to vectors in the plane and
vectors in (three-dimensional) space. Vectors in the plane have two components;
a typical example in MATLAB is [x, y]. Vectors in space have three compo-
nents, like [x, y, z]. The following principle will recur: Vectors with differ-
ent numbers of components do not mix. As you will see, certain MATLAB com-
mands will only work with two-component vectors; others will only work with
three-component vectors. To convert a vector in the plane into a vector in space,
you can add a zero to the end.
>> syms x y; p1 = [x, y]
p1 =
[ x, y]
>> s1 = [p1, 0]
s1 =
[ x, y, 0]
To project a vector in space into a vector in the x-y plane, you simply drop the final
component.
>> syms x y z; s2 = [x, y, z]
s2 =
[ x, y, z]
>> p2 = s2(1:2)
p2 =
[ x, y]
vectors. To compute the cross product in MATLAB, you can use the cross com-
mand. For example, to compute the cross product of the vectors a and b defined
above, simply type
>> cross(a, b)
ans =
7 -14 7
Note that the cross product is anti-symmetric; reversing the order of the inputs
changes the sign of the output.
Since MATLAB allows you to perform all the standard operations on vectors, it is
a simple matter to compute lengths of vectors, angles between vectors, distances
between points and planes or between points and lines, areas of parallelograms, and
volumes of parallelepipeds, or any of the other quantities that can be computed using
vector operations. Here are some examples.
where ϕ is the angle between the two vectors. So, we can find the angle between a
and b in MATLAB by typing
>> phi = acos(dot(a, b)/(norm(a)*norm(b)))
phi =
2.2555
ans =
129.2315
One of the most useful applications of the dot product is for computing the pro-
jection of one vector in the direction of another. Given a nonzero vector b, we
can always write another vector a uniquely in the form projb (a) + c, where c ⊥ b
18 2 Vectors and Graphics
and projb (a) is a scalar multiple of b. To find the formula for the projection, write
projb (a) = xb and take the dot product with b. We obtain
a · b = x b · b + c · b = x b2 + 0.
projb (a) is nonlinear in b, it is linear in a. That is because the dot product is linear
in each variable when the other variable is held fixed. Computing projections is easy
in MATLAB. For example, with our given vectors, we obtain
>> (dot(a, b)/dot(b, b))*b
ans =
2.0000 1.2000 0.4000
The volume formula becomes an area formula if you take one of the vectors to
be a unit vector perpendicular to the plane spanned by the other two vectors. In
particular, given vectors a and c, a × c is perpendicular to both of them, so a unit
a×c
vector perpendicular to both a and c is a×c and the area of the parallelogram
spanned by a and c is just
a×c a × c2
a × c · (a × c) = a × c = a × c,
In a similar fashion, you can use the standard mathematical formulas, expressed
in MATLAB syntax, to
(i) project a vector onto a line or a plane;
2.2 Parametric Curves 19
We assume that you already know how to use MATLAB’s plotting commands
to graph plane curves of the form y = f (x). In fact, you can do so using either
MATLAB’s symbolic plotting command fplot or its numerical plotting command
plot. The analogs are fplot3 (symbolic) and plot3 (numerical) for curves in
space. There are also analogs, as we shall see, for surfaces in space, z = f (x, y),
namely fsurf or fmesh (symbolic) and surf or mesh (numerical). (Note: The
symbolic f commands replaced the ez commands in MATLAB as of version
R2016a.)
Now it is very common for both curves (in the plane or in space) and surfaces
to be specified by parametric equations, rather than explicitly as just described. As
we shall see, the same commands as above can be used to graph them—albeit with
slightly different syntax. In this section, we will explain how to graph curves defined
by parametric equations, both in the plane and in space, and also how to graph sur-
faces defined by parametric equations. But let us note: Henceforth in this book, and
in the spirit of its subject matter, we shall use symbolic plotting commands when-
ever feasible. We shall resort to numerical plotting routines only when absolutely
necessary.
For illustrative purposes, consider the parametrized unit circle
x = cos t, y = sin t, 0 ≤ t ≤ 2π .
These parametric equations mean that t is a parameter (ranging through the interval
[0, 2π ]), and that associated to each value of t is a pair (x, y) of values defined by
the given formulas. As t varies, the points (x(t), y(t)) trace out a curve in the plane.
Now let us draw the curve, first numerically, then symbolically
>> T = 0:0.1:2*pi; plot(cos(T), sin(T)); axis square
>> syms t; figure; fplot(cos(t), sin(t), [0, 2*pi]); axis square
Both commands result in the graph in Figure 2.1, although the tick marks differ
slightly. Note that we inserted the command figure in the second instruction.
Without it, the second circle would be superimposed on the first instead of it being
created in a second graph.
Now let us start in earnest on parametric curves and surfaces by looking first at
the spiral plane curve defined parametrically by the equations
Yeast.
The article in which yeast is kept must, when new yeast is made, or
fresh yeast bought, be scalded and emptied, and then have a salt
spoonful of saleratus put in, and be rinsed out again with warm
water. If it is glass, rinsing twice with warm water will answer. Junk
bottles are best for holding yeast, because they can be corked tight,
and easily cleansed.
Potato Yeast.
By those who use potato yeast, it is regarded as much the best, as it
raises bread quicker than common home-brewed yeast, and, best of
all, never imparts the sharp, disagreeable yeast taste to bread or
cake, often given by hop yeast.
Mash half a dozen peeled boiled potatoes, and mix in a handful of
wheat flour, and two teaspoonfuls of salt, and after putting it
through a colander, add hot water till it is a batter. When blood
warm, put in half a tea-cup of distillery yeast, or twice as much
potato, or other home-brewed. When raised, keep it corked tight,
and make it new very often in hot weather. It can easily be made
when potatoes are boiled for dinner.
Hard Yeast.
This often is very convenient, especially for hot weather, when it is
difficult to keep yeast.
Take some of the best yeast you can make, and thicken it with
Indian meal, and if you have rye, add a little to make it adhere
better. Make it into cakes an inch thick, and three inches by two in
size, and dry it in a drying wind, but not it the sun. Keep it tied in a
bag, in a dry, cool place, where it will not freeze.
One of these cakes is enough for four quarts of flour. When you wish
to use it, put it to soak in milk or water for several hours, and then
use it like other yeast.
Milk Yeast.
One pint of new milk, and one teaspoonful of fine salt. One large
spoonful of flour. Mix, and keep it blood warm an hour. Use twice as
much as the common yeast. Bread soon spoils made of this.
Baker’s Bread.
Take a gill of distillery yeast, or twice as much fresh home-brewed
yeast, add a quart of warm (not hot) water, and flour enough to
make a thin batter, and let it rise in a warm place all night. This is
the sponge.
Next day, put seven quarts of sifted flour into the kneading tray,
make a hole in the centre, and pour in the sponge. Then dissolve a
bit of volatile salts, and a bit of alum, each the size of a hickory-nut,
and finely powdered, in a little cold water, and add it, with a heaping
tablespoonful of salt, to the sponge, and also a quart more of blood-
warm water.
Work up the flour and wetting to a dough, knead it well, divide it
into three or four loaves, prick it with a fork, put it in buttered pans,
and let it rise one hour, and then bake it about an hour. Add more
flour, or more water, as you find the dough too stiff, or too soft.
A teaspoonful of saleratus can be used instead of the volatile salts
and alum, but it is not so good.
Potato Bread.
Rub a dozen peeled and boiled potatoes through a very coarse sieve,
and mix with them twice the quantity of flour, mixing very
thoroughly. Put in a coffee-cup full of home-brewed, or of potato
yeast, or half as much of distillery yeast, also a teaspoonful of salt.
Add whatever water may be needed to make a dough as stiff as for
common flour bread.
An ounce or two of butter rubbed into the flour, and an egg beat and
put into the yeast, and you can have fine rolls, or warm cakes for
breakfast.
This kind of bread is very moist, and keeps well.
Rye Bread.
A quart of water, and as much milk.
Two teaspoonfuls of salt, and a tea-cup of Indian meal.
A tea-cup full of home-brewed yeast, or half as much distillery yeast.
Make it as stiff as wheat bread, with rye flour.
Rice Bread.—No. 1.
One pint of rice, boiled till soft.
Two quarts of rice flour, or wheat flour.
A teaspoonful of salt.
A tea-cup of home-brewed, or half as much distillery yeast.
Milk to make it so as to mould like wheat bread.
Rice Bread.—No. 2.
Three half pints of ground rice.
Two teaspoonfuls (not heaping) of salt.
Two gills of home-brewed yeast.
Three quarts of milk, or milk and water. Mix the rice with cold milk
and water to a thin gruel, and boil it three minutes. Then stir in
wheat flour till as stiff as can be stirred with a spoon. When blood
warm, add the yeast. This keeps moist longer than No. 1.
Apple Bread.
Mix stewed and strained apple, or grated apple uncooked, with an
equal quantity of wheat flour; add yeast enough to raise it, and mix
sugar with the apple, enough to make it quite sweet. Make it in
loaves, and bake it an hour and a half, like other bread.
Pumpkin Bread.
Stew and strain some pumpkin, stiffen it with Indian meal, add salt
and yeast, and it makes a most excellent kind of bread.
Raised Biscuit.
Rub half a pound of butter into a pound of flour.
One beaten egg.
A teaspoonful of salt.
Two great spoonfuls of distillery yeast, or twice as much home-
brewed.
Wet it up with enough warm milk to make a soft dough, and then
work in half a pound of butter. When light, mould it into round
cakes, or roll it out and cut it with a tumbler.
Crackers.
One quart of flour, with two ounces of butter rubbed in.
One teaspoonful of saleratus in a wine-glass of warm water.
Half a teaspoonful of salt, and milk enough to roll it out.
Beat it half an hour with a pestle, cut it in thin round cakes, prick
them, and set them in the oven when other things are taken out. Let
them bake till crisp.
Hard Biscuit.
One quart of flour, and half a teaspoonful of salt.
Four great spoonfuls of butter, rubbed into two-thirds of the flour.
Wet it up with milk till a dough; roll it out again and again, sprinkling
on the reserved flour, till all is used. Cut into round cakes, and bake
in a quick oven on buttered tins.
Wheat Waffles.
One quart of flour, and a teaspoonful of salt.
One quart of milk, with a tablespoonful of melted butter in it, and
mixed with the flour gradually, so as not to have lumps.
Three tablespoonfuls of distillery yeast. When raised, two well-
beaten eggs.
Bake in waffle irons well oiled with lard each time they are used. Lay
one side on coals, and in about two minutes turn the other side to
the coals.
Rice Waffles.
A quart of milk.
A tea-cup of solid boiled rice, soaked three hours in half the milk.
A pint and a half of wheat flour, or rice flour.
Three well-beaten eggs. Bake in waffle irons.
The rice must be salted enough when boiled.
Fried Hominy.
When cold hominy is left of the previous day, it is very good wet up
with an egg and a little flour, and fried.
Pilgrim Cake.
Rub two spoonfuls of butter into a quart of flour, and wet it to dough
with cold water. Rake open a place in the hottest part of the hearth,
roll out the dough into a cake an inch thick, flour it well both sides,
and lay it on hot ashes. Cover it with hot ashes, and then with coals.
When cooked, wipe off the ashes, and it will be very sweet and
good.
The Kentucky corn cake, and common dough, can be baked the
same way. This method was used by our pilgrim and pioneer
forefathers.
Royal Crumpets.
Three tea-cups of raised dough.
Four great spoonfuls of melted butter, worked into the dough.
Three well-beaten eggs.
One tea-cup of rolled sugar, beaten into the eggs.
Turn it into buttered pans, and bake twenty minutes.
Some like them better without the sugar.
Corn Muffins.
One quart of Indian meal, sifted.
A heaping spoonful of butter.
One quart of milk, and a salt spoonful of salt.
Two tablespoonfuls of distillery yeast, and one of molasses.
Let it rise four or five hours. Bake in muffin rings.
The same will answer to bake in shallow pans, like corn cake. Bake
one hour.
Graham, or unbolted flour, is good made by this receipt.
Savoy Biscuit.
Beat six eggs into one pound of sugar, until white. Grate the outside
of a lemon into it, mix in three quarters of a pound of flour, and drop
them on buttered paper, a spoonful at a time.
Cream Cakes.
One quart of cream.
One quart of sifted flour.
One salt spoon of salt.
A wine-glass of distillery yeast, or twice as much home-brewed.
When quite light, bake in cups, or muffin rings.
Wheat Muffins.
One pint of milk, and two eggs.
One tablespoonful of yeast, and a salt spoonful of salt.
Mix these ingredients with sufficient flour to make a thick batter. Let
it rise four or five hours, and bake in muffin rings. This can be made
of unbolted flour, adding two great spoonfuls of molasses, and it is
very fine.
Sally Lunn.
Seven cups of sifted flour.
Half a tea-cup of butter, warmed in a pint of milk.
One salt spoonful of salt, and three well-beaten eggs.
Two tablespoonfuls brewer’s yeast. If the yeast is home-made, use
twice as much.
Pour this into square pans, to rise, and then bake it before it sours.
With brewer’s, or distillery yeast, it will rise in two or three hours,
and must not be made over night. With home-brewed yeast, it rises
in four or five hours.
Wafers.
Two tablespoonfuls of rolled white sugar.
Two tablespoonfuls of butter.
One coffee-cup of flour, and essence of lemon, or rose water to
flavor.
Add milk enough for a thick batter, bake in wafer irons, buttered,
and then strew on white sugar.
Scarborough Puffs.
Take one pint of new milk, and boil it. Take out one cup full, and stir
into it flour enough to make a thick batter. Pour this into the boiling
milk. Stir and boil until the whole is thick enough to hold a silver
spoon standing upright. Then take it from the fire, and stir in six
eggs, one by one. Add a teaspoonful of salt, and less than a
tablespoonful of butter. Drop them by the spoonful into boiling lard,
and fry like doughnuts. Grate on the outside sugar and spice.—
(Maine Receipt.)
Crumpets.
A quart of warm milk, and a teaspoonful of salt.
Half a gill of distillery yeast, and flour enough for a batter, not very
stiff.
When light, add half a cup of melted butter, or a cup of rich cream,
let it stand twenty minutes, and then bake it as muffins, or in cups.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com