Freshman Seminar - Mathematica Demo

Ken Masseur (Kenneth_Levasseur@uml.edu)

October 2025

What is Mathematica?

Simple answer:  Mathematica is a system for doing computation.

$Version

Baseball

You' d need to have an “add-on” called Baseball to do this.

How to Begin

Start typing : You get an input cell

Solve[x^2-5x + 1==0,x]

Starting with  “=“  gives you a  free-form/natural language input

Starting with  “= =”  gives  you a Wolfram Alpha query

AI Support

Using Microsoft M365 Copilot

Paste snippet above into a Mathematica Notebook and evaluate it:

(*Parameters*)T0=90; (*Initial coffee temperature*)
Troom=30; (*Room temperature*)
k=0.05; (*Cooling constant,adjust as needed*)

(*Newton's Law of Cooling*)
T[t_]:=Troom+(T0-Troom) Exp[-k t]

(*Plot temperature over time*)
Plot[T[t],{t,0,60},PlotLabel->"Cooling of Coffee Over Time",AxesLabel->{"Time (minutes)","Temperature (°C)"},PlotStyle->Red,GridLines->Automatic]

A few examples from courses most math majors take.

Precalculus/Trig

Solve[2x^2+5x-7==0,x]

c Sin[a x +b]

Manipulate[Plot[c Sin[b+a x],{x,-8,8}],{a,-8,8},{b,-2,2},{c,-2,2}]

Solve[x Sin[x]==1/5,x]

Plot[x Sin[x]-1/5,{x,0,4}]

FindRoot[x Sin[x]==1/5,{x,0.5}]

FindRoot[x Sin[x]==1/5,{x,3}]

Calculus I/IA/IB

Differentiate  and plot a function.

f=Function[x,x Sin[x]]

f'

Plot[{Tooltip[f[x]],Tooltip[f'[x]]},{x,0,2Pi}]

Calculus II

Integrate an expression, indefinite and definite.

y=x^2 E^(-x)

Integrate[y,x]

Integrate[y,{x,0,5}]

Evaluate an infinite series.

Sum[(2/3)^n,{n,0,∞}]

A Taylor series

Series[Cos[x],{x,0,4}]

Calculus III

u={4,-2,1};
v={1,1,-2};

u.v

Graphics3D[{Arrow[{{0,0,0},u}],Arrow[{{0,0,0},v}]}]

Clear[x,y]

z=x^2-y^2

ContourPlot[z,{x,-10,10},{y,-10,10}]

Plot3D[z,{x,-10,10},{y,-10,10}]

Discrete Structures

Binary digits of a number

IntegerDigits[1234567,2]

The number of possible 5 card poker hands:

Binomial[52,5]

A recursive definition of the Fibonacci sequence.

Clear[f]

f[0]=0;f[1]=1;
f[n_]:=f[n]=f[n-1]+f[n-2]

Table[f[i],{i,0,10}]

RandomGraph[BernoulliGraphDistribution[20,(1/5)]]

Linear Algebra

Linear Equations

Clear[x,y,z]

Solve[{x+y+z==4,x+2y-z==5,x-y-z==0},{x,y,z}]

Matrix Equations

A=(({{2, -1, 0}, {-1, 3, -1}, {0, -1, 4}}))

Solve[A.{x,y,z}=={3,4,5},{x,y,z}]

Inverse[A]

Differential Equations

Clear[x,t]

DSolve[x'[t]==-2x[t]+t^2,x[t],t]

DSolve[{x'[t]==-2x[t]+t^2,x[0]==1},x[t],t]

x[t_]:=(1/4) (E^(-2 t)) (3+(E^(2 t))-2 (E^(2 t)) t+2 (E^(2 t)) (t^2))

Plot[x[t],{t,0,5}]

Probability & Statistics

Distribution of probabilities for the roll of a fair die:

roll= DiscreteUniformDistribution[{1,6}]

RandomVariate[roll]

PDF[roll]

twodice:=Total[RandomVariate[roll,2]]

{twodice,twodice,twodice}

data=Table[twodice,{10000}];

Mean[data]//N

Histogram[data]