Welcome to \[MathematicaIcon]Mathematica\[MathematicaIcon]

Additional resources:

https://www.wolfram.com/language/elementary-introduction/2nd-ed/

https://mathematica.stackexchange.com/

http://www.oftenpaper.net/sierpinski.htm  <---- BEST PAGE

Interface

Moving and highlighting

Use ↑, ↓ to move the cursor.

Use ⇧ ↑, ⇧↓ to highlight cells.

Use ⌫ to delete cells.

Use ⇧ -Ctrl- D to divide a cell at the cursor.
Use ⇧ -Ctrl- M to merge cells.

Use Ctrl-‘ to open a highlighted cells group. Find a present inside!

SphericalPlot3D[Log[θ]+Sin[ϕ],{θ,0,2π},{ϕ,0,2π},Boxed->False, Mesh->None,PlotPoints->30,Axes->False]

Executing cells

Use ⇧ -⌤  to execute the current cell. 
(Note that text cells cannot be executed)

10!

Suppressing output

x=500!;

code, text, titles

typing symbols

α β γ ∞ π

practice : type your favorite letters and open the next sections.

Practice : execute this cell. [hard]

Print["Figure out how to execute me!"] (* Hint: cell properties *)

Using builtin functions

Sqrt[100]

Functions with single arguments can be used in a postfix form as well.

100//Sqrt

and Exact vs numerical

functions={Sqrt,Exp,Log,Sin, Cos,Tan,Sinh,Cosh, AiryAi,BesselJ[1,#]&}

Through[functions[1]]

Through[functions[1.]]

Practice: find the exact value of sine of π/12

Find the numerical value of the same.

Getting help

Help Reference: use ? and then the name of a function. 
Practice: Look up the reference for BesselJ.

Assigning and clearing variables and functions

Variables

x=1

x+3

Clearing variables

Clear[x]
x+3

The nuclear option:

Remove["Global`*"]

and equations

gasLaw=p v== n r t

and functions

f[x_]:=(x^2)+1

f[2]

f[y]

lists

list={a,b,c}

list+1

list.list

Cross[list,list]

list[[2]]

Practice : set a variable, set a function of two variables, then clear them.

Practice: Write a function that represents the 4th root of the sine of a number.

Plot

Plot[(x^2),{x,0,1}]

Plot[{1/(Sqrt[x+0.1]),f[x]},{x,0,5},PlotStyle->{Red, Dashed},PlotLabel->"Hello",Frame->True,FrameLabel->{"x","y"},PlotRange->{0,5}]

and Manipulate

Manipulate[Plot[Re[(x^n)],{x,-2,2},PlotRange->{{-2,2},{-2,4}}],{{n,0},-2,2}]

Practice : use LogPlot and LogLinearPlot. Test out other plot commands:

?*Plot

Solve

Clear[x]
sol=Solve[(x^2)+b==x,x]

(x^2)+x+3/.sol

Solve[ x Exp[x]== a,x]

gasLaw=p v== n r t;
Solve[gasLaw,n]

sol=Solve[(1/2)m (v^2)==((en )/(Sqrt[1-a]))+(1-a) v,v]

Solve[(x^2)+(y^2)==1&&x+y==a,{x,y}]
Solve[{(x^2)+(y^2)==1,x+y==a},{x,y}]

Replacement rules

v/.sol

x+y/.{x->(a^2),y->4(a^6)}

sol=sol/.a->1-(b^4)

Practice: Find all pairs of positive integers that satisfy (x^2)+(y^2)=325

Simplify

(x-1)(x+1)(x^2+1)+1
Simplify[%]

Simplify[2 Tan[x]/(1+Tan[x]^2)]

sol//Simplify

It helps to state your $Assumptions.

sol=Solve[(1/2)m (v^2)==((en )/(Sqrt[1-a]))+(1-a) v,v];
sol=sol/.a->1-(b^4);

Simplify[sol,b>0]

Simplify[Sqrt[(x^2)]]

Simplify[Sqrt[(x^2)],x>0]

$Assumptions={a<0};
Simplify[Sqrt[(a^2)]]

2 Sin[x] Cos[y]//Simplify

TrigReduce[2 Sin[x] Cos[y]]

Sin[x+y]//Simplify

TrigExpand[Sin[x+y]]

Sin[x]Sech[y]Exp[z]
%//TrigToExp
%//ExpToTrig
%//Simplify

test=1-((2 (a-b+c))/(2 a-b-(Sqrt[(b^2)-4 a c])))== ((b-(Sqrt[(b^2)-4a c]))/(2a))

Simplify[test]

Reduce[(x-1) (x-2) (x-3) (x-4)>0,x]

Derivative

D[Sin[x],x]

f'[x]

Sinh'[x]

D[Tanh[x],{x,3}]
%//Simplify

Practice : Find ((∂^3)/(∂x∂(y^2)))EllipticF[x,y]

Integrals (Integrate)

Integrate[(((x+b))^3)-(x^7),x]

Integrate[f[x],x]

Integrate[f[x],{x,-2,a}]

Integrate[Exp[-(x^2)],{x,-∞,Infinity}]

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

NIntegrate[Sin[Sin[x]],{x,0,5}]

ODEs

odeSol=DSolve[x''[t]==1,x,t]

odeSol[1]

x[1]/.odeSol
x'[1]/.odeSol

odeFun=DSolveValue[{y''[x]+y[x]==a Sin[x],y[0]==1,y'[0]==b},y,x]

odeFun[1]
%//N

Numerical solutions are sometimes necessary

DSolveValue[{y''[x]==Cos[x] ((y[x])^3),y[0]==1,y'[0]==1},y,x]

nOdeFun=NDSolveValue[{y''[x]==Cos[x] ((y[x])^3),y[0]==1,y'[0]==-1},y,{x,0,10}]

nOdeFun[1]

Plot[nOdeFun[x],{x,0,10},PlotRange->All]

practice : Try to solve some 2nd and 3rd order, linear ODEs

Quantities (variables with physics units)

?Quantity

m=Quantity["AtomicMassUnit"];
q=Quantity["ElementaryCharge"];
b=Quantity[5,"Teslas"];

q b /m

Unit conversion with UnitConvert

myPressure=Quantity[10.,"Pascals"];

torr=UnitConvert[myPressure,"Torr"]

ρH2O=Quantity[1.0,"Grams"/(("Centimeters")^3)]

Practice: convert ρH2O into pounds per gallon

Quantities work in Solve

Practice: try solving for the magnetic field in which an electron has gyrofrequency 1 THz. No typing digits allowed!

Getting out of the unit game with QuantityMagnitude

u=Quantity["AtomicMassUnit"]

QuantityMagnitude[u]

QuantityMagnitude[u//UnitConvert]

Iterators (Table)

Table[(x^2),{x,5}]

tab=Table[{x,x!},{x,3,10,2}]

tab//MatrixForm

sum=0;
For[i=1,i<5,i++,sum=sum+(i^2)]

sum

practice: Create an iterator for the Fibonacci sequence.

Limit

Limit[((Sin[x])/x),x->0]

Limit[(1/x),x->0]

Limit[(1/x),x->0,Direction->1]

Series

ser=Series[Sin[x],{x,0,5}]

ser/.x->1

serNorm=Normal[ser]

serNorm/.x->1

Series[Cos[x],{x,π,7}]

SeriesCoefficient[Tan[x],{x,0,5}]

SeriesCoefficient[Exp[x],{x,0,n}]

g[x_,y_]:=Exp[x+y]
Series[g[x,y],{x,0,3},{y,0,3}]

Series[g[t x,t y],{t,0,3}]
Normal[%]/.t->1