Mathematics, Physics & Chemistry with the Wolfram Language 1122554488 99778899881111224477118877 ttpp..iinndddd 11 33//88//2211 22::2200 PPMM Other Titles by the Author Advanced Physical Chemistry: A Survey of Modern Theoretical Principles Foundations of Quantum Dynamics Introduction to Quantum Mechanics (two editions) Guide to Essential Math: For Students in Physics, Chemistry, and Engineering (two editions) Twenty-First Century Quantum Mechanics: Hilbert Space to Quantum Computers Mathematical Physics in Theoretical Chemistry SShhaauunn -- 1122554488 -- MMaatthheemmaattiiccss,, PPhhyyssiiccss aanndd CChheemmiissttrryy wwiitthh tthhee WWoollffrraamm LLaanngguuaaggee..iinndddd 11 1144//11//22002222 44::5533::5566 ppmm Mathematics, Physics & Chemistry with the Wolfram Language S M Blinder University of Michigan, USA & Wolfram Research, USA World Scientific NEW JERSEY • LONDON • SINGAPORE • BEIJING • SHANGHAI • HONG KONG • TAIPEI • CHENNAI • TOKYO 1122554488 99778899881111224477118877 ttpp..iinndddd 22 33//88//2211 22::2200 PPMM Published by World Scientific Publishing Co. Pte. Ltd. 5 Toh Tuck Link, Singapore 596224 USA office: 27 Warren Street, Suite 401-402, Hackensack, NJ 07601 UK office: 57 Shelton Street, Covent Garden, London WC2H 9HE Library of Congress Cataloging-in-Publication Data Names: Blinder, S. M., 1932– author. Title: Mathematics, physics & chemistry with the Wolfram language / S.M. Blinder, University of Michigan, USA & Wolfram Research, USA. Description: New Jersey : World Scientific, [2022] | Includes index. Identifiers: LCCN 2021038309 | ISBN 9789811247187 (hardcover) | ISBN 9789811247194 (ebook) | ISBN 9789811247200 (ebook other) Subjects: LCSH: Mathematics--Data processing. | Wolfram language (Computer program language) | Mathematica (Computer file) | Quantum theory. Classification: LCC QA76.95 .B55 2022 | DDC 510.285/5133--dc23/eng/20211027 LC record available at https://lccn.loc.gov/2021038309 British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library. Individual Wolfram Demonstrations (https://demonstrations.wolfram.com/) as referenced and displayed herein are copyrighted by S M Blinder; Wolfram Research, Inc. holds the compilation copyright in the database. Copyright © 2022 by World Scientific Publishing Co. Pte. Ltd. All rights reserved. This book, or parts thereof, may not be reproduced in any form or by any means, electronic or mechanical, including photocopying, recording or any information storage and retrieval system now known or to be invented, without written permission from the publisher. For photocopying of material in this volume, please pay a copying fee through the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, USA. In this case permission to photocopy is not required from the publisher. For any available supplementary material, please visit https://www.worldscientific.com/worldscibooks/10.1142/12548#t=suppl Desk Editor: Shaun Tan Yi Jie Typeset by Stallion Press Email: [email protected] Printed in Singapore SShhaauunn -- 1122554488 -- MMaatthheemmaattiiccss,, PPhhyyssiiccss aanndd CChheemmiissttrryy wwiitthh tthhee WWoollffrraamm LLaanngguuaaggee..iinndddd 22 11//1111//22002211 1100::3366::3388 aamm January7,2022 13:48 Mathematics,Physics&Chemistry:::-9inx6in b4467-fm pagev Preface I began my second career as a telecommuting computer scientist for Wolfram Research in 2007. Since 2002, I have been Emeritus Professor of Chemistry and Physics at the University of Michigan. Most of my workhasbeendevotedtothehighlyacclaimedWolframDemonstrations Project. Stephen Wolfram conceived of the Project as a way to bring computationalexplorationtothewidestpossibleaudience.Itisanopen- coderesourcethatusesdynamiccomputationtoilluminateconceptsin science,technology,mathematics,art,financeandaremarkablerange of other fields. The stated goal is to encourage people of all ages and backgrounds to embrace computational thinking as a way to better analyze and understand the world around them. I have written over 350 demonstrations myself, mostly on topics in mathematical physics andtheoreticalchemistry,whichweremyacademiccareerspecialties. I have also served as Expert Reviewer for nearly 5000 Demonstration submissions. Chapter1isashortlessoncoveringtheessentialfeaturesoftheWolfram Language(WL),whichisanextensionoftheprogramminglanguageused intheMathematicasoftwaresystem.InChapter2,WLisusedtodevelop severaltopicsinappliedmathematics.Thesearesubsequentlyapplied totheDemonstrationsonphysicsandchemistryinChapters3–7.There isanemphasisonquantummechanicsandtheoreticalchemistry,inline with my own long-time interests. Electromagnetism and several other topicsinphysicsarealsocovered. v January27,2022 13:49 Mathematics,Physics&Chemistry:::-9inx6in b4467-fm pagevi vi Mathematics,Physics&ChemistrywiththeWolframLanguage Some 180 Demonstrations are presented in Chapters 2–7. The accom- panying text can serve as a mini-lesson on the underlying scientific or mathematical principles. For compactness, the Mathematica codes for the Demonstrations are relegated to Supplementary Materials, which maybedownloadedasMathematicafiles(seeInstructionsforAccessing Online Supplementary Material, p. 414). The level of coding can be described as functional, appropriate to a scientist or science student whoisnotacomputerexpert.Wetryto“getthejobdone”withafairly rudimentarysetofWLcommands.Amoresophisticatedcomputerpro- grammermightenjoyrevisingsomeofthecodes.Alloftheprogramming inthisbookisbasedonMathematicaversion12. My appreciation to World Scientific, and in particular my editor Shaun TanYiJie,fortheircompetence,efficiencyandresponsivenessduringthe productionofthisbook. Finally,IwouldliketothankmycolleaguesintheWolframDemonstra- tionsProject:AndreKuzniarek,EdPegg,GeorgeBeck,DanielLichtblau, GlennScholebo,CindieStraterandJoyceTracewell,withoutwhomnone ofthisworkwouldhavebeenpossible. S.M.Blinder,AnnArbor,July2021 January17,2022 11:4 Mathematics,Physics&Chemistry:::-9inx6in b4467-fm pagevii About the Author Dr.S.M.BlinderisProfessorEmeritusofChemistry andPhysicsattheUniversityofMichigan,USA.He obtained a PhD in chemical physics from Harvard University under the direction of W. E. Moffitt and J. H. Van Vleck (Nobel Laureate in Physics, 1977). He has nearly 200 research publications and 8 booksinseveralareasoftheoreticalchemistryand mathematical physics. He was the first to derive theexactCoulomb(hydrogenatom)propagatorin Feynman’s path-integral formulation of quantum mechanics. He has taught a multitude of courses in chemistry, physics, mathematics and philosophy,mostlyonthesubjectofquantumtheory.Inearlierincarna- tions,hewasaJuniorMasterinchessandanaccomplishedcellist.Heis currentlyatelecommutingseniorscientistwithWolframResearch,and liveswithhiswife,FrancesBryant,inAnnArbor. vii B1948 Governing Asia TTTThhhhiiiissss ppppaaaaggggeeee iiiinnnntttteeeennnnttttiiiioooonnnnaaaallllllllyyyy lllleeeefffftttt bbbbllllaaaannnnkkkk BB11994488__11--AAookkii..iinndddd 66 99//2222//22001144 44::2244::5577 PPMM January7,2022 13:48 Mathematics,Physics&Chemistry:::-9inx6in b4467-fm pageix Contents Preface v AbouttheAuthor vii 1. IntroductiontotheWolframLanguage 1 1.1 BasicOperationsinMathematica . . . . . . . . . . . . . . 1 1.2 Manipulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 FunctionsandPlots . . . . . . . . . . . . . . . . . . . . . . 9 1.5 OtherTypesofPlots . . . . . . . . . . . . . . . . . . . . . . 12 1.6 2DGraphics . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.7 3DGraphics . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.8 WolframAlpha. . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.9 RandomNumbers . . . . . . . . . . . . . . . . . . . . . . . 22 1.10 BinomialDistributions. . . . . . . . . . . . . . . . . . . . . 22 1.11 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.12 Demonstrations . . . . . . . . . . . . . . . . . . . . . . . . . 28 2. Mathematics:SomeApplicationsoftheWolfram LanguagetoAppliedMathematics 31 2.1 ComplexVariables . . . . . . . . . . . . . . . . . . . . . . . 31 2.1.1 VisibleandInvisibleIntersectionsinthe CartesianPlane . . . . . . . . . . . . . . . . . . . . 31 2.1.2 ContourIntegrals . . . . . . . . . . . . . . . . . . . 36 ix