Table Of ContentCognitive Science and Technology
James K. Peterson
Calculus for
Cognitive
Scientists
Higher Order Models and Their Analysis
Cognitive Science and Technology
Series editor
David M.W. Powers, Adelaide, Australia
More information about this series at http://www.springer.com/series/11554
Theseadragonswereintriguedbycalculusandflockedtotheteacher
James K. Peterson
Calculus for Cognitive
Scientists
Higher Order Models and Their Analysis
123
James K.Peterson
Department ofMathematical Sciences
Clemson University
Clemson, SC
USA
ISSN 2195-3988 ISSN 2195-3996 (electronic)
Cognitive Science andTechnology
ISBN978-981-287-875-5 ISBN978-981-287-877-9 (eBook)
DOI 10.1007/978-981-287-877-9
LibraryofCongressControlNumber:2015958343
©SpringerScience+BusinessMediaSingapore2016
Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpart
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
orinformationstorageandretrieval,electronicadaptation,computersoftware,orbysimilarordissimilar
methodologynowknownorhereafterdeveloped.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this
publicationdoesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfrom
therelevantprotectivelawsandregulationsandthereforefreeforgeneraluse.
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
authorsortheeditorsgiveawarranty,expressorimplied,withrespecttothematerialcontainedhereinor
foranyerrorsoromissionsthatmayhavebeenmade.
Printedonacid-freepaper
ThisSpringerimprintispublishedbySpringerNature
TheregisteredcompanyisSpringerScience+BusinessMediaSingaporePteLtd.
I dedicate this work to the biology students
who have learned this material over the last
10 semesters, the practicing biologists, the
immunologists, the cognitive scientists, and
the computer scientists who have helped an
outsider think much better and to my family
who have listened to my ideas in the living
room and over dinner for many years. I hope
that this text helps inspire everyone who
works inscience toconsider mathematics and
computer science as indispensable tools in
their own work in the biological sciences.
Acknowledgments
We would like to thank all the students who have used the various iterations
of these notes as they have evolved from handwritten to the fourth fully typed
versionhere.Weparticularlyappreciateyourinterestasthiscourseisrequiredand
uses mathematics; a combination that causes fear in many biological science
majors. We have been pleased by the enthusiasm you have brought to this inter-
esting combination of ideas from many disciplines. Finally, we gratefully
acknowledgethesupportofHapWheelerintheDepartmentofBiologicalSciences
during the years 2006 to 2014 for believing that this material would be useful to
biology students.
For this new text on a follow-up course to the first course on calculus for
cognitivescientists,wewouldliketothankallofthestudentsfromSpring2006to
Fall2014fortheircommentsandpatiencewiththeinevitabletypographicalerrors,
mistakes in the way we explained topics, and organizational flaws as we have
taughtsecondsemesterofcalculusideastothem.Thisnewtextstartsassumingyou
know something the equivalent of a first semester course in calculus and particu-
larly know about exponential and logarithm functions, first-order models and the
MATLAB tools needed to solve the models numerically. In addition, you need to
know a fair bit of a start into calculus for functions of more than one variable and
the ideas of approximation to functions of one and two variables. These are not
really standard topicsinjustone course incalculus, whichiswhy ourfirst volume
was written to provide coverage of all those things. In addition, all of the mathe-
matics subserve ideas from biological models so that everything is wrapped toge-
ther in a pleasing package!
With that background given, in this text, we add new material on linear and
nonlinearsystemsmodelsandmorebiologicalmodels.Wealsocoverausefulway
of solving what are called linear partial differential equations using the technique
vii
viii Acknowledgments
namedSeparationofVariables.Tomakesenseofallthis,wenaturallyhavetodip
into mathematical waters at appropriate points and we are not shy about that! But
restassured,everythingwedoiscarefullyplannedbecauseitisofgreatusetoyou
in your attempts to forge an alliance between cognitive science, mathematics, and
computation.
Contents
Part I Introduction
1 Introductory Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 A Roadmap to the Text. . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Final Thoughts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Part II Review
2 Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1 The Inner Product of Two Column Vectors. . . . . . . . . . . . . . 11
2.1.1 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2 Interpreting the Inner Product. . . . . . . . . . . . . . . . . . . . . . . . 13
2.2.1 Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.2 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 Determinants of 2(cid:1)2 Matrices . . . . . . . . . . . . . . . . . . . . . . 19
2.3.1 Worked Out Problems. . . . . . . . . . . . . . . . . . . . . . 20
2.3.2 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.4 Systems of Two Linear Equations. . . . . . . . . . . . . . . . . . . . . 21
2.4.1 Worked Out Examples. . . . . . . . . . . . . . . . . . . . . . 23
2.4.2 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.5 Solving Two Linear Equations in Two Unknowns . . . . . . . . . 25
2.5.1 Worked Out Examples. . . . . . . . . . . . . . . . . . . . . . 28
2.5.2 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.6 Consistent and Inconsistent Systems. . . . . . . . . . . . . . . . . . . 31
2.6.1 Worked Out Examples. . . . . . . . . . . . . . . . . . . . . . 33
2.6.2 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.7 Specializing to Zero Data . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.7.1 Worked Out Examples. . . . . . . . . . . . . . . . . . . . . . 37
2.7.2 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
ix
x Contents
2.8 Matrix Inverses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.8.1 Worked Out Examples. . . . . . . . . . . . . . . . . . . . . . 40
2.8.2 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.9 Computational Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . 42
2.9.1 A Simple Lower Triangular System . . . . . . . . . . . . 42
2.9.2 A Lower Triangular Solver . . . . . . . . . . . . . . . . . . 43
2.9.3 An Upper Triangular Solver. . . . . . . . . . . . . . . . . . 43
2.9.4 The LU Decomposition of A Without Pivoting. . . . . 44
2.9.5 The LU Decomposition of A with Pivoting . . . . . . . 48
2.10 Eigenvalues and Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . 50
2.10.1 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.10.2 The General Case. . . . . . . . . . . . . . . . . . . . . . . . . 56
2.10.3 The MatLab Approach. . . . . . . . . . . . . . . . . . . . . . 57
Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3 Numerical Methods Order One ODEs. . . . . . . . . . . . . . . . . . . . . . 61
3.1 Taylor Polynomials. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.1.1 Fundamental Tools . . . . . . . . . . . . . . . . . . . . . . . . 62
3.1.2 The Zeroth Order Taylor Polynomial. . . . . . . . . . . . 63
3.1.3 The First Order Taylor Polynomial . . . . . . . . . . . . . 64
3.1.4 Quadratic Approximations . . . . . . . . . . . . . . . . . . . 67
3.2 Euler’s Method with Time Independence. . . . . . . . . . . . . . . . 69
3.3 Euler’s Method with Time Dependence. . . . . . . . . . . . . . . . . 74
3.3.1 Lipschitz Functions and Taylor Expansions . . . . . . . 74
3.4 Euler’s Algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.4.1 Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.5 Runge–Kutta Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.5.1 The MatLab Implementation . . . . . . . . . . . . . . . . . 81
4 Multivariable Calculus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.1 Functions of Two Variables. . . . . . . . . . . . . . . . . . . . . . . . . 85
4.1.1 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
4.2 Continuity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
4.3 Partial Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.3.1 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
4.4 Tangent Planes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
4.4.1 The Vector Cross Product . . . . . . . . . . . . . . . . . . . 98
4.4.2 Back to Tangent Planes. . . . . . . . . . . . . . . . . . . . . 102
4.4.3 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
4.4.4 Computational Results. . . . . . . . . . . . . . . . . . . . . . 104
4.4.5 Homework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
4.5 Derivatives in Two Dimensions!. . . . . . . . . . . . . . . . . . . . . . 106
4.6 The Chain Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
4.6.1 Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110