1+1
2+3

a=2;
b=a+3;

b

d=(b^2)

(5^3)

(5/7)

(Sqrt[2])

Sin[π]

Sin[5]

Sin[5.]

N[Pi]

N[Pi,100]

N[Pi]
Pi//N
N@Pi

kyncl*is*stupid*guy

12ape

ape12

?=

x=3

ClearAll[x]
Limit[(((E^(2x))-1)/(Sin[x])),x->0]

DSolve[y''[x]+2y[x]==0,y[x],x]

Integrate[((Sin[(x^2)])/(Sqrt[x])),x]

?_

??__

?___

ClearAll[f];
f[x:_]:=(x^2);
f[x]

?:=

ClearAll[f];
f[x_]:=1+1
?f
f[5]

?=

ClearAll[f];
f[x_]=1+1
?f

ClearAll[f];
x=5;
f[x_]:=x;
f["Prague"]

ClearAll[f];
x=5;
f[x_]=x;
f["Prague"]
?f

ClearAll[f];
f:=Random[]
{f,f,f,f,f,f}

ClearAll[f];
f=Random[]
{f,f,f,f,f,f}

ClearAll[f,x]
f[x_]:=∫Sin[x]\[DifferentialD]x
f[5]

ClearAll[f,x]

f[x_]=∫Sin[x]\[DifferentialD]x
f[5]

ClearAll[f];
f[x_]:=1+x;
f[1]:=7;
f[x_,y_]:=(x^y);
f[4,y_]:=(y^2);
f[{a_,b_}]:={b,a};
f[{1,5}]

$RecursionLimit=(10^6);
ClearAll[a];
a[n_]:=n*a[n-1];
a[0]:=1;
Trace[a[3]];
Timing[Table[a[i],{i,1050}]][[1]]

ClearAll[a];
a[n_]:=a[n]=n*a[n-1];
a[0]:=1;
Trace[a[3]];
Timing[Table[a[i],{i,1850}]][[1]]

ClearAll[a];
a[n_]:=a[n]=n*a[n-1];
a[0]:=1;
a[5]
Trace[a[6]]

?/;

ClearAll[f];
f[x_]:=1-(x^2)/;-1<x≤1;
f[x_]:=f[x-2]/;x>1;
f[x_]:=f[x+2]/;x≤1;
(*Plot[f[x],{x,-5,5}]*)
Trace[f[4.56]];

ClearAll[f,z,y];
f[x_]:=Module[{y,z,w},
y=(Sqrt[x]);
z=(∫_1^y)Sin[t+x]\[DifferentialD]t;
w
];
f[2]

ClearAll[f];
f[x_]:=(x^2);
f[5]

