Quick guide to Mathematica

To get help, place the cursor on the function and press F1
To run all commands in one cell, place the cursor there and press Shift + Enter or Enter on the numerical keyboard.
Output of many commands is suppressed by ; at the end of the command. If you want to see the output, delete ;
Argument of functions must be in square brackets [...], braces {...} are for arrays, ranges etc., use double brackets [[...]] to access elements of arrays
expr /. {x -> a} means substitute a for x in expr, expr // function means apply function to expr, i.e. it is equivalent to function[expr].
D[f[x],x] = derivative of f[x] with respect to x.
To define a function of x one can use f[x_] := 1+(x^2), notice the underscore and the colon, or # nad & like in f := 1+((#)^2) &
N[expr] evaluates expr with machine precision, if you use the decimal point in the expression it will be also evaluated with machine precision
Special characters can be inserted by pressing Esc ... Esc, e.g. Esc p Esc gives π
Clear[...] is used to unset any variables which could have been assigned previously.
Some other useful commands: Simplify, Expand, Factor; Integrate, Series, Sum

Clear all symbols from previous evaluations to avoid problems

Clear["Global`*"]

Numerical solution of differential equations

Coefficients and errors of methods

Linear multistep methods

{order,errorConstants}=MyOrderOfAccuarcyOfLMM[{1,-2,1},{0,0,0}]

{α,β}=MyGetLMMCoefficients["Most Accurate 2-step Explicit",1]
{ρ[z]=MyPolynomial[α,z],σ[z]=MyPolynomial[β,z]}
{order,errorConstants}=MyOrderOfAccuarcyOfLMM[α,β]

λ=-50;
f1[u_,t_]:=λ u;
t0=0;
u0=1;
n=20;
k=1/50;
tn=k * n;
nsol[lmm_,ini_]:=MyODESolveUsingLMM[lmm,f1,t0,ini,k,n];
ps=0.02;
Show[{ Plot[u0 Exp[λ(t-t0)],{t,t0,tn},PlotStyle->Red,AxesOrigin->{0,0},PlotRange->All],
ListPlot [{
nsol[MyGetLMMCoefficients["Euler",1],{u0}],
nsol[MyGetLMMCoefficients["Adams-Bashforth",2],{u0,u0 Exp[λ (t0+k)]}],
nsol[MyGetLMMCoefficients["Most Accurate 2-step Explicit",2],{u0,u0 Exp[λ (t0+k)]}]
},
PlotStyle->{
{Blue,PointSize[ps]},
{Green,PointSize[ps]},
{Black,PointSize[ps]}
},
  Joined->True
],
ListPlot [{
MyODESolveUsingRK[MyGetRKCoefficients["Classical",1],f1,t0,u0,k,n],
MyODESolveUsingRK[MyGetRKCoefficients["Classical",2],f1,t0,u0,2k,n/2],
MyODESolveUsingRK[MyGetRKCoefficients["Classical",4],f1,t0,u0,2k,n/2],
MyODESolveUsingRK[MyGetRKCoefficients["Cash-Karp",5],f1,t0,u0,2k,n/2]
},
PlotStyle->{
{Orange},
{Red},
{Purple},
{Yellow}
},
Joined->False
]
},PlotRange->{0,1}]

f1[u_,t_]:=0;
t0=0;
u0=0;
n=10;
k=1/20;
tn=n*k;
nsol[lmm_,ini_]:=MyODESolveUsingLMM[lmm,f1,t0,ini,k,n];
ps=0.02;
Show[{ Plot[u0 Exp[λ(t-t0)],{t,t0,tn},PlotStyle->Red,PlotRange->All],
ListPlot [{
nsol[MyGetLMMCoefficients["Euler",1],{u0}],
nsol[MyGetLMMCoefficients["Most Accurate 2-step Explicit",1],{u0,u0+k}],
nsol[MyGetLMMCoefficients["Adams-Bashforth",4],{u0,u0+k,u0+2k,u0+3k}],nsol[{{1,-2,1},{0,0,0}},{u0,u0+k}]
},
PlotStyle->{
{Blue,PointSize[ps]},{Green,PointSize[ps]},{Orange,PointSize[ps]},{Black,PointSize[ps]}
}
]}]

M=5;
λ=-10;
t0=0;
u0=1;
tN=3;
f1[u_,t_]:=λ(u-Cos[t])-Sin[t];
sol[t_]:=Exp[λ(t-t0)](u0-Cos[t0])+Cos[t];
k=1/8;
inivals={u0,sol[t0+k],sol[t0+2k],sol[t0+3k],sol[t0+4k]};
nsol[lmm_,ini_]:=MyODESolveUsingLMM[lmm,f1,t0,ini,k,tN/k];
colors={Red,Blue,Green,Orange,Brown};
Do[
{α,β}=MyGetLMMCoefficients["Adams-Bashforth",j];
ρ[z_]:=MyPolynomial[α,z];
σ[z_]:=MyPolynomial[β,z];
bb[θ_]=ρ[Exp[I θ]]/σ[Exp[I θ]];
plot[j]=ListPlot[nsol[{α,β},inivals[[1;;j]]],
PlotStyle->{colors[[j]],PointSize[0.01]},Joined->False];
region[j]=ParametricPlot[{Re[bb[θ]],Im[bb[θ]]},{θ,0,2π},PlotRange->{{-2,1},{-1,1}}/0.5,PlotStyle->colors[[j]]]
,{j,1,M}
];
Show[{Plot[Cos[t],{t,0,tN},PlotStyle->Red,AxesOrigin->{0,0}], Plot[sol[t],{t,t0,tN}],Table[plot[j],{j,1,M}]},PlotRange->{{0,tN},{-1,u0}}]

Show[Table[region[j],{j,1,5}],Graphics[{PointSize[Large],Black,Point[{λ k,0}]}]]