Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have used Mathematica for several years but at a pretty low level - piecing together built-in function inefficiently and fearing the sight of # and &'s when I see others use them (I never do). I would like to improve my skills.

Which book would be best to read for someone familiar with Mathematica basics but would like to learn more sophisticated uses of Mathematica?

share|improve this question

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

add comment

6 Answers

After having used Mathematica for a couple of years, more or less only to abuse it as a neat plotting and integral solving engine, Leonid Shifrin's Mathematica Programming was my first book that brought me closer to actually understanding how Mathematica works. I soon lost my fear of # & @ @@ @@@ /@ //@.

(Plus the book is free, and if you still need help: Leonid is a regular on this site.)

share|improve this answer
43  
+1 - Could not resist :) –  Leonid Shifrin Feb 5 '12 at 21:41
    
+1 GREAT! I've always wanted to understand the # & @ @@ @@@ /@ but they always said me to read Mathematica's documentation, but I never understood from there. –  Igäria Mnagarka Jun 18 '12 at 3:16
    
Hi Leonid! Are you preparing a next version of your book ? I think it would be worthwhile to publish a traditional styled book on paper. –  tchronis Oct 18 '13 at 10:46
    
plus that Leonid's book contains a list of the other must-reads –  eldo May 26 at 7:43
add comment

Easily one of the best books ever written on Mathematica is David Wagner's Power Programming with Mathematica: The Kernel.

It was written more than ten years ago at a time when version 3 of Mathematica was current but is every bit as much relevant today as it was then since the foundation on which Mathematica is built has not changed that much over the intervening years.

Unfortunately the book is out of print and it may be difficult to locate a used copy ... a university library however should be able to obtain a copy easily through inter-library loan. This beautifully written book is well worth the trouble of tracking it down.

As an aside question: does anyone know where David Wagner is today?

EDIT

In the interest of completeness, Wellin's An Introduction to Programming in Mathematica is also worth mentioning here (nice section on front-end programming and provides example of a complete DSL implementation in Mma) in addition to Maeder's Computer Science with Mathematica (especially helpful for those trying to use Mma in a OOP style), Mangano's Mathematica Cookbook (full of in-depth recipes for a multitude of concrete problems), Wagon's Mathematica in Action (focused on solving mathematical problems in Mma many of a recreational nature) and Trott's four-volume Guidebooks on Numerics, Programming, Symbolics, and Graphics (which includes thousands of pages of examples of Mathematica being used to solve a wide range of different problems with in-depth discussion and demonstration of Mma programming language features).

There are of course many more Mma books out there. These are just some of the titles that I've found most useful over the last decade or two using Mathematica.

share|improve this answer
3  
This book was my primary source of mma knowledge, although I already knew a few things before getting it. I keep recommending it on SO and here. As to David Wagner himself, I tried to get some traces of him, but wasn't successful. He somehow disappeared around 1996 or so, and did not finished his second volume, which was supposed to cover MathLink. I hope he is alive. It might be that he quit from any Mathematica - related activities completely, and is doing something different now. –  Leonid Shifrin May 2 '12 at 8:50
    
Unfortunately there is a dearth of publicly available information on the deep inner-workings of the Mathematica kernel and the front-end. An authoritative reference from Wolfram would obviously be welcomed by much of their target audience (as forums like this one easily prove) and I hope Wolfram will consider publishing one in the near future after finding a way to protect their intellectual property in the process. Until then, we can refer to our photocopies of Wagner (for kernel-related matters at least). –  StackExchanger May 2 '12 at 20:28
2  
I proudly own the original book (not the photocopy) :). I bought it from Amazon for $40 in 2004, now it is usually much more expensive there (when available). And I had no idea what I was buying, at the time - had no access to it prior to that. –  Leonid Shifrin May 2 '12 at 20:30
    
Just visited your website for the first time ... lots of fantastic stuff in there that should keep me busy for a while. Thanks for making this so easily available to the rest of us. –  StackExchanger May 4 '12 at 7:34
    
Thanks! I am at work on another book with much more material and different organization, but with the current volume of work it's hard to put any time frame on that. The book you refer to is more aimed at a beginner or somewhat intermediate level. I wrote it 4 years ago, and didn't do much with it or the web site since about 3 years ago (which is a shame). –  Leonid Shifrin May 4 '12 at 7:39
show 1 more comment

