Maple by Example Third Edition Martha L. Abell and James P. Braselton Amsterdam Boston Heidelberg London NewYork Oxford Paris SanDiego SanFrancisco Singapore Sydney Tokyo SeniorAcquisitionEditor BarbaraHolland ProjectManager BrandyLilly AssociateEditor TomSinger MarketingManager LindaBeattie CoverDesign EricDeCicco Composition Cepha CoverPrinter PhoenixColor InteriorPrinter MapleVailBookManufacturingGroup ElsevierAcademicPress 30CorporateDrive,Suite400,Burlington,MA01803,USA 525BStreet,Suite1900,SanDiego,California92101-4495,USA 84Theobald’sRoad,LondonWC1X8RR,UK Thisbookisprintedonacid-freepaper. Copyright©2005,ElsevierInc.Allrightsreserved. Nopartofthispublicationmaybereproducedortransmittedinanyformorbyany means,electronicormechanical,includingphotocopy,recording,oranyinformation storageandretrievalsystem,withoutpermissioninwritingfromthepublisher. PermissionsmaybesoughtdirectlyfromElsevier’sScience&TechnologyRights DepartmentinOxford,UK:phone:(+44)1865843830,fax:(+44)1865853333,e-mail: permissions@elsevier.com.uk.Youmayalsocompleteyourrequeston-lineviatheElsevier homepage(http://elsevier.com),byselecting“CustomerSupport”andthen“Obtaining Permissions.” LibraryofCongressCataloging-in-PublicationData Applicationsubmitted BritishLibraryCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary ISBN: 0-12-088526-3 ForallinformationonallElsevierAcademicPressPublications visitourWebsiteatwww.books.elsevier.com PRINTEDINTHEUNITEDSTATESOFAMERICA 05 06 07 08 09 10 9 8 7 6 5 4 3 2 1 Contents Preface ix 1 GettingStarted 1 1.1 IntroductiontoMaple . . . . . . . . . . . . . . . . . . . . . . . . 1 ANoteRegardingDifferentVersionsofMaple . . . . . . . . . . . 2 1.1.1 GettingStartedwithMaple . . . . . . . . . . . . . . . . . 3 Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2 LoadingPackages . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3 GettingHelpfromMaple . . . . . . . . . . . . . . . . . . . . . . . 11 MapleHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 TheMapleMenu . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2 BasicOperationsonNumbers,Expressions,andFunctions 19 2.1 NumericalCalculationsandBuilt-InFunctions . . . . . . . . . . . 19 2.1.1 NumericalCalculations . . . . . . . . . . . . . . . . . . . 19 2.1.2 Built-InConstants . . . . . . . . . . . . . . . . . . . . . . 22 2.1.3 Built-InFunctions . . . . . . . . . . . . . . . . . . . . . . 23 AWordofCaution . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.2 ExpressionsandFunctions:ElementaryAlgebra . . . . . . . . . . 27 2.2.1 BasicAlgebraicOperationsonExpressions . . . . . . . . . 27 2.2.2 NamingandEvaluatingExpressions . . . . . . . . . . . . 31 TwoWordsofCaution . . . . . . . . . . . . . . . . . . . . . . . . 33 2.2.3 DefiningandEvaluatingFunctions . . . . . . . . . . . . . 33 2.3 GraphingFunctions,Expressions,andEquations . . . . . . . . . . 40 2.3.1 FunctionsofaSingleVariable . . . . . . . . . . . . . . . . 40 2.3.2 ParametricandPolarPlotsinTwoDimensions . . . . . . 51 v vi Contents 2.3.3 Three-DimensionalandContourPlots;Graphing Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.3.4 ParametricCurvesandSurfacesinSpace . . . . . . . . . . 66 2.4 SolvingEquationsandInequalities . . . . . . . . . . . . . . . . . 73 2.4.1 ExactSolutionsofEquations . . . . . . . . . . . . . . . . 73 2.4.2 SolvingInequalities . . . . . . . . . . . . . . . . . . . . . 82 2.4.3 ApproximateSolutionsofEquations . . . . . . . . . . . . 84 3 Calculus 91 3.1 Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 3.1.1 UsingGraphsandTablestoPredictLimits . . . . . . . . . 91 3.1.2 ComputingLimits . . . . . . . . . . . . . . . . . . . . . . 93 3.1.3 One-SidedLimits . . . . . . . . . . . . . . . . . . . . . . . 96 3.2 DifferentialCalculus . . . . . . . . . . . . . . . . . . . . . . . . . 98 3.2.1 DefinitionoftheDerivative . . . . . . . . . . . . . . . . . 98 3.2.2 CalculatingDerivatives . . . . . . . . . . . . . . . . . . . 102 3.2.3 ImplicitDifferentiation . . . . . . . . . . . . . . . . . . . 105 3.2.4 TangentLines . . . . . . . . . . . . . . . . . . . . . . . . 105 3.2.5 TheFirstDerivativeTestandSecondDerivativeTest . . . 116 3.2.6 AppliedMax/MinProblems . . . . . . . . . . . . . . . . 121 3.2.7 Antidifferentiation . . . . . . . . . . . . . . . . . . . . . . 131 3.3 IntegralCalculus . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 3.3.1 Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 3.3.2 TheDefiniteIntegral . . . . . . . . . . . . . . . . . . . . . 139 3.3.3 ApproximatingDefiniteIntegrals . . . . . . . . . . . . . . 144 3.3.4 Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 3.3.5 ArcLength . . . . . . . . . . . . . . . . . . . . . . . . . . 154 3.3.6 SolidsofRevolution . . . . . . . . . . . . . . . . . . . . . 158 3.4 Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 3.4.1 IntroductiontoSequencesandSeries . . . . . . . . . . . . 164 3.4.2 ConvergenceTests . . . . . . . . . . . . . . . . . . . . . . 170 3.4.3 AlternatingSeries . . . . . . . . . . . . . . . . . . . . . . 174 3.4.4 PowerSeries . . . . . . . . . . . . . . . . . . . . . . . . . 176 3.4.5 TaylorandMaclaurinSeries . . . . . . . . . . . . . . . . . 179 3.4.6 Taylor’sTheorem . . . . . . . . . . . . . . . . . . . . . . 185 3.4.7 OtherSeries . . . . . . . . . . . . . . . . . . . . . . . . . 188 3.5 Multi-VariableCalculus . . . . . . . . . . . . . . . . . . . . . . . 190 3.5.1 LimitsofFunctionsofTwoVariables . . . . . . . . . . . . 190 3.5.2 PartialandDirectionalDerivatives . . . . . . . . . . . . . 193 3.5.3 IteratedIntegrals . . . . . . . . . . . . . . . . . . . . . . . 212 4 IntroductiontoListsandTables 223 4.1 ListsandListOperations . . . . . . . . . . . . . . . . . . . . . . . 223 Contents vii 4.1.1 DefiningLists. . . . . . . . . . . . . . . . . . . . . . . . . 223 4.1.2 PlottingListsofPoints . . . . . . . . . . . . . . . . . . . . 227 4.2 ManipulatingLists:Moreonopandmap . . . . . . . . . . . . . . 238 4.2.1 MoreonGraphingLists . . . . . . . . . . . . . . . . . . . 247 4.3 MathematicsofFinance . . . . . . . . . . . . . . . . . . . . . . . 253 4.3.1 CompoundInterest . . . . . . . . . . . . . . . . . . . . . 254 4.3.2 FutureValue . . . . . . . . . . . . . . . . . . . . . . . . . 256 4.3.3 AnnuityDue . . . . . . . . . . . . . . . . . . . . . . . . . 257 4.3.4 PresentValue . . . . . . . . . . . . . . . . . . . . . . . . . 259 4.3.5 DeferredAnnuities . . . . . . . . . . . . . . . . . . . . . . 260 4.3.6 Amortization . . . . . . . . . . . . . . . . . . . . . . . . . 262 4.3.7 MoreonFinancialPlanning . . . . . . . . . . . . . . . . . 267 4.4 OtherApplications . . . . . . . . . . . . . . . . . . . . . . . . . . 274 4.4.1 ApproximatingListswithFunctions . . . . . . . . . . . . 274 4.4.2 IntroductiontoFourierSeries . . . . . . . . . . . . . . . . 281 4.4.3 TheMandelbrotSetandJuliaSets . . . . . . . . . . . . . . 294 5 MatricesandVectors:TopicsfromLinearAlgebraandVector Calculus 311 5.1 NestedLists:IntroductiontoMatrices,Vectors,and MatrixOperations . . . . . . . . . . . . . . . . . . . . . . . . . . 312 5.1.1 DefiningNestedLists,Matrices,andVectors . . . . . . . . 312 5.1.2 ExtractingElementsofMatrices . . . . . . . . . . . . . . . 320 5.1.3 BasicComputationswithMatrices . . . . . . . . . . . . . 322 5.1.4 BasicComputationswithVectors . . . . . . . . . . . . . . 328 5.2 LinearSystemsofEquations . . . . . . . . . . . . . . . . . . . . . 336 5.2.1 CalculatingSolutionsofLinearSystemsofEquations . . . 336 5.2.2 Gauss-JordanElimination . . . . . . . . . . . . . . . . . . 342 5.3 SelectedTopicsfromLinearAlgebra . . . . . . . . . . . . . . . . 349 5.3.1 FundamentalSubspacesAssociatedwithMatrices . . . . . 349 5.3.2 TheGram-SchmidtProcess . . . . . . . . . . . . . . . . . 352 5.3.3 LinearTransformations . . . . . . . . . . . . . . . . . . . 355 5.3.4 EigenvaluesandEigenvectors . . . . . . . . . . . . . . . . 360 5.3.5 JordanCanonicalForm . . . . . . . . . . . . . . . . . . . 365 5.3.6 TheQRMethod . . . . . . . . . . . . . . . . . . . . . . . 369 5.4 MaximaandMinimaUsingLinearProgramming . . . . . . . . . 372 5.4.1 TheStandardFormofaLinearProgrammingProblem . . 372 5.4.2 TheDualProblem . . . . . . . . . . . . . . . . . . . . . . 375 5.5 SelectedTopicsfromVectorCalculus . . . . . . . . . . . . . . . . 384 5.5.1 Vector-ValuedFunctions . . . . . . . . . . . . . . . . . . 384 5.5.2 LineIntegrals . . . . . . . . . . . . . . . . . . . . . . . . . 397 5.5.3 SurfaceIntegrals . . . . . . . . . . . . . . . . . . . . . . . 401 5.5.4 ANoteonNonorientability . . . . . . . . . . . . . . . . . 406 viii Contents 6 ApplicationsRelatedtoOrdinaryandPartialDifferentialEquations 417 6.1 First-OrderDifferentialEquations . . . . . . . . . . . . . . . . . . 417 6.1.1 SeparableEquations . . . . . . . . . . . . . . . . . . . . . 417 6.1.2 LinearEquations . . . . . . . . . . . . . . . . . . . . . . . 422 6.1.3 NonlinearEquations . . . . . . . . . . . . . . . . . . . . . 433 6.1.4 NumericalMethods . . . . . . . . . . . . . . . . . . . . . 437 6.2 Second-OrderLinearEquations . . . . . . . . . . . . . . . . . . . 443 6.2.1 BasicTheory . . . . . . . . . . . . . . . . . . . . . . . . . 443 6.2.2 ConstantCoefficients . . . . . . . . . . . . . . . . . . . . 444 6.2.3 UndeterminedCoefficients . . . . . . . . . . . . . . . . . 452 6.2.4 VariationofParameters . . . . . . . . . . . . . . . . . . . 457 6.3 Higher-OrderLinearEquations . . . . . . . . . . . . . . . . . . . 460 6.3.1 BasicTheory . . . . . . . . . . . . . . . . . . . . . . . . . 460 6.3.2 ConstantCoefficients . . . . . . . . . . . . . . . . . . . . 460 6.3.3 UndeterminedCoefficients . . . . . . . . . . . . . . . . . 463 6.3.4 LaplaceTransformMethods . . . . . . . . . . . . . . . . . 473 6.3.5 NonlinearHigher-OrderEquations . . . . . . . . . . . . . 486 6.4 SystemsofEquations . . . . . . . . . . . . . . . . . . . . . . . . . 487 6.4.1 LinearSystems . . . . . . . . . . . . . . . . . . . . . . . . 487 6.4.2 NonhomogeneousLinearSystems . . . . . . . . . . . . . 498 6.4.3 NonlinearSystems . . . . . . . . . . . . . . . . . . . . . . 502 6.5 SomePartialDifferentialEquations . . . . . . . . . . . . . . . . . 518 6.5.1 TheOne-DimensionalWaveEquation . . . . . . . . . . . 519 6.5.2 TheTwo-DimensionalWaveEquation . . . . . . . . . . . 524 6.5.3 OtherPartialDifferentialEquations . . . . . . . . . . . . . 534 Bibliography 539 SubjectIndex 541 Preface Maple by Example bridges the gap that exists between the very elementary handbooksavailableonMapleandthosereferencebookswrittenfortheadvanced Maple users. Maple by Example is an appropriate reference for all users of Maple and,inparticular,forbeginninguserslikestudents,instructors,engineers,business people,andotherprofessionalsfirstlearningtouseMaple.MaplebyExampleintro- ducestheverybasiccommandsandincludestypicalexamplesofapplicationsof thesecommands.Inaddition,thetextalsoincludescommandsusefulinareassuch ascalculus,linearalgebra,businessmathematics,ordinaryandpartialdifferential equations, andgraphics. Inallcases, however, examplesfollowtheintroduction ofnewcommands.Readersfromthemostelementarytoadvancedlevelswillfind thattherangeoftopicscoveredaddressestheirneeds. TakingadvantageofVersion9ofMaple,MaplebyExample,ThirdEdition,intro- ducesthefundamentalconceptsofMapletosolvetypicalproblemsofinterestto students,instructors,andscientists.OtherfeaturestohelpmakeMaplebyExample, ThirdEdition,aseasytouseandasusefulaspossibleincludethefollowing. 1. Version 9 Compatibility. All examples illustrated in Maple by Example, Third Edition,werecompletedusingVersion9ofMaple.Althoughmostcomputations cancontinuetobecarriedoutwithearlierversionsofMaple,likeVersions5–8, wehavetakenadvantageofthenewfeaturesinVersion9asmuchaspossible. 2. Applications. New applications, many of which are documented by refer- ences, from a variety of fields, especially biology, physics, and engineering, areincludedthroughoutthetext. 3. DetailedTableofContents.Thetableofcontentsincludesallchapter,section, and subsection headings. Along with the comprehensive index, we hope that userswillbeabletolocateinformationquicklyandeasily. ix x Preface 4. Additional Examples. We have considerably expanded the topics in Chap- ters 1 through 6. The results should be more useful to instructors, students, businesspeople,engineers,andotherprofessionalsusingMapleonavarietyof platforms.Inaddition,severalsectionshavebeenaddedtohelpmakelocating informationeasierfortheuser. 5. ComprehensiveIndex. Intheindex, mathematicalexamplesandapplications arelistedbytopic, orname, aswellascommandsalongwithfrequentlyused options:particularmathematicalexamplesaswellasexamplesillustratinghow tousefrequentlyusedcommandsareeasytolocate.Inaddition,commandsin theindexarecross-referencedwithfrequentlyusedoptions.Functionsavailable inthevariouspackagesarecross-referencedbothbypackageandalphabetically. 6. IncludedCD.AllMaplecodethatappearsinMaplebyExample,ThirdEdition, isincludedontheCDpackagedwiththetext. WebeganMaplebyExamplein1991andthefirsteditionwaspublishedin1992. Backthen,wewereontopoftheworldusingMacintoshIIcx’swith8megsofRAM and40megharddrives. Wetriedtochooseexamplesthatwethoughtwouldbe relevanttobeginningusers–typicallyinthecontextofmathematicsencountered in the undergraduate curriculum. Those examples could also be carried out by MapleinatimelymanneronacomputeraspowerfulasaMacintoshIIcx. Now,weareontopoftheworldwithPowerMacintoshG4’swith768megsof RAMand50gigharddrives,whichwillalmostcertainlybeobsoletebythetime youarereadingthis. TheexamplespresentedinMaplebyExample continuetobe theonesthatwethinkaremostsimilartotheproblemsencounteredbybeginning usersandarepresentedinthecontextofsomeonefamiliarwithmathematicstyp- ically encountered by undergraduates. However, for this third edition of Maple by Example we have taken the opportunity to expand on several of our favorite examplesbecausethemachinesnowhavethespeedandpowertoexplorethemin greaterdetail. Otherimprovementstothethirdeditioninclude: 1. Throughoutthetext,wehaveattemptedtoeliminateredundantexamplesand added several interesting ones. The following changes are especially worth noting. (a) In Chapter 2, we have increased the number of parametric and polar plots intwoandthreedimensions.Forasample,seeExamples2.3.8,2.3.9,2.3.10, 2.3.11,2.3.17,and2.3.18. (b) In Chapter 3, Calculus, we have added examples dealing with parametric andpolarcoordinatestoeverysection. Examples3.2.9, 3.3.9, and3.3.10are newexamplesworthnoting. Preface xi (c) Chapter4, IntroductiontoListsandTables, containsseveralnewexamples illustrating various techniques of how to quickly create plots of bifurcation diagrams,Juliasets,andtheMandelbrotset.SeeExamples4.1.7,4.2.5,4.2.7, 4.4.6,4.4.7,4.4.8,4.4.9,4.4.10,4.4.11,4.4.12,and4.4.13. (d) Several examples illustrating how to determine graphically if a surface is nonorientable have been added to Chapter 5, Matrices and Vectors. See especiallyExamples5.5.8and5.5.9. (e) Chapter 6, Differential Equations, has been completely reorganized. More basic–andmoredifficult–exampleshavebeenaddedthroughout. 2. WehaveincludedreferencesthatwefindparticularlyinterestingintheBibli- ography,eveniftheyarenotspecificMaple-relatedtexts.Acomprehensivelist ofMaple-relatedpublicationscanbefoundattheMaplewebsite. http://www.maplesoft.com/publications/ Finally,wemustexpressourappreciationtothosewhoassistedinthisproject. We would like to express appreciation to our editors, Tom Singer and Barbara Holland,andourproductioneditor,BrandyLilly,atAcademicPressforproviding apleasantenvironmentinwhichtowork.Inaddition,FrancesMorgan,ourproject manageratKeywordTypesettingServices,deservesthanksformakingtheproduc- tionprocessrunsmoothly.Finally,wethankthoseclosetous,especiallyImogene Abell,LoriBraselton,AdaBraselton,andMattieBraseltonforenduringwithusthe pressuresofmeetingadeadlineandforgraciouslyacceptingourdemandingwork schedules.Wecertainlycouldnothavecompletedthistaskwithouttheircareand understanding. MarthaAbell (email:[email protected]) JamesBraselton (email:[email protected]) Statesboro,Georgia June,2004 1 Getting Started 1.1 Introduction to Maple Maple,firstreleasedin1981byWaterlooMaple,Inc., http://www.maplesoft.com/, is a system for doing mathematics on a computer. Maple combines symbolic manipulation, numerical mathematics, outstanding graphics, and a sophisti- cated programming language. Because of its versatility, Maple has established itself as the computer algebra system of choice for many computer users includ- ing commercial and government scientists and engineers, mathematics, science, andengineeringteachersandresearchers,andstudentsenrolledinmathematics, science, andengineeringcourses. However, duetoitsspecialnatureandsophis- tication,beginningusersneedtobeawareofthespecialsyntaxrequiredtomake Mapleperforminthewayintended.Youwillfindthatcalculationsandsequences of calculations most frequently used by beginning users are discussed in detail alongwithmanytypicalexamples.Inaddition,thecomprehensiveindexnotonly listsavarietyoftopicsbutalsocross-referencescommandswithfrequentlyused options.MaplebyExampleservesasavaluabletoolandreferencetothebeginning userofMapleaswellastothemoresophisticateduser,withspecializedneeds. Forinformation,includingpurchasinginformation,aboutMaplecontact: CorporateHeadquarters: Maplesoft 615KumpfDrive,Waterloo Ontario,CanadaN2V1K8 telephone:519-747-2373 fax:519-747-5284 1