- (Problem Set 1) To graph the planes x + 3y - z = 4, 2x + 9y + 4z = 8, and -x - y + 5z = -8, use
ContourPlot3D: ContourPlot3D[{x + 3y - z == 4, 2x + 9y + 4z == 8, -x - y + 5z == -8}, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]If you click on the picture Mathematica makes, you can drag to rotate it around for a better view. If you’d like to be able to tell which plane is which, try adding on some options, as in the following command:ContourPlot3D[{x + 3y - z == 4, 2x + 9y + 4z == 8, -x - y + 5z == -8}, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, ContourStyle -> {Red, Green, Blue}]This colors the first plane red, the second green, and the third blue.
To learn more about the ContourPlot3D command, type the following in Mathematica:

?ContourPlot3D - (Problem Set 4) The command ParametricPlot3D plots sets of vectors in ℝ
^{3}. For example, the following command plots the vectors for s between -3 and 3 (Mathematica can’t plot these vectors for all s since, like most computer systems, it has trouble with infinity):ParametricPlot3D[s*{1, 2, 3}, {s, -3, 3}]Similarly, the following command plots the vectors where -3 ≤ s,t ≤ 3:ParametricPlot3D[s*{1, 2, 3} + t*{2, 2, 1}, {s, -3, 3}, {t, -3, 3}](If you ever want to plots sets of vectors in ℝ^{2}, use ParametricPlot instead of ParametricPlot3D.) - (Problem Set 4) In Mathematica, to enter the matrix , type A = {{1, 2, 3}, {4, 5, 6}}As always, hold down the “Shift” key and hit “Enter” to tell Mathematica to evaluate the line you’ve just written. To get the reduced row-echelon form of the matrix A, typeRowReduce[A]If you are doing any Mathematica calculation that outputs a matrix, you can put //MatrixForm at the end to see the result in more readable form. So, for instance, to get rref(A) in more readable form, you would useRowReduce[A] //MatrixForm
- (Problem Set 6) To evaluate something like A
^{5}in Mathematica (where A is a matrix), use the MatrixPower command:MatrixPower[A, 5](Typing A^5 will instead raise every entry of A to the 5th power, which is not the same at all.) - (Problem Set 7) To multiply two matrices in Mathematica, put a period between them, like:
{{1, 2, 3}, {4, 5, 6}} . {{7, 8}, {9, 10}, {11, 12}}As always, to make the output look more readable, you can add //MatrixForm at the end:{{1, 2, 3}, {4, 5, 6}} . {{7, 8}, {9, 10}, {11, 12}} //MatrixFormTo compute the inverse of a matrix, use the command Inverse:Inverse[{{1, 2}, {3, 4}}](What happens if you try to find the inverse of a non-invertible matrix?)
To make your Mathematica code more manageable, you may find it helpful to assign variable names to matrices; for example, here’s how to name two matrices and multiply them:

A = {{1, 2, 3}, {4, 5, 6}};A word of warning – do not put //MatrixForm when you’re naming a matrix; for example, don’t do

B = {{7, 8}, {9, 10}, {11, 12}};

A.B //MatrixFormA = {{1, 2, 3}, {4, 5, 6}} //MatrixForm;(If you do this, Mathematica refuses to calculate with the matrix A.) - (Problem Set 7) To graph two or more things together, you can use the Show command. Here’s an example:
Show[

ParametricPlot3D[{1, 2, 0} + t*{3, -2, 1}, {t, -3, 3}],

ParametricPlot3D[s*{4, -3, 7} + t*{0, 1, 2}, {s, -3, 3}, {t, -3, 3}]

] - (Problem Set 16) To plot a trajectory like (t) = 5(1.1
^{t})_{1}- 7(0.5^{t})_{2}where_{1}= and_{2}= , use ParametricPlot:ParametricPlot[5*1.1^t*{-1, 2} - 7*0.5^t*{3, -1}, {t, 0, 100},

PlotRange -> {{-70, 70}, {-70, 70}}] - (Problem Set 16) To take the transpose of a matrix in Mathematica, use the Transpose command:
A = {{1, 2, 3}, {4, 5, 6}};

Transpose[A] - (Problem Set 25) The Mathematica command Eigensystem finds the eigenvalues and eigenvectors of a matrix:
Eigensystem[{{1, 2}, {3, 4}}]Try the command first on a matrix whose eigenvectors you know, to make sure you understand what the output means.
- (Problem Set 30) To plot two functions like x
^{2}and x together in Mathematica, use the Plot command:Plot[{x^2, x}, {x, 0, 6}] - (Problem Set 30) Integrate performs integrals. For instance, the following command evaluates the integral
: Integrate[x^3 * Cos[Pi*x], {x, 3, 5}]
- (Problem Set 31) The following code graphs x
^{2}in red and 5 + 3sinx + 2cosx in blue on the interval [-π,π]:Plot[{x^2, 5 + 3*Sin[x] + 2*Cos[x]}, {x, -Pi, Pi}, PlotStyle -> {Red, Blue}]Notice that π must be entered as Pi (capitalized). - (Problem Set 31) The following Mathematica code defines g to be and then graphs
g on the interval [-π,π]. g = 2 + Sum[(-1)^(k + 1)*(2/k)*Sin[k*x], {k, 1, 100}];Mathematica can also be helpful if you want to check your sigma notation; if you simply evaluate the command

Plot[g, {x, -Pi, Pi}]gthen Mathematica will show you g, previously defined to be , written out completely.If you’re finding the Mathematica syntax cumbersome, you can also try Wolfram Alpha at http://www.wolframalpha.com/; if you enter

plot 2 + (sum (-1)^(k+1)*2/k*sin(k*x) from k=1 to 50)into Wolfram Alpha, it should show you the graph of . - (Problem Set 31) The command Play plays functions as sound. For example, Play[Sin[2764t], {t, 0, 1}]plays the function sin(2764t) for t between 0 and 1. If this is very loud, trySound[Play[Sin[2764t], {t, 0, 1}], SoundVolume -> 1/10]to play at the volume.