mathematica DeMYSTiFieD A SELF-TEACHING GUIDE Full coverage of Mathematica Versions 6 and7(( Explains 2D and 3D graphing, CALCULUS differential equations, dynamical systems, FRACTALS, and more Filled with HUNDREDS of worked EXAMPLES and explanations COMPLETE with chapter-ending QUIzZES and a final EXAM Mc Jim Hoste 多
Mathematica Demystified
Mathematica Demystified
Demystified Series JavaScript Demystify Advanced Calculus Demyst Latin Demystified Advanced Physics Demystified Lean Six Sigma demysti Advanced Statistics Demystified Linear Algebra Demystified Algebra Demystified Macroeconomics Demystified Alternative Energy Demystified Management Accounting Demystified Anatomy Demystified Mathematica demystified Math Proofs demystified Math Word Problems Demystified MATLAB③ 9 Demystified Biology Demystified Biotechnology demystified Medical Charting Demystified Business Calculus Demystified Medical-Surgical Nursing Demystified Business Math Demystified Medical terminolo C++ Demystified Meteorology Demystified Calculus Demystified Microbiology Demystified Chemistry Demystified Microeconomics Demystified Circuit Analysis Demystified Nanotechnology Demystified College Algebra Demystified se Management Demystified OOP Demystified omplex Variables Demystified Options Demystified Organic Chemistry Demystified Pharmacology Demystified Diabetes Demystified Physics Demystified Diferential Equations Demystified Physiology demystified g Discrete Mathematics demystified Dosage Calculations Demystified PPP Earth Science Demystified Project Management Demystified lectricity Demystified Psychology demystified Electronics Demystified Quantum Field Theory Demystified Environmental science i Quantum Mecha Everyday Math Dems Real Estate Math Demystified Fertility Demystified Relativity Demystified Financial Planning Demystified Robotics Demystified prensics Demystified Sales management Demystified Signals and Systems Demystified German Demystified L Global Warming and Climate Change Demystified String Theory Demystified Investing Demystified Technical Analysis Demystified Italian Demystified Technical Math Demystified Japanese Demystified Trigonon Java Demystified Vitamins and Minerals Demystified
Demystified Series Accounting Demystified Advanced Calculus Demystified Advanced Physics Demystified Advanced Statistics Demystified Algebra Demystified Alternative Energy Demystified Anatomy Demystified Astronomy Demystified Audio Demystified Biochemistry Demystified Biology Demystified Biotechnology Demystified Business Calculus Demystified Business Math Demystified C++ Demystified Calculus Demystified Chemistry Demystified Circuit Analysis Demystified College Algebra Demystified Commodities Demystified Complex Variables Demystified Corporate Finance Demystified Databases Demystified Diabetes Demystified Differential Equations Demystified Digital Electronics Demystified Discrete Mathematics Demystified Dosage Calculations Demystified Earth Science Demystified Electricity Demystified Electronics Demystified Environmental Science Demystified Everyday Math Demystified Fertility Demystified Financial Planning Demystified Forensics Demystified French Demystified Genetics Demystified Geometry Demystified German Demystified Global Warming and Climate Change Demystified Hedge Funds Demystified Investing Demystified Italian Demystified Japanese Demystified Java Demystified JavaScript Demystified Latin Demystified Lean Six Sigma Demystified Linear Algebra Demystified Macroeconomics Demystified Management Accounting Demystified Mathematica Demystified Math Proofs Demystified Math Word Problems Demystified MATLABR Demystified Medical Billing and Coding Demystified Medical Charting Demystified Medical-Surgical Nursing Demystified Medical Terminology Demystified Meteorology Demystified Microbiology Demystified Microeconomics Demystified Nanotechnology Demystified Nurse Management Demystified OOP Demystified Options Demystified Organic Chemistry Demystified Pharmacology Demystified Physics Demystified Physiology Demystified Pre-Algebra Demystified Precalculus Demystified Probability Demystified Project Management Demystified Psychology Demystified Quantum Field Theory Demystified Quantum Mechanics Demystified Real Estate Math Demystified Relativity Demystified Robotics Demystified Sales Management Demystified Signals and Systems Demystified Six Sigma Demystified Spanish Demystified SQL Demystified Statistics Demystified String Theory Demystified Technical Analysis Demystified Technical Math Demystified Trigonometry Demystified Vitamins and Minerals Demystified
Mathematica Demystified Jim hoste Mc New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto
Mathematica Demystified Jim Hoste New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto
Copyright C 2009 by The McGraw-Hill Companies, Inc. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. SBN:978-0-07-159145-4 MHID:0-07-159145-1 The material in this e Book also appears in the print version of this title: ISBN: 978-0-07-159144-7, MHID: 0-07-159144-3 All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps McGraw-Hill e Books are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate trainingprogramsTocontactarepresentativepleasevisittheContactUspageatwww.mhprofessional.com Information contained in this work has been obtained by The McGraw-Hill Companies, Inc ("McGraw-Hill )from sources believe nformation. This work is published with the understanding that McGraw-Hill and its authors are supplying information but are not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought. TERMS OF USE This is a copyrighted work and The MeGraw-Hill Companies, Inc (McGraw-Hill )and its licensors reserve all rights in and to the based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hillsp.and work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to stor retrieve one copy of the work, pile. disassemble se engineer, reproduce, modify, create derivati right to use the work may be terminated if you fail to comply with these terms THE WORK IS PROVIDED"AS IS. MCGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE AND EXPRESSLY DISCLAIM ANY WARRANTY EXPRESS OR IMPLIED INCLUDING BUT NOT LIMIT. ED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and or guarantee that the functions contained in the work will meet your requirements or that its op will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, mission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise
Copyright © 2009 by The McGraw-Hill Companies, Inc. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. ISBN: 978-0-07-159145-4 MHID: 0-07-159145-1 The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-159144-7, MHID: 0-07-159144-3. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. To contact a representative please visit the Contact Us page at www.mhprofessional.com. Information contained in this work has been obtained by The McGraw-Hill Companies, Inc. (“McGraw-Hill”) from sources believed to be reliable. However, neither McGraw-Hill nor its authors guarantee the accuracy or completeness of any information published herein, and neither McGraw-Hill nor its authors shall be responsible for any errors, omissions, or damages arising out of use of this information. This work is published with the understanding that McGraw-Hill and its authors are supplying information but are not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior co sent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise
To Mary, Benjamin, and Graeme
To Mary, Benjamin, and Graeme
ABOUT THE AUTHOR Jim Hoste, Ph. D, is a mathematics professor at Pitzer College and has used Mathematica since its initial release in 1988. He has been an associate editor of the Journal of Knot Theory and Its Ramifications since 1991 and has authored dozens of research publications
ABOUT THE AUTHOR Jim Hoste, Ph.D., is a mathematics professor at Pitzer College and has used Mathematica since its initial release in 1988. He has been an associate editor of the Journal of Knot Theory and Its Ramifications since 1991 and has authored dozens of research publications
CONTENTS Preface Acknowledgments XVIl CHAPTER 1 Getting Started 1.1 Starting mathematica 1.2 Entering Expressions 1.3 Editing Cells 1.4 Basic Arithmeti 1.5 Using Previous Results 1.6 Exact versus Approximate 111234569 1.7 Using Functions 1.8 Using variables 1.9 Using Comments 1.10 Suppressing Output 13 1.11 Aborting a Calculation 1.12 Lists 1.13 Palettes 1.14 Saving and Printing Our Work 1.15 Getting Help 1.16 Find Out More
CONTENTS Preface xiii Acknowledgments xvii CHAPTER 1 Getting Started 1 1.1 Starting Mathematica 1 1.2 Entering Expressions 1 1.3 Editing Cells 2 1.4 Basic Arithmetic 3 1.5 Using Previous Results 4 1.6 Exact versus Approximate 5 1.7 Using Functions 6 1.8 Using Variables 9 1.9 Using Comments 12 1.10 Suppressing Output 13 1.11 Aborting a Calculation 16 1.12 Lists 17 1.13 Palettes 20 1.14 Saving and Printing Our Work 23 1.15 Getting Help! 23 1.16 Find Out More 25 Quiz 26
ⅷ Mathematica Demystified CHAPTER 2 Two-Dimensional graphics 2.1 The plot function 2.2 Resizing Graphics 31 2.3 Graphics Optior 2.4 Drawing Tools and the graphic Inspector 40 2.5 Using epile 2.7 Animation -Using Manipulate 2.8 Plotting Points with ListPlot 2.9 Curve Fitting 2.10 Plotting in Polar Coordinates 2.11 Parametric Plots 2.12 Drawing Shapes 2.13 Saving and Printing Graphics 2.14 Find out more 65 Quiz CHAPTER 3 Getting Help 3.1 Sy ng 3.2 Delimiter Matching 3.3 Setting Prefer 3.4 The Help 5 Writing Good 3.6 Monitoring calculations 3.7 Getting Out of Trouble 8 3. 8 Ask 84 3.9 Find Out more CHAPTER 4 Odds and ends 4.1 Transforming expressions 4.2 Replacement Rules 4.3 Working with Lis 100 4.4 Sums and Products 106
viii Mathematica Demystified CHAPTER 2 Two-Dimensional Graphics 29 2.1 The Plot Function 29 2.2 Resizing Graphics 31 2.3 Graphics Options 33 2.4 Drawing Tools and the Graphic Inspector 40 2.5 Using Epilog 42 2.6 Mouseover Effects---Tooltip 43 2.7 Animation---Using Manipulate 44 2.8 Plotting Points with ListPlot 46 2.9 Curve Fitting 49 2.10 Plotting in Polar Coordinates 52 2.11 Parametric Plots 55 2.12 Drawing Shapes 59 2.13 Saving and Printing Graphics 65 2.14 Find Out More 65 Quiz 66 CHAPTER 3 Getting Help 69 3.1 Syntax Coloring 69 3.2 Delimiter Matching 73 3.3 Setting Preferences 77 3.4 The Help Menu 78 3.5 Writing Good Code 79 3.6 Monitoring Calculations 82 3.7 Getting Out of Trouble 84 3.8 Ask an Expert 84 3.9 Find Out More 85 Quiz 85 CHAPTER 4 Odds and Ends 87 4.1 Transforming Expressions 87 4.2 Replacement Rules 94 4.3 Working with Lists 100 4.4 Sums and Products 106
Contents ix P 4.5 Matrice 4.6 Find Out more Qu 110 CHAPTER 5 Functions 113 5.1 Defi 113 5.2 Pure Functions 118 5.3 Elementary Programming 4 Using Modules 126 5.5 Find Out more Qu UIZ 134 CHAPTER 6 Three-Dimensional Graphics 137 6.1 The plot3D Function 137 6.2 3D Graphics Options Surfaces of revolutio 6.4 Drawing Contours or Level Sets 6.5 Drawing Curves in 3-Space 156 6.6 Drawing Graphics Primitive 6.7 Find Out more Quiz CHAPTER Z Calculus 167 7.1 Limits 167 7.2 One-Sided Limits 171 7.3 Multivariable limits 7.4De 7.5 Minimum/Maximum Problems 7. 6 Series 187 7.7 Integration 7. 8 Antidifferentiation 7.9 Applications of Integration 7.10 Find Out more Qu
Contents ix 4.5 Matrices 108 4.6 Find Out More 110 Quiz 110 CHAPTER 5 Functions 113 5.1 Defining Functions 113 5.2 Pure Functions 118 5.3 Elementary Programming 121 5.4 Using Modules 126 5.5 Find Out More 133 Quiz 134 CHAPTER 6 Three-Dimensional Graphics 137 6.1 The Plot3D Function 137 6.2 3D Graphics Options 139 6.3 Surfaces of Revolution 145 6.4 Drawing Contours or Level Sets 148 6.5 Drawing Curves in 3-Space 156 6.6 Drawing Graphics Primitives 159 6.7 Find Out More 163 Quiz 163 CHAPTER 7 Calculus 167 7.1 Limits 167 7.2 One-Sided Limits 171 7.3 Multivariable Limits 173 7.4 Derivatives 177 7.5 Minimum/Maximum Problems 182 7.6 Series 187 7.7 Integration 191 7.8 Antidifferentiation 196 7.9 Applications of Integration 201 7.10 Find Out More 207 Quiz 207