Section 1.8

Calculus I
Andy Long

This example has got a hole in its graph, at x=0....

f[x_]:=(Cos[x]-1)/x^2
Plot[f[x],{x,-1,1}]
Plot[f[x],{x,-.01,.01}]
Plot[f[x],{x,-.000001,.000001}] (* But it's not this crazy! This is numerical instability: *)

Floor and Ceiling are interesting discontinuous functions:

PlotA=Plot[Floor[x],{x,0,5},PlotRange->{0,5}];
PlotB=Plot[Ceiling[x],{x,0,5},AxesOrigin->{0,0},PlotRange->{0,5}];
{PlotA,PlotB}
Floor[4] (* both floor and ceiling give the same answer on integers: *)
Ceiling[4]

The following plot show a little better the nature of the discontinuities. In particular, what are the right and left limits at each discontinuity?

PlotA=Plot[Floor[x],{x,0,5},AxesOrigin->{0,0},PlotRange->{0,5},PlotLabel->"Floor"];
PlotB=ListPlot[Floor[Range[5]]];
Show[PlotA,PlotB]
PlotA=Plot[Ceiling[x],{x,0,5},AxesOrigin->{0,0},PlotRange->{0,5},PlotLabel->"Ceiling"];
PlotB=ListPlot[Ceiling[Range[5]]];
Show[PlotA,PlotB]

#19, p. 91:

g[x_]:=Piecewise[{{1-x^2,x<1},{1/x,x≥1}}];
Plot[g[x],{x,0,4}]
Limit[g[x],x->2]
g[2]

#23, p. 91:

f[x_]:=(x^2-x-2)/(x-2)
Plot[f[x],{x,0,4}]
Limit[f[x],x->2]
f[2]

#36, p. 91: Since Sin is continuous, and x is continuous, x+Sin[x] in continuous as a sum, and a composition of continuous functions is continuous, so we can simply replace x with its limiting value:

f[x_]:=Sin[x+Sin[x]]
Limit[f[x],x->Pi]
f[Pi]

#46, p. 92: This one has some interesting stuff going on. See if you can figure out what!:)

Clear[f,a,b]
f[x_]:=Piecewise[{{(x^2-4)/(x-2),x<2},{a x^2-b x+3,x<3},{2x-a+b,x≥3}}];
(* Limits must agree, left and right, at 2 and 3: *)
L1=Limit[f[x],x->2,Direction->1]
L2=Limit[f[x],x->2,Direction->-1]
(* and, for continuity, the limits must equal the function values: *)
f[2]
L3=Limit[f[x],x->3,Direction->1]
L4=Limit[f[x],x->3,Direction->-1]
f[3]
soln=Solve[L1==L2 && L3==L4,{a,b}]
a=Replace[a,soln][[1]]
b=Replace[b,soln][[1]]
Show[Plot[f[x],{x,1,4},PlotRange->All],Graphics[{Disk[{2,f[2]},0.05],Disk[{3,f[3]},0.05]}],AxesLabel->{x,y}]