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
ISBN 978-3-319-65069-2 ISBN 978-3-319-65070-8 (eBook)
DOI 10.1007/978-3-319-65070-8
Library of Congress Control Number: 2017949120
© Springer International Publishing AG 2017
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology
now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book
are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or
the editors give a warranty, express or implied, with respect to the material contained herein or for any
errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
Printed on acid-free paper
This Springer imprint is published by Springer Nature
The registered company is Springer International Publishing AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface
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
As an additional benefit from introducing MATLAB, we are able to improve stu-
dents’ understanding of important elements of the traditional syllabus. Our students
are better able to visualize regions in the plane and in space. They develop a better
feel for the geometric meaning of the gradient; for the method of steepest descent;
for the orthogonality of level curves and gradient flows. Because they have tools for
visualizing cross sections of solids, they are better able to find the limits of integra-
tion in multiple integrals.
To summarize, we think this book is special because, by using it:
• students obtain a better understanding of the traditional material;
• students see the deep connections between mathematics and science;
• students learn more about the intrinsic geometry of curves and surfaces;
• students acquire skill using MATLAB, a powerful piece of modern mathematical
software;
• instructors can choose from a more exciting variety of problems than in standard
textbooks; and
• both students and instructors are exposed to a more holistic approach to the
subject—one that embraces not only algebraic/calculus-based solutions to prob-
lems, but also numerical, graphical/geometric and qualitative approaches to the
subject and its problems.
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.
College Park, MD, USA Ronald L. Lipsman
October 1, 2017 Jonathan M. Rosenberg
Contents
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
2 Vectors and Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.1 Applications of Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2 Parametric Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.3 Graphing Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.4 Parametric Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Problem Set B. Vectors and Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Glossary of MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Options to MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
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
3.2.3 Curvature and Torsion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3 Differential Geometry of Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.3.1 The Osculating Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.3.2 Plane Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.3 Spherical Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.4 Helical Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.5 Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3.6 Two More Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Problem Set C. Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Glossary of MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
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
7 Optimization in Several Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
7.1 The One-Variable Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
7.1.1 Analytic Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
7.1.2 Numerical Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
7.1.3 Newton’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
7.2 Functions of Two Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
7.2.1 Second Derivative Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
7.2.2 Steepest Descent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
7.2.3 Multivariable Newton’s Method . . . . . . . . . . . . . . . . . . . . . . . 133
7.3 Three or More Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
7.4 Constrained Optimization and Lagrange Multipliers . . . . . . . . . . . . . . 136
Problem Set G. Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Glossary of MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
8 Multiple Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
8.1 Automation and Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
8.1.1 Regions in the Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
8.1.2 Viewing Simple Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
8.1.3 Polar Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
8.2 Algorithms for Numerical Integration . . . . . . . . . . . . . . . . . . . . . . . . . . 156
8.2.1 Algorithms for Numerical Integration in a Single
Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
8.2.2 Algorithms for Numerical Multiple Integration . . . . . . . . . . . 157
8.3 Viewing Solid Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
8.4 A More Complicated Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
8.5 Cylindrical Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
8.6 More General Changes of Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . 170
Problem Set H. Multiple Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Glossary of MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
9 Multidimensional Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
9.1 The Fundamental Theorem of Line Integrals . . . . . . . . . . . . . . . . . . . . 186
9.2 Green’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
9.3 Stokes’ Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
9.4 The Divergence Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
9.5 Vector Calculus and Physics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Problem Set I. Multivariable Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Glossary of MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Options to MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
xii Contents
10 Physical Applications of Vector Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . 205
10.1 Motion in a Central Force Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
10.2 Newtonian Gravitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
10.3 Electricity and Magnetism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
10.4 Fluid Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
10.5 Heat and Wave Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
10.5.1 The Heat Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
10.5.2 The Wave Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Problem Set J. Physical Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Glossary of MATLAB Commands and Options . . . . . . . . . . . . . . . . . . . . . . 232
Options to MATLAB Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Appendix: Energy Minimization and Laplace’s Equation . . . . . . . . . . . . . . 233
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11 MATLAB Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
12 Sample Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
12.1 Problem Set A: Problem 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
12.2 Problem Set B: Problem 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
12.3 Problem Set C: Problem 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
12.4 Problem Set D: Problem 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
12.5 Problem Set E: Problem 5, Parts (b) and (c) . . . . . . . . . . . . . . . . . . . . . 251
12.6 Problem Set F: Problem 10, Part (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
12.7 Problem Set G: Problem 10, Part (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
12.8 Problem Set H: Problem 2, Parts (c) and (d) . . . . . . . . . . . . . . . . . . . . 260
12.9 Problem Set I: Problems 4(b) and 5(a) . . . . . . . . . . . . . . . . . . . . . . . . . 263
12.10 Problem Set J: Problem 3, Parts (a) and (b), but only subpart (ii) . . . 265
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269