A Brief Introduction

CoA Code

.  Notational Conventions

.  Typesetting

.  Basic Mathematical Functions

Floor[((π^E)/3)]

FactorInteger[12345679]

PrimeQ[1111111]

GCD[123456,8888]

Zeta[2]

Fibonacci[50]

LegendreP[6,t]

BernoulliB[10]

fcn[x_]:=(x^2)

{fcn[3],fcn[x],fcn[t]}

.  Using Functions

{1,2,3} ~Union~ {4,3,6,1}

{1,2,3}⋃{4,3,6,1}

Map[f,{1,2,3}]

(Sqrt[{9,16,25}])

SmallestDivisor[n_]:=First[Rest[Divisors[n]]]
Attributes[SmallestDivisor]=Listable;
SmallestDivisor[{101,{1001,10001}}]

SmallestDivisor1[n_]:=First[Rest[Divisors[n]]]
SmallestDivisor1[{101,{1001,10001}}]

??Divisors

Apply[Plus,{x,y}]

Map[f,{1,2,{3,4}},{2}]

Map[f,{1,2,{3,4}},2]

Apply[f,{{1,2},{3,4}},{1}]

Thread[f[{a,b,c},{x,y,z}]]

Inner[f,{a,b,c},{x,y,z}]

Inner[f,{a,b,c},{x,y,z},g]

Inner[f,{a,b,c},{x,y,z},List]

Outer[f,{a,b,c,d},{e,f}]

Outer[List, {0,1}, {0,1}, {0,1}]

sequences[n_]:=Flatten[Outer @@Prepend[Table[{0,1},{n}],List],n-1]
sequences[3]

Distribute[f[a+b,c+d]]

Distribute[f[{a,b},{c,d}],List]

Distribute[{{0,1},{0,1},{0,1}},List]

Tuples[{0,1},3]

Outer[StringJoin,{"Ceb","Tscheb","Tcheb","Cheb"},{"y","i"},{"schef","cev","cheff","scheff","shev"}]

y=x;
Do[y=f[y],{i,1,4}];
y

Nest[f,x,5]

NestList[f,x,5]

NestList[Cos, 0.31, 10]

Collatz[n_]:=If[EvenQ[n],(n/2),3 n+1];
Collatz3[n_]:=Nest[Collatz,n,3];
FixedPointList[Collatz3,123456789]

func[x_]:=(1/2) (x+(2/x));
FixedPoint[func,0.3]

(((#)^2)&)[3]

FixedPointList[(1/2) (#+(2/(#))) &,0.3,7]

Fold[f,a,{b,c,d}]

FoldList[Plus,a,{b,c,d,e}]

Accumulate[{1,2,3,4,5}]

.  Replacements

x+(x^3)/.x->2

sol=Solve[4 x+(x^3)==0,x]

4 x+(x^3)/.sol

.  Lists

Table[(x^i),{i,1,8}]

Array[Sin,5]

Array[GCD,{6,6}]

IdentityMatrix[4]

IdentityMatrix[4] //MatrixForm

DiagonalMatrix[{1,2,3,4}]//MatrixForm

s={x,1,2,a,b,{c,d,e}};
s[[1]]

s[[6,2]]

s[[-1]]

s[[-1,{1,2}]]

Rest[s]

Most[s]

Drop[s,-2]

Take[s,2]

Take[s,{2,4}]

Select[Range[1000, 1100], PrimeQ]

Select[Range[100,130],!PrimeQ[#]&]

.  Getting Information

?ParametricPlot

FullForm[(1/2)]

FullForm[(1/(Sqrt[a]))]

Get["ComputationalGeometry`"]

?ConvexHull

pts=RandomReal[{0,1},{30,2}];
ch=ConvexHull[pts];
Graphics[{{EdgeForm[{Black,Thick}],GrayLevel[0.8],Polygon[pts[[ch]]]},PointSize[0.02],Point[pts]}]

.  Algebraic Manipulations

Together[3/x + x/3]

Apart[((3 x)/((x+2) (2 x-9)))]

Expand[x (x+2) (y+(y^2))]

Simplify[%]

Simplify[Sin[n π],n∈Integers]

f=Expand[(x+1)(x+2)(x+3)];
Simplify[f]

FullSimplify[f]

s=Sum[(((((-1))^n) )/((4^n) (4 n+1))), {n,1,∞}]

FunctionExpand[s]

Collect[3 π (Subscript[a, 2])+4 (Subscript[a, 1]) ArcTan[2]-(Subscript[a, 2]) ArcTan[2]+(Subscript[a, 3]) ArcTan[2]-4 (Subscript[a, 3]) Log[5]-2 (Subscript[a, 2]) Log[5]+(Subscript[a, 4]) Log[5],{π, ArcTan[2],  Log[5]}]

CoefficientList[1+4 (y^2)+(y^3),y]

Coefficient[1+x+13 x y+(y^2),y]

PowerExpand[((x Tan[(Sqrt[(x^2)])])/(Sqrt[(x^2)]))]

PowerExpand[Log[(5/3)]-Log[2]-Log[(5/2)]+Log[3]]

.  Customizing Mathematica

DeclarePackage["ComputationalGeometry`","ConvexHull"];

.  Comprehensive Data Sets in Mathematica

GraphicsRow[CountryData["India","ElectricalGridSocketImages"]]

GraphicsGrid[Partition[Table[Show[CountryData[c,"Flag"], PlotLabel->c],{c, Take[CountryData["Europe"],16]}],4]]

WordData["mathematics", "Definitions"]

Take[SortBy[Tally[First/@CityData[]],Last],-10]

(First/@CityData[{All,"France"}])⋂(First/@CityData[{All,"Italy"}])

CityData["Magenta"]

CityData[{"Magenta","Lombardy","Italy"},"LocationLink"]
CityData[{"Magenta","ChampagneArdenne","France"},"LocationLink"]

Get["PhysicalConstants`"]

?StefanConstant

StefanConstant//N

Get["Units`"]

Convert[((1000. (Foot^3))/Second),(Gallon/Year)]

Graphics3D[{Orange, Specularity[White,70],KnotData[{8,3},"ImageData"]},Boxed-> False,ViewPoint-> {0,0.1,5}]

KnotData[{8,3},"AlexanderPolynomial"][x]