Untersuchung einer gebrochen-rationalen Funktion
> restart;
with(plots):
with(RealDomain):
with(Student[Calculus1]):
interface(displayprecision = 3):
with(RealDomain):
with(Student[Calculus1]):
interface(displayprecision = 3):
Definition einer gebrochen-rationalen Funktion:
> zaehler:= x^2-x^3+x-1/6:
nenner:= x*(x+1)*(x-2)^2:
f(x):= simplify(zaehler/nenner):
f:= unapply(f(x), x);
f(x):= simplify(zaehler/nenner):
f:= unapply(f(x), x);
Bestimmung der Menge aller Nullstellen von f:
> N:= {fsolve(numer(f(x)) = 0)};
Bestimmung der Menge aller Polstellen von f:
> P:= {fsolve(denom(f(x)) = 0)};
Skalierung der Koordinatenachsen unter Beachtung von Randbedingungen:
> vips:= N union P:
if (nops(vips) = 0) then
vmin:= 0:
vmax:= 0:
else
vmin:= min(vips):
vmax:= max(vips):
fi:
d:= vmax-vmin:
if (d = 0) then d:= abs(5*vmax): fi:
if (d = 0) then d:= 5: fi:
xmin:= 1.0*round(vmin - d);
xmax:= 1.0*round(vmax + d);
extr:= ExtremePoints(f(x), x = xmin..xmax, numeric):
extr:= convert(extr,set) minus {xmin, xmax}:
if (nops(extr) = 0) then f_extr:= {max(f(xmin), f(xmax))/4}
else
f_extr:= {}:
for i from 1 to nops(extr) do
f_extr:= f_extr union {f(extr[i])}:
od:
fi:
ymin:= round(4*min(f_extr)):
ymax:= round(4*max(f_extr)):
yi:= min(ymin, -ymax):
ya:= max(ymax, -ymin):
if (yi = 0) then yi:= -5: fi:
if (ya = 0) then ya:= 5: fi:
ymin:= yi;
ymax:= ya;
vmin:= 0:
vmax:= 0:
else
vmin:= min(vips):
vmax:= max(vips):
fi:
d:= vmax-vmin:
if (d = 0) then d:= abs(5*vmax): fi:
if (d = 0) then d:= 5: fi:
xmin:= 1.0*round(vmin - d);
xmax:= 1.0*round(vmax + d);
extr:= ExtremePoints(f(x), x = xmin..xmax, numeric):
extr:= convert(extr,set) minus {xmin, xmax}:
if (nops(extr) = 0) then f_extr:= {max(f(xmin), f(xmax))/4}
else
f_extr:= {}:
for i from 1 to nops(extr) do
f_extr:= f_extr union {f(extr[i])}:
od:
fi:
ymin:= round(4*min(f_extr)):
ymax:= round(4*max(f_extr)):
yi:= min(ymin, -ymax):
ya:= max(ymax, -ymin):
if (yi = 0) then yi:= -5: fi:
if (ya = 0) then ya:= 5: fi:
ymin:= yi;
ymax:= ya;
Zeichnen des Schaubildes von f:
> Schaubild:= plot(f(x),
view = [xmin..xmax, ymin..ymax],
color = red,
xtickmarks = 6,
discont = true):
Asymptoten:= seq(plot([[P[i], -8], [P[i], 5]],
view = [xmin..xmax, ymin..ymax],
color = blue),
i = 1..nops(P)):
display([Asymptoten, Schaubild],
size = [400, 400],
axesfont = [COURIER, 10],
labelfont = [COURIER, 12, italic],
labels = ["x", "f(x)"],);
color = red,
xtickmarks = 6,
discont = true):
Asymptoten:= seq(plot([[P[i], -8], [P[i], 5]],
view = [xmin..xmax, ymin..ymax],
color = blue),
i = 1..nops(P)):
display([Asymptoten, Schaubild],
size = [400, 400],
axesfont = [COURIER, 10],
labelfont = [COURIER, 12, italic],
labels = ["x", "f(x)"],);