# How to do it in Mathematica

This page will be used to accumulate short Mathematica notebooks with examples that we encounter in Physics 834. It is not intended to be exhaustive!
URL: http://www.physics.ohio-state.edu/~ntg/834/mathematica.php
The notebooks here were written assuming Mathematica version 7 or later (you may get an advisory with later versions).

• 23-Nov-2011 --- Added spherical harmonics, gaussian quadrature, and Green's function (under differential equations) example notebooks
• 13-Nov-2011 --- Added Legendre and Laguerre example notebooks

## Integrals

25-Sep-2011 Spherical coordinates volume integrals Sample integrals for doing a three-dimensional volume integral in spherical coordinates.
15-Oct-2011 Checking PS#3 integrals Getting answers for the contour integrals in PS#3, including using Assumptions.
15-Oct-2011 Checking PS#2 problems Checking answers for PS#2 (still in progress --- the first problem is done).
23-Nov-2011 Gaussian quadrature tests, Part 1 Some sample tests of gaussian quadrature (Gauss-Legendre and Gauss-Laguerre with N=3).

## Complex Numbers and Functions

29-Sep-2011 Finding Residues Using the Residue command in Mathematica.
29-Sep-2011 Complex Series Examples of expanding complex functions in series and determining the radius of convergence.
29-Sep-2011 Complex Roots Examples of how to solve zn = a.
29-Sep-2011 Complex Trigonometry Examples of trig functions with complex arguments and also converting back and forth from expoential to trig.

## Differential Equations

23-Nov-2011 Green's functions, Part 1 A look at Green's functions for a sample Helmholtz equation example.
04-Nov-2011 Diffusion Part 1 Animated solution to a diffusion problem (not derived; just plotted).
17-Oct-2011 PS#4 checks Checking answers for (some of) the differential equations in PS#4.
15-Oct-2011 Checking PS#3 differential equations Getting answers for the differential equations in PS#3, including using extracting the equations in convenient form.
25-Sep-2011 Nonlinear Diff Eq Mathematica notebook solving the nonlinear Duffing differential equation, looking at the time dependence, phase space plots, Poincare sections, and the power spectrum.
25-Sep-2011 Nonlinear Pendulum Mathematica notebook solving the nonlinear pendulum differential equation for various initial conditions, looking at the time dependence, phase space plots, Poincare sections, and the power spectrum.

## Special Functions

13-Nov-2011 Legendre polynomials Plots of polynomials and checks of orthogonality.
13-Nov-2011 Laguerre polynomials Plots of polynomials and checks of orthogonality.
23-Nov-2011 Spherical harmonics Plots of spherical harmonics. 3D!!

## Fourier Series and Transforms

16-Oct-2011 Fourier Series Basic integrals and plots of Fourier Series.
24-Oct-2011 Fourier Series 2 Comparing full, sine, and cosine Fourier Series.
26-Oct-2011 Fourier Series 3 Generalized string plucking and harmonics. Includes animation!
30-Oct-2011 Checks of PS#5 Solutions to Fourier series problems from PS#5.
07-Nov-2011 Checks of PS#7 Solutions to Fourier transform problems from PS#7.

## Dirac Delta Functions

04-Nov-2011 Checks of PS#6 Solutions to Dirac delta function and Fourier series problems from PS#6.
31-Oct-2011 Dirac Delta function Basics of using the built-in delta function in Mathematica.

## Simplification

07-Nov-2011 Defining Simplication Rules Simplication rules for logarithms are defined for a private function.
29-Sep-2011 Trig Simplification Simplifying cos[3θ] and simplifying cos[nπ] enforcing the assumption that n is an integer.

## Sample Mathematica notebooks

On some machines clicking the link will start Mathematica directly. If not, "right click" to save the file and then read it into Mathematica separately.