在函数域上绘制图形
以符号形式确认函数域并在其上绘图.
In[1]:=
![Click for copyable input](assets.zh/plot-a-function-over-its-domain/In_68.png)
f = Sqrt[x^3 - x]/(x^2 + 1)
Out[1]=
![](assets.zh/plot-a-function-over-its-domain/O_54.png)
In[2]:=
![Click for copyable input](assets.zh/plot-a-function-over-its-domain/In_69.png)
domain = With[{f = f}, ImplicitRegion[FunctionDomain[{f}, x], x]]
Out[2]=
![](assets.zh/plot-a-function-over-its-domain/O_55.png)
In[3]:=
![Click for copyable input](assets.zh/plot-a-function-over-its-domain/In_70.png)
Plot[f, Element[x, domain], PlotTheme -> "Scientific",
Filling -> Axis, ImageSize -> 400]
Out[3]=
![](assets.zh/plot-a-function-over-its-domain/O_56.png)