Course 4. 
Functions and Algebraic equations

Analytic procedures

Definition-plotting

y(x)=(1/2)-((a (e^x))/((e^x)+1))

y[x_]=1/2-a Exp[x]/(Exp[x]+1)

y[1]
Plot[y[x]/.a->1,{x,-3,3}]

Analysis

Limit[y[x],x->Infinity]

z[x_]=D[y[x],x]  
D[y[x],{x,2}]

Simplify[%]

u[x_]=Integrate[y[x],x]
uu=Integrate[y[x],{x,0,1}]

Taylor Series

s=Series[y[x],{x,0,5}]

SeriesCoefficient[s,3]
CoefficientList[s, x]

ss[x_]=Series[y[x],{x,0,5}] //Normal

Plot[{y[x]/.a->1,ss[x]/.a->1},{x,-4,4}, PlotStyle->{Blue, Red}]

Analytic solutions of equations

Roots of a polynomial equation

y[x_]=x^4-x^2-2
Plot[y[x],{x,-3,3}]

eq=y[x]==0
riza=Solve[eq,x]

x01=x/.riza[[3]]
x02=x/.riza[[4]]

f=#^4-#^2-2&
Root[f,1]
Root[f,2]
Root[f,3]
Root[f,4]

exact vs float coefficients

pol=#^5+2#+1&
Plot[pol[x],{x,-2,2}]
Solve[pol[x]==0,x]

Root[pol,1] //N
Root[pol,2]   //N
N[Root[pol,2],50]

Clear[a];
pol=#^5+a 2#+1&
Solve[pol[x]==0,x]

x0=Root[pol,2]
x0/.{a->1} //N

x0p=Series[x0,{a,0,5}] //N
Normal[x0p]/.{a->1}

Roots of a non-polynomial equation

y[x_]=(x/2)-Log[1+(E^x)]+1
Plot[y[x],{x,-3,3}]
riza1=Solve[{y[x]==0},x]
riza2=NSolve[y[x]==0,x]

xr=x/.riza1[[1]]
N[xr,50]

xr=x/.riza2[[1]]
N[xr,50]

Solutions of systems of equations

eq1=x^2-a y^2+y==0
eq2=x-2y==0
Solve[{eq1,eq2},{x,y}]

Reduce[{eq1,eq2},{x,y}]

Eliminate[{eq1,eq2},y]

Numerical procedures

Clear["Global`*"]

y[x_]=Sin[x^2]*Exp[x]/(Exp[x]+1)
Plot[y[x],{x,-5,15}]

Integrate[y[x],x]

Integrate[y[x],{x,-5,0}]

NIntegrate[y[x],{x,-5,0}]

Solve[y[x]==0,x]

NSolve[y[x]==0,x]

FindRoot[y[x]==0,{x,-2}]

FindRoot[y[x]==0,{x,3}] //InputForm

FindRoot[y[x]==0,{x,3}, AccuracyGoal->25, PrecisionGoal->25]  //InputForm

Systems of equations

eq1=((x^2)/2)-Log[1+(E^x)]-y==0;
eq2=x^4+x^2-Exp[y]==0;

y1=((x^2)/2)-Log[1+(E^x)]
y2=Log[x^4+x^2]
Plot[{y1,y2},{x,-2,2}, PlotStyle->{Blue,Red}]

FindRoot[{eq1,eq2},{x,0.5},{y,-1.0}]

Plotting functions of implicit form

(* f[x,y]==c *)
f=x^4-y^3+x
ContourPlot[f==1,{x,-2,2},{y,-2,2}]

ContourPlot[f,{x,-2,2},{y,-2,2}, Contours->{1}, ContourShading->False]

ContourPlot[f,{x,-2,2},{y,-2,2}, Contours->{-1,0,1,2}, ContourShading->False]

ContourPlot[f,{x,-2,2},{y,-2,2}, Contours->20, ContourShading->True]