
Seems that task 6 is about drawing tangentlines in graph for 6 points (x0..x5) and dividing the interval a..b in 5 intervals
So the procedure input must be
procedure ( function,interval a..b)
Did not add the interval a..b in the interval in the procedure and the tw procedures below are not working yet.
================================================================
Example 2.3 code ..
> 
with(Student[Calculus1]):

> 
f := x > x^sin(x):
df := D(f):
ddf := D(D(f)):
G := Array(1..6, 1..4):
P := Array(1..6, 1..2):
G[1..6, 1] := <Student:Calculus1:Roots(ddf(x), x=0..16, numeric)>:
for i from 1 to 6 do
G[i, 2] := f(G[i, 1]):
G[i, 3] := df(G[i, 1]):
G[i, 4] := G[i,2]+G[i,3]*(xG[i,1]):
P[i, 1] := plot(G[i,4], x=G[i,1]1..G[i,1]+1,
colour=red, adaptive=false, numpoints=2):
P[i, 2] := plots:pointplot([G[i,1],G[i,2]], symbol=solidcircle,
symbolsize=15, color=blue):
end do:
plots:display(plot(f, 0..16, color=black),
seq(seq(P[i,j], i=1..6), j=1..2),
size=[500,300]);

Using this code for making a procedure.
Function input in procedure : as expression or as function ?
Procedurename : InflectionF (function, interval,two points in interval )
Note: in code above the interval has a fixed value, so a variable intvx=a..b is needed
> 
restart;
InflectionF := proc(f)
local df, ddf, G, P, i, j ;
uses Student:Calculus1, plots;
df := D(f):
ddf := D(D(f)):
G := Array(1..6, 1..4):
P := Array(1..6, 1..2):
G[1..6, 1] := <Student:Calculus1:Roots(ddf(x), x=0..16, numeric)>:
for i from 1 to 6 do
G[i, 2] := f(G[i, 1]):
G[i, 3] := df(G[i, 1]):
G[i, 4] := G[i,2]+G[i,3]*(xG[i,1]):
P[i, 1] := plot(G[i,4], x=G[i,1]1..G[i,1]+1,
colour=red, adaptive=false, numpoints=2):
P[i, 2] := pointplot([G[i,1],G[i,2]], symbol=solidcircle,
symbolsize=15, color=blue):
end do:
display(plot(f, 0..16, color=black),
seq(seq(P[i,j], i=1..6), j=1..2),
size=[500,300]);
end proc:

> 
InflectionF(x > x^sin(x));


Other solution of task .. procedure ?
> 
with(Student:Calculus1):
with(plots):

> 
Inflpts := [ fsolve(ddf(x), x=0..16, maxsols=6) ];

> 
Q := map(p>[p,f(p)], Inflpts);

> 
# The tangent lines, using pointslope form
T := seq(plot(df(p)*(xp)+f(p), x=p1..p+1), p=Inflpts):

> 
display(FunctionPlot(f(x), x=0.0..16.0, sign=[], slope=[],
caption="", pointoptions=[symbolsize=1],
concavity=[color(cyan,magenta),filled(coral,wheat)]),
T,
pointplot(Q, symbolsize=10, symbol=solidcircle,
color=blue, legend="inflection points"),
axis[1]=[tickmarks=Inflpts], size=[800,400]);


> 
restart;
InflectionF := proc(f)
local df, ddf, G, P, Inflpts, Q, T;
uses Student:Calculus1, plots;
df := D(f);
ddf := D(D(f));
Inflpts := [ fsolve(ddf(x), x=0..16, maxsols=6) ];
Q := map(p>[p,f(p)], Inflpts);
T := seq(plot(df(p)*(xp)+f(p), x=p1..p+1), p=Inflpts):
display(FunctionPlot(f(x), x=0.0..16.0, sign=[], slope=[],
caption="", pointoptions=[symbolsize=1],
concavity=[color(cyan,magenta),filled(coral,wheat)]),
T,
pointplot(Q, symbolsize=10, symbol=solidcircle,
color=blue, legend="inflection points"),
axis[1]=[tickmarks=Inflpts], size=[800,400]);
end proc:

> 
InflectionF(x > x^sin(x));