Mathematica core programming has not changed much during the years. So, if someone has an interest in learning how to effectively program in Mathematica, older books - even those dating back to version 2.2! - can be of use.

Personally, I believe one of the best books in this sense is

Thomas B. Bahder
Mathematica Programming for Scientists and Engineers
Addison Wesley, 1995

It is a 1995 book, aimed at version 2.2 (version 3 was still in the works). Nonetheless this is one of the best references for mathematica core programming that I have read. Ever. The only parts of the book that did not age well, obviously are those relating to graphics and import but that should not be a reason to shun this book. The following chapters

Ch1 The Building blocks
Ch2 Working with Lists
Ch4 Scoping Constructs
Ch5 Functions

Could make their own book with the title: "Pure Mathematica in a nutshell". The other chapters on Symbolic and Numerical computations (including those on matrices, ODEs and PDEs) exemplify the application of the basic core notion to actual computing. The part I like the most is the way Bahder uses pattern matching to shape function calls in order to make them very general. This book really show the giant leap between procedural programming and functional/rule-based programming.

I am not sure this book is still in print; after having read it many (too many :-) ) years ago, I recently acquired a used copy from the Am[censored] marketplace for 15 bucks. It would be nice if this book could be made available as "Power Programming in MMA" was, because it deserves greater visibility.

share|improve this answer
1  
+1. It's funny that you mention this book as I'm actually reading it right now and saw your post. Completely agree that this is one of the good old books on Mathematica and has never been mentioned on this site. One aspect you didn't mention is how useful this book is for those that constantly need to transfer data from files to be analyzed in Mathematica. He covers a great deal in Chapter 11: Input and Output. I ordered mine a few months ago for just 6 dollars and is probably the best 6 bucks I've ever spent. –  RunnyKine Oct 6 '13 at 12:49
add comment

I really don't like to read old books, but these days, following @Leonid advice, I start to read Stephen Wolfram's The Mathematica Book (version 5.2). It can be downloaded for free here. I strong recommend it for everybody that wants to have a deeper understand of Mathematica. Even though the program is currently in version 9, the core operations are almost the same.

enter image description here

share|improve this answer
add comment

I would recommend -

  • The Student's Introduction to MATHEMATICA :A Handbook for Precalculus, Calculus, and Linear Algebra
  • Programming with Mathematica by Paul Wellin.
  • Leonid Shifrin's Mathematica Programming

Also don't forget the documentation available online, particularly the pdf on the core language.

In response to comments below. I only started learning Mathematica and in particular how to program mathematica in the last few months but i have a background in C/C++/Java. The first book listed above i found to be an excellent general introduction to mathematica that covers a lot of the basics and gets you going in how to use it to solve problems in calculus, linear algebra etc, the final chapter is also a very good introduction to programming mathematica. I found Paul Wellins book to be a very good follow on from this, its goes into much more detail on the programming side and if you work thru the problems at the end of each chapter/section you really learn a lot. IF you work your way thru Paul Wellins book you will be well on your way to learning how to program mathematica and you will also get much greater insight into just how powerful mathematica is a tool.

Regards David.

share|improve this answer
    
2 of the three you listed were already mentioned in other answers. Please make sure that suggestions are not being duplicated. As for the remaining one, please explain why you recommend it, as that is what will help future visitors make an informed decision. –  rm -rf Feb 16 '13 at 1:03
1  
@rm-rf This QandA is evolving strangely. Some answers are heading towards being one person's recommendations of a few books, rather than a single book. But then should answerers add their opinions about a book to the other post - could get messy if individual paragraphs of an answer are different people's opinions. –  cormullion Feb 16 '13 at 8:17
add comment

I found that Schaum's Outline of Mathematica (2nd Edition) to be a great value starter book for just getting your feet wet with working with Mathematica. It's the only book I have actually bought so far and it starts without getting into too much technical detail until later. It covers all the basic parts of the language with lots of practice problems and answers which will get you more comfortable with the Mathematica functional programming syntax.

But it defers the more advance topics of Pure Functions, Patterns, Contexts and Modules to the Appendix which you will probably need to learn from another book or from reading tutorials on websites such as this one or from the help documentation included with the software.

A few of my aha moments with this book has been the generality of working with lists in Mathematica and later combining data lists with pure function and mapthread (&/@ has become my favorite command) to really speed up coding and plot generation.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.