Mathematica Oveview

Freshman Seminar

2018, Kenneth Levasseur
Mathematical Sciences
UMass Lowell
Kenneth_Levasseur@uml.edu

This tweet was sent

ServiceConnect["Twitter"]

SendMessage["Twitter","Intro to #Mathematica at #UML Freshman Math Seminar on Friday December 7 at 11 AM in Olsen 410"]

Types of Input

What is the integral of (x^2)sin x with respect to x?

Free-Form Input

Wolfram Language Input

Wolfram Alpha Input

The Basic Input-Output Process

Integrate[(x^2+1) Sin[x],x]

Some Syntax  and Grouping

“System Names” like Integrate are always capitalized.

Integrate[(x^2+1) Sin[x],x]

A typical Mathematica expression is a name followed by a sequence of zero or more expressions (called arguments) separated by commas that are enclosed in square brackets.   In addition,  an expression can be a symbol, number, string, or Boolean (True or False).

Integrate[(x^2+1)Sin[x],x]

Integrate[(x^2+1) Sin[x],x]

Parentheses are used for grouping.  Without them here, you would be integrating a different function.

Integrate[x^2+1 Sin[x],x]

Braces (Curly brackets) are used for lists.

Range[1,10]

Prime[Range[1,10]]

Some lists are iterators.

Integrate[(x^2+1) Sin[x],{x,0,Pi}]

Algebra/Calculus

Expand[(x+y)^8]

Factor[3(x^2)-13 x + 10]

Solve[3(x^2)-13 x + 10==0,x]

Solve[x (2^x)==Cos[x],x]

Plot[{x (2^x),Cos[x]},{x,-3,3}]

Plot[{x (2^x)-Cos[x]},{x,-3,3}]

FindRoot[x (2^x)==Cos[x],{x,1}]

FindRoot[x (2^x)==Cos[x],{x,-3}]

y=x Sin[2x +1]

D[y,x]

Integrate[y,x]

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

a=2;
b=y/.{x->a};
m=D[y,x]/.{x->a};
Plot[{y,m(x-a)+b},{x,-Pi,Pi}]

D[((f[x])^2),x]

Clear[a]
Manipulate[b=y/.{x->a};
m=D[y,x]/.{x->a};
Plot[{y,m(x-a)+b},{x,-Pi,Pi},PlotRange->{-5,5}],{a,-Pi,Pi}]

Sin[a x +d]

Manipulate[Plot[Sin[d+a x],{x,-2.49450138336761`,5.394980177262929`}],{a,-2.494501385779834`,5.3949801748507`},{d,-2,2}]

Differential Equations

DSolve[{w'[t]==w[t]-1,w[0]==3},w[t],t]

DSolve[w''[t]-4w[t]==5,w[t],t]

Probabiity & Statistics, Modeling

Probability[heads==5,heads\[Distributed]BinomialDistribution[10,0.5]]

If off line, the intended data is listed below.

temps=Import["http://faculty.uml.edu/klevasseur/Data/Tdata.csv"]

Mean[temps[[All,2]]]

ListPlot[temps]

bestline=Fit[temps,{1,t},t]

Show[{ListPlot[temps],Plot[bestline,{t,0,15}]}]

Clear[a,b];
expofit=NonlinearModelFit[temps,{a (E^(b t))},{a,b},{t}]//Normal

Show[{ListPlot[temps],Plot[expofit,{t,0,15}]}]

Numbers

FactorInteger[18310090399898533906089943279]

PrimeQ[74274943]

Prime[1000000]

N[Pi,1000]

Graphics

Enrollment in Calculus I one semester, by level

calcOne={{"Freshman",308},{"Sophomore",85},{"Junior",24},{"Senior",12}}

PieChart[calcOne[[All,2]],ChartLabels->calcOne[[All,1]]]

ContourPlot[Cos[x]+Cos[y],{x,0,4Pi},{y,0,4Pi}]

Manipulate[ContourPlot[Cos[x]+Cos[y],{x,0,4Pi},{y,0,4Pi},Contours->Range[-2,2,4/n]],{n,3,20}]

Plot3D[(x^(2 ))-2(y^2),{x,-2,2},{y,-2,2}]

Not Included

99% of Mathematica, including the programming language, data bases, and many other mathematical/scientific topics.

Here are a few data base expressions.

ChemicalData["Acetone","BoilingPoint"]

WeatherData[{"Atlanta","Georgia"},"Temperature"]

CityData[{"Lowell","Massachusetts"},"Population"]

DateListPlot[FinancialData["AAPL",{{1990,1},{2014,8}}],PlotRange->All]

Data

just in case you are off line.

temps=(({{0.`, 83.2`}, {1.`, 79.9`}, {2.`, 78.`}, {3.`, 76.4`}, {4.`, 75.`}, {5.`, 73.3`}, {6.`, 71.8`}, {7.`, 70.2`}, {8.`, 68.8`}, {9.`, 67.3`}, {10.`, 66.1`}, {11.`, 65.`}, {12.`, 63.9`}, {13.`, 62.8`}, {14.`, 61.7`}, {15.`, 60.7`}}))