x_

x_type

Head   Switch

multiple defs
:=  vs. =

x_ /;

f[0]=;
f[0.]=;
Abs[x]≤ ϵ

f[x_]:=x-x Sin[10x]

pts=Table[f[t],{t,0,Pi,.01}];

ListPlot[pts]

Length[pts]

Options[ListPlot]

ListPlot[pts,Joined->True]

ListPlot[pts,Joined->True,Mesh->Full]

pts2=Table[{t,f[t]},{t,0,Pi,.01}];
ListPlot[pts2]

Plot[f[t],{t,0,Pi}]

?f

Append[{1,2,3},4]

t={1,2,3};

Append[t,4]

t

t=Append[t,4]

t

evals={};

f2[x_]:=
(evals=Append[evals,x];f[x])

evals

f2[3]

evals

evals={};
Plot[f2[x],{x,0,Pi}]

evals//Length

evals//Short

ListPlot[evals]

f3[x_]:=
(evals=Append[evals,{x,f[x]}];f[x])

evals={};

Plot[f3[x],{x,0,Pi}]

Length[evals]

ListPlot[evals]

f4[x_]:=
(evals=Append[evals,f[x]];f[x])

evals={};
Plot[f4[x],{x,0,Pi}];

ListPlot[evals]

Map[function,{a,b,c,d}]

function@{a,b,c,d}

function@@{a,b,c,d}

function/@{a,b,c,d}

evals={};
Plot[f2[x],{x,0,Pi}];
evals//Short

Map[f,evals]//ListPlot

Map[f,Sort[evals]]//ListPlot

(l=Map[{#,f[#]}&,Sort[evals]])//Short

Length[l]

Last[l]

Map[{#,f[#]}&,Sort[evals]]//ListPlot

Clear[h]

h[x_,y_]:=x+y

{
h[1,2],
h[2,2],
h[2,{2}],
h[Pi,{1,2}],
h[{Pi},{1,2}],
h[{1,2},{1,2}],
h[Pi,E,1,2]
}//ColumnForm

h[x_,x_]:=x

?h

{
h[1,2],
h[2,2],
h[2,{2}],
h[Pi,{1,2}],
h[{Pi},{1,2}],
h[{1,2},{1,2}],
h[Pi,E,1,2]
}//ColumnForm

h[x_,{1,2}]:={a,b}[[Random[Integer]+1]]

?h

h2[x_,y_]:=x+y

h2[x_,{1,2}]:={a,b}[[Random[Integer]+1]]

h2[x_,x_]:=x

?h2

{
h[1,2],
h[2,2],
h[2,{2}],
h[Pi,{1,2}],
h[{Pi},{1,2}],
h[{1,2},{1,2}],
h[Pi,E,1,2]
}//ColumnForm

{
h2[1,2],
h2[2,2],
h2[2,{2}],
h2[Pi,{1,2}],
h2[{Pi},{1,2}],
h2[{1,2},{1,2}],
h2[Pi,E,1,2]
}//ColumnForm