1+1
1+2

%

a=4

2%

a=3

a=5

a

(*Math. is case sensitive*)
Sin[Pi]
sin[Pi]

b=1

ClearAll[b]

?b

Sin[5]

Sin[5.]

(1/7)+(2/13)

(1./7)+(2./13)

(*enumerates result*)
N[Pi]

N[Pi,100]

(*names of vars cannot start with numbers*)
123kyncl
kyncl123
123

(*space means multiplication*)
i am an idiot

a=23*7+p;

expr=(x^2)+2*Sin[α*t+(ϕ/6)];
FullForm[expr]
TreeForm[expr]

b*c=2

TreeForm[b*c]

Plot[x*Sin[(1/(1+x))],{x,1,20},PlotRange->All,AxesLabel->None]
Options[Plot]

x=1

ClearAll[x,y]

Solve[x+25y==1&&x-y==5,{x,y}]

Solve[{x+25y==1,x-y==5},{x,y}]

DSolve[D[y[x],x]+Sin[y[x]]==0,y[x],x]

(*Solve fcn does not solve nonlinear equations without exact solutions*)

Solve[Cos[x]==x,x]

(*FindRoot does it numerically!*)

FindRoot[Cos[x]==x,{x,0}]

list={1,2,4}

FullForm[list]
TreeForm[list]

ClearAll[a]

vec={1,3,4}

vec2={a,b,c}

vec.vec2
vec*vec2

mat=(({{1, 2, 5}, {3, 4, 6}, {3, 4, 7}}))

mat.vec2

Det[mat]

alist={1,2,5,35,7,4}

alist[[3]]

Part[alist,3]

listoflist={1,2,4,{2,5,{34,1}}}

TreeForm[listoflist]

listoflist[[4,2]]

Last[listoflist]

First[listoflist]

listoflist

listoflist[[-2]]

Length[listoflist]

Table[dalmatin,{i,1,101}]

Table[x^i,{i,10}]

Table[x^i,{i,1,10,1.7}]

Table[x^i,{i,{1,5,7,8}}]

listofOddPowers=Table[x^i,{i,1,15,2}]

Options[Plot]

Plot[listofOddPowers,{x,-1,1},PlotRange->Full]

Plot[listofOddPowers,{x,-1,1},PlotRange->{{0,1},All}]

Plot[listofOddPowers,{x,-1,1},PlotRange->Full,AxesLabel->{"x","y"}]

Plot[{Sin[x],Cos[x]},{x,-Pi,Pi},AxesLabel->{"x","Cos Sin"},PlotStyle->{{Blue,Dashed},{Red,Thickness[0.02]}},GridLines->{{Pi,2Pi},{-0.1,-.5,.5,0.1}},PlotLegends->"Expressions"]

Manipulate[
Plot[{Sin[x],Cos[n*x]},{x,-Pi,Pi},AxesLabel->{"x","Cos Sin"},PlotStyle->{{Blue,Dashed},{Red,Thickness[0.02]}},GridLines->Full,PlotLegends->{"Sin[x]","Cos[n*x]"}],
{{n,2},1,3}]

Manipulate[
ParametricPlot[{t+rc*Cos[t],rs*Sin[t]},{t,0,4Pi},PlotRange->Full,AxesLabel->{"x","y"},PlotStyle->Blue],
{rc,1,6},{rs,1,6}]

plts=Table[Plot[listofOddPowers[[i]],{x,-1,1}],{i,Length[listofOddPowers]}];

Show[plts]

(*seminar Nr. 2*)
Remove["Global`*"]//Quiet
(*functions i Math*)
(*?___;*)
?_

Remove["Global`*"]//Quiet;
(*original syntaxis*)
f[x:_]:=(x^2);
(*frequently used form*)
f[x_]:=(x^2);
f[4]
f@4
4//f

Remove["Global`*"]//Quiet;
SeedRandom[2]
a:=Random[]
Table[a,{10}]

?=

Remove["Global`*"]//Quiet;
SeedRandom[2]
a=Random[]
Table[a,{10}]
?a

Remove["Global`*"]//Quiet;
f[x_]:=∫Sin[x]\[DifferentialD]x
f[1]

Remove["Global`*"]//Quiet;
f[x_]=∫Sin[x]\[DifferentialD]x
f[1]
?f

Remove["Global`*"]//Quiet;
f[x_]=(x^2)
f[5]
?f

Remove["Global`*"]//Quiet;
x=Pi;
f[x_]=(x^2)
f[5]
?f

Sin@5.

5.//Sin

Remove["Global`*"]//Quiet;
f[x_]:=(x^2);
f[x_Integer]:=5;
f[1.]:=4;
f[1]:=3;
{f[4.5],f[1],f[1.],f[5]}

Remove["Global`*"]//Quiet;
f[{a_,b_}]:=a+b;
f[{a_,b_,c_}]:=a+b-c;
f[]:=5;
f[{E,Pi}]
f[{E,Pi,I}]
f[]
f[x_Integer]:=x+1
f[0.5]
f[1]
f[x_,y_,z_]:=x+y-z
f[1,2,3]

f[List[1,k]]

f[List[5*I,g,l]]

Head[List[5*I,g,l]]

f[1]

x=1

?x

ClearAll[x]

Solve[x^2==5,x]

$RecursionLimit=(10^6);
Remove["Global`*"]//Quiet;
a[n_Integer]:=n*a[n-1];
a[0]:=1;
Trace[a[3]];
Timing[Table[a[i],{i,1500}]][[1]]

Remove["Global`*"]//Quiet;
a[n_Integer]:=a[n]=n*a[n-1];
a[0]:=1;
Trace[a[3]];
Timing[Table[a[i],{i,1500}]][[1]]

(*Pure Functions*)
((#)^2)&[5]
#1+2#2&[E,Pi]

Select[{1,2,4,7,6,2},#>2&]

test[x_]:=x>2;
Select[{1,2,4,7,6,2},test]

Remove["Global`*"]//Quiet;
test[x_]:=x>2;
f[x_?test]:=5;
{f[8],f[1]}

Remove["Global`*"]//Quiet;
f[x_?#>2&]:=5;
{f[8],f[1]}

Remove["Global`*"]//Quiet;
f[x_?(#>2&)]:=5;
{f[8],f[1]}

Remove["Global`*"]//Quiet;
Map[f,{1,2,3,5}]
f/@{1,2,3,5}

Remove["Global`*"]//Quiet;
Apply[f,{1,2,3,5}]
f@@{1,2,3,5}
Plus@@{1,2,3,5}
Power@@{a,b,c,d}

Remove["Global`*"]//Quiet;
f[funct_]:=Plot[funct[t],{t,0,12},PlotRange->All,PlotLabel->"function"];
f/@{Sin,Cos,Cos[#]+2Sin[#]&}

Plot[Sin[t],{t,0,12},PlotLabel->"function",PlotRange->All,PlotStyle->{Red,Thickness[0.006]}]

Remove["Global`*"]//Quiet;
f[thickness_]:=Plot[Sin[t],{t,0,12},PlotLabel->"function",PlotRange->All,PlotStyle->{Red,Thickness[thickness]}]
f[0.01]

Solve[x^2+a x+1==0,x]

ClearAll[f]
f[a_]:=Solve[x^2+a x+1==0,x];
f[5]