((#)^2)&[5]

test[-5]

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

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

t:=((#1)^2)-#2&
t[Pi,E]

Options[Plot]

Plot[Sin[x],{x,0,6Pi},AlignmentPoint->Center,AspectRatio->(1/GoldenRatio),Axes->True,AxesLabel->None,AxesOrigin->Automatic,AxesStyle->{},Background->None,BaselinePosition->Automatic,BaseStyle->{},ClippingStyle->None,ColorFunction->Automatic,ColorFunctionScaling->True,ColorOutput->Automatic,ContentSelectable->Automatic,CoordinatesToolOptions->Automatic,DisplayFunction:>$DisplayFunction,Epilog->{},Evaluated->Automatic,EvaluationMonitor->None,Exclusions->Automatic,ExclusionsStyle->None,Filling->None,FillingStyle->Automatic,FormatType:>TraditionalForm,Frame->False,FrameLabel->None,FrameStyle->{},FrameTicks->Automatic,FrameTicksStyle->{},GridLines->None,GridLinesStyle->{},ImageMargins->0.`,ImagePadding->All,ImageSize->Automatic,ImageSizeRaw->Automatic,LabelStyle->{},MaxRecursion->Automatic,Mesh->None,MeshFunctions->{#1&},MeshShading->None,MeshStyle->Automatic,Method->Automatic,PerformanceGoal:>$PerformanceGoal,PlotLabel->None,PlotLabels->None,PlotLegends->None,PlotPoints->Automatic,PlotRange->{Full,Automatic},PlotRangeClipping->True,PlotRangePadding->Automatic,PlotRegion->Automatic,PlotStyle->Automatic,PlotTheme:>$PlotTheme,PreserveImageOptions->Automatic,Prolog->{},RegionFunction->(True&),RotateLabel->True,TargetUnits->Automatic,Ticks->Automatic,TicksStyle->{},WorkingPrecision->MachinePrecision]

x=10!;
Plot[Sin[x],{x,0,6Pi},AxesLabel->{"x","Sin[x]"}];

(*Here is begining second lecture 2.3.2017*)
Plot[{Sin[x],Cos[x],2*Sin[x+2]},{x,0,6Pi},PlotStyle->{{Red,Dashed},{Hue[0.12],Thickness[0.02]},{RGBColor[1,0,1],Thick}}]

Manipulate[Plot[{a*Sin[x],Cos[b+x],2*Sin[x+2]},{x,0,6Pi},PlotStyle->{{Red,Dashed},{Hue[a],Thickness[0.02]},{RGBColor[1,0,1],Thick}}],{a,0,1},{b,-5,5,1}]

Manipulate[LogLogPlot[Abs[R+I*ω*L+(1/(I*ω*kap))],{ω,(10^(-8)),(10^10)},PlotRange->{Automatic,{(10^(-10)),(10^15)}}],{R,0,1000000},{L,0.001,1},{kap,10*(10^(-9)),10*(10^(-3))}]

ClearAll[f]
f[x:_]:=(x^2);
f[5]

ClearAll[f]
f[x_]:=(x^2);
f[5]

?/.

(x^2)+1/.x->4

x->4//TreeForm

Rule[x,4]

x->4//FullForm

(x^2)+1/.x->4

(x^2)+1/.{x->4,x->5}

(x^2)+1/.{{x->4},{x->5}}

(x^2)+1+y/.{x->4,y->5}

(x^2)+1/.{{x->4},{x->5}}

(x^2)==1//TreeForm

Equal[1==2]

Equal[a,b]

f[0]=5

Solve[(x^2)==1]

list[[0]]

list={me,you,{mother,father}};
list[[1]]
First[list]

list[[3,1]]

list[[3]][[1]]

list[[-1]]
Last[list]

SpokenString[(x^2)+2a*x+(1/((a^2)+1))]
Speak[%]

sol[[1]]

Remove["Global`*"]

ClearAll["Global`*"]
eqn=(x^2)+2a*x+(1/((a^2)+1))==0;
sol=Solve[eqn,x];
x1=(E^(a*(x+1)))/.sol[[1]];
Plot[x1,{a,1,2}]

a+b+c+d+e//TreeForm

Range[10]/.List->Times
10!

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

f[x_]=(x^2);
lhs==rhs/.(a_==b_)->a-b

f[x_]:=(x^2);
lhs==rhs/.(a_==b_):>a-b

a:=Random[]
a

a=Random[]
?a

eqn=Sin[x]==1;
sol=FindRoot[eqn,{x,10}]
(eqn/.a_==b_:>a-b)/.sol

ClearAll[f];
f[x_Integer]:=x+1;
f[10]

test[x_]:=x>5;
ClearAll[f];
f[x_?test]:=x+1;
f[4]

ClearAll[f];
f[x_?(#>5&)]:=x+1;
f[4]

Table["cow",{10}]

Table[i,{i,10.999}]

Table[i,{i,0.2,5.3,0.7}]

list=Table[(E^i),{i,1,10}]
list/.((a_)^(b_)):>(b^a)

list=Table[(E^i),{i,2,10}]
list/.((a_)^(b_?(#>5&))):>(b^a)

f[x_?(#>5&)]:=x+1;

points=Table[{x,(x^2)},{x,-1,1,0.1}];
pl1=ListPlot[points];
pl1/.{x_,y_}:>{y,x}

DSolve[y'[x]==-y[x],y[x],x]

sol=DSolve[{y'[x]==-y[x],y[0]==10},y[x],x]

Plot[y[x]/.sol,{x,0,5}]

(*1.test 9.3.2017*)

sol=DSolve[{y''[t]+(1/((t^2)+1))*y[t]==0,y[0]==0,y'[0]==1},y[t],t]
Plot[y[t]/.sol,{t,0,12},PlotStyle->{Thick,Brown},AxesLabel->{"t","y[t]"},GridLines->Automatic]

sol2=Solve[{a+2b==Cos[2x+1],a-7b==Sin[x-1]},{a,b}]
Plot[(a^2)+(b^2)/.sol2,{x,0,4Pi},PlotStyle->{Thick,Red},AxesLabel->{"x","(a^2)+(b^2)"}]

(*Third Lecture 9.3.2017*)

data=Table[{x,Sin[x]},{x,0.,2Pi,(Pi/5)}];
intSin=Interpolation[data,InterpolationOrder->3];
intSin[[1,1]]
(*Plot[{intSin[x],Sin[x]},{x,-2Pi,4Pi}];*)

data=Table[{x,Sin[x]},{x,0.,2Pi,(Pi/5)}];
intSin=Interpolation[data,InterpolationOrder->3];
{xmin,xmax}=intSin[[1,1]]
Plot[{intSin[x],Sin[x]},{x,xmin,xmax}]

x[y_]:=x/.FindRoot[y==x+(E^x),{x,1}]
x[3]

dataYX=Table[{x+(E^x),x},{x,-1.,5,0.01}];
intx=Interpolation[dataYX];
intx[3]

Timing[Table[x[y],{y,1,3,0.0001}]][[1]]

Timing[Table[intx[y],{y,1,3,0.0001}]][[1]]

0.5*(((x-2))^2)//Expand

ClearAll[x,noiseLevel]
pureSignal[x_]:=2. -2. x+0.5 (x^2);
noiseLevel=.5;
noise:=RandomReal[{-noiseLevel,noiseLevel}];
signal[x_]:=pureSignal[x]+noise;
data=Table[{x,signal[x]},{x,0,4,0.001}];
pl1=ListPlot[data];
fit=Fit[data,{1,x,(x^2)},x]
Show[pl1,Plot[fit,{x,0,4},PlotStyle->Red]]

Length[data]

ClearAll[f];
f[{x_,y_}]:=(((y-(a*(x^2)+b*x+c)))^2);
totalErr1=(∑_(i=1)^(Length[data]))f[data[[i]]];
totalErr2=Total[f/@data];
eqns=0==D[totalErr2,#]&/@{a,b,c};
Solve[eqns]
fit

eqns={0==D[h[a,b,c],a],0==D[h[a,b,c],b],0==D[h[a,b,c],c]}

0==D[h[a,b,c],#]&/@{a,b,c}

g/@{a,b,c}
Total[g/@{a,b,c}]

Off[FindMinimum::lstol]
nPoints=10;
randomInteger:={RandomInteger[{-10,10}],RandomInteger[{-10,10}]};
points=Table[randomInteger,{nPoints}];
ClearAll[f];
f[{xp_,yp_}]:=(Sqrt[(((x-xp))^2)+(((y-yp))^2)]);
totalDistance=Total[f/@points];
minimumResult=FindMinimum[totalDistance,{x,y}];
pl1=ListPlot[points,PlotStyle->{Large,Red}];
desiredPoint={x,y}/.minimumResult[[2]];
pl2=ListPlot[{desiredPoint},PlotStyle->{Large,Blue}];
Show[pl1,pl2,PlotRange->All]

pl1=ListPlot[points]

MapThread

points
f/@points

funct/@points

f[{1,2}]

(*here the 5th lesson starts*)

Remove["Global`*"]

NestWhileList[#/2&,123456,EvenQ]

{EvenQ[1],EvenQ[2]}

function[x_]:=(x/2);
NestWhileList[function,123456,EvenQ]

NestList[f,xStart,5]

Series[y[t+Δt],{Δt,0,5}]

f[x:_]:=(x^2)
f[x_]:=(x^2)

derivative[{t_,y_}]:=-((Tanh[(y^2)+t*y])/(1+Log[(y^2)+t]));
tStart=1.;
tEnd=10;
nSteps=50;
Δt=((tEnd-tStart)/nSteps);
yStart=15;
EulerianStep[state:{t_,y_}]:={t+Δt,y+derivative[state]};
solution=NestList[EulerianStep,{tStart,yStart},nSteps];
ListPlot[solution]

ClearAll[f];
f[x_]:=x+0.5(x^2)*Exp[0.5x]-15;
Plot[f[x],{x,0,4}];
step[x_]:=x-((f[x])/(f'[x]));
NestList[step,4,4]