事先聲明,本手冊既不完整,又不準確。本手冊是從Mathematica幫助文檔中的MATHEMATICS AND ALGORITHMS和VISUALIZATION AND GRAPHICS中節選,再加上了我的一些翻譯而完成。
Shift+Enter用於輸入表達式
Crtl+K用於打開輸入提示
用於展開代數式
Expand[poly,patt] 用變量patt展開多項式poly
ExpandAll[expr] 徹底展開表達式
對代數式因式分解
N用於將符號轉爲數值
將表達式expr的x用value替換
perform several replacements
定義變量x並賦值value
將變量x清除
Simplify[expr]用於化簡表達式
Simplify[expr,assum] simplify expr with assumptions
FullSimplify用於更大範圍的化簡
Together[expr] 通分
Apart[expr] 部分分式展開
Apart[expr,var] 以變量var對錶達式expr進行部分分式展開
Cancel[expr] 分式約分
Collect[expr,x] 將表達式按x合併同類項
Collect[poly,{x,y,…}] arrange a polynomial as a sum of powers of x, y, …
Collect[poly,patt,h] apply h to each final coefficientobtained
FactorTerms[expr,x] pull out factors that do not depend on x
FactorTerms[poly] 提取公因式
FactorTerms[poly,{x,y,…}] pull out any overall factorthat does not depend on x, y, …
TrigExpand[expr] 三角函數表達式的展開
TrigFactor[expr] 三角函數表達式的因式分解
TrigReduce[expr] 三角函數化簡
TrigToExp[expr] 將三角函數轉化爲指數形式
ExpToTrig[expr] 將指數形式轉換爲三角函數形式
FunctionExpand[expr] expand out special and other functions
ComplexExpand[expr] 將表達式按複數展開
PowerExpand[expr] 將(x y)p 轉換爲xp yp
PowerExpand[expr,Assumptions->assum] expand out expr assuming assum
Element[x,dom] 聲明x屬於dom域
Element[{x1,x2,…},dom] state that all the xi are elements of the domain dom
Reals 實數
Integers 整數
Primes 素數
Coefficient[expr,form] 求表達式中變量的係數
Exponent[expr,form] 求表達式expr中變量form的最大指數
Part[expr,n]或expr[[n]] 求表達式expr的第n項
Numerator[expr] 求表達式expr的分子
Denominator[expr] 求表達式expr的分母
Postfix[f[expr]]
prints with f[expr] given in default postfixform: expr//f
執行command並且不輸出
expr//Short 顯示錶達式輸出的一行
Short[expr,n] 顯示錶達式輸出的n行
讀入文件包
HornerForm[expr,x] 使表達式expr以x的嵌套形式展現
PolynomialQ[expr,x] 查詢expr是否是x的多項式
PolynomialQ[expr,{x1,x2,…}] test whether expr is a polynomial in the xi
Variables[poly] 取得多項式poly的變量
Coefficient[poly,expr] 求多項式poly中表達式expr的係數
MonomialList[poly] 獲取多項式poly的單項式
CoefficientRules[poly] 獲取多項式poly的單項式的指數向量和係數
ExpandNumerator[expr] 只展開分子
ExpandDenominator[expr] 只展開分母
PolynomialQuotient[ ,q(x),x] 對於 ,求得
PolynomialRemainder[ ,q(x),x] 對於 ,求得b(x)
PolynomialGCD[poly1,poly2] 求最大公約數
PolynomialMod[poly,m] 化簡poly,通過用m減去某多項式的m倍
Factor[poly,Extension->{a1,a2,…}] 因式分解是允許引入a1,a2,…
Factor[poly,Extension->Automatic] 因式分解允許引入代數數
LogicalExpand[expr] 將邏輯函數展開
PiecewiseExpand[expr] 分段函數展開
PiecewiseExpand[expr,assum] expand out with the specifiedassumptions
賦值
判斷x和y是否相等
Solve[lhs==rhs,x] 解方程
use the list of rules to get values for x
usethe list of rules to get values for an expression
Solve[{lhs1==rhs1,lhs2==rhs2,…},{x,y,…}] 解方程組
Solve[eqns,vars,elims] find solutions for vars, eliminating the variables elims
SolveAlways[eqns,vars] 求使方程恆成立的係數值
Eliminate[{lhs1==rhs1,lhs2==rhs2,…},{x,…}] 消元
Eliminate[eqns,elims] rearrange equations toeliminate the variables elims
Reduce[{lhs1==rhs1,lhs2==rhs2,…},{x,y,…}] 化簡方程(有時比Solve更強大)
Root[f,k] 代表方程f[x]==0的第k個根
FindRoot[lhs==rhs,{x,x0}] 尋找方程的根,從x=x0開始找
InverseFunction[f] 求反函數
InverseFunction[f,k,n] the inverse function of the n-argument function f with respect to its k_th argument
CountRoots[poly,x] 得到多項式的實根數
關係運算符
等式
unequal(also input as x ¹ y)
大於
大於等於
小於
小於等於
all equal
all unequal (distinct)
x>y>z,etc. strictly decreasing, etc.
邏輯運算符
非
與
或
Xor[p,q,…] 異或
Nand[p,q,…] 與非
Nor[p,q,…] 或非
If[p,then,else] 如果p成立,則執行then,否則執行else
Reduce[{ineq1,ineq2,…},x] 化簡不等式
Reduce[{ineq1,ineq2,…},{x1, x2 ,…}] reduce a collectionof inequalities in several variables
Reduce[{expr1,…,x1Îdom1,…},vars] explicitly specify individual domains for variables
Reduce[expr,vars,dom] reduce eqns over the domain dom
FindInstance[ineqs,{x1,x2,…}] 找到滿足不等式的一個值
FindInstance[ineqs,vars,n] try to find n instances
Minimize[expr,{x1,x2,…}] 求最小值
Minimize[{expr,cons},{x1,x2,…}] minimize expr subject to the constraints cons
Maximize[expr,{x1,x2,…}] 求最大值
Maximize[{expr,cons},{x1,x2,…}] maximize expr subject to the constraints cons
Sum[f,{i,imin,imax}] 求累和 the sum
Sum[f,{i,imin,imax,di}] the sum with i increasing in steps of di
Sum[f,{i,imin,imax},{j,jmin,jmax}] the nested sum
Product[f,{i,imin,imax}] 求累積
表示無窮
Series[expr,{x,x0,n}] 級數展開 find the power seriesexpansion of expr about the point x=x0 to at most n_th order
Series[expr,{x,x0,nx},{y,y0,ny}] find series expansions with respect to y, then x
Normal[series] truncate a power series to give an ordinary expression
RSolve[eqn,a[n],n] 解遞歸方程
RSolve[{eqn1,eqn2,…},{a1[n],a2[n],…},n] solve a coupled system ofrecurrence equations
RSolve[eqns,a[n1,n2,…],{n1,n2,…}] solve partial recurrenceequations
Limit[expr,x->x0] 求極限 find the limit of expr when x approaches x0
Limit[expr,x->x0,Direction->1] 求左極限
Limit[expr,x->x0,Direction->-1] 求右極限
Residue[expr,{x,x0}] 求留數 the residue of expr when x equals x0
D[f,x] 求偏導數 partial derivative
D[f,x,y,…] multiple derivative
D[f,{x,n}] 求n階偏導數 derivative
Dt[f] 求全微分df
Dt[f,x] 求全微分
Dt[f,x,y,…] multiple total derivative
Dt[f,x,Constants->{c1,c2,…}] total derivative with ci constant (i.e., d ci=0)
y/:Dt[y,x]=0 set
SetAttributes[c,Constant] define c to be a constant in all cases
Integrate[f,x] 求f的不定積分
Integrate[f,x,y] the multiple integral
Integrate[f,{x,xmin,xmax}] 求定積分
Integrate[f,{x,xmin,xmax},{y,ymin,ymax}] the multiple integral
Integrate[f Boole[cond],{x,xmin,xmax},{y,ymin,ymax}] integrate f over the region where cond is True
DSolve[eqn,y[x],x] 解微分方程 solve a differential equationfor y[x]
DSolve[eqn,y,x] solve a differential equationfor the function y
DSolve[{eqn1,eqn2,…},{y1,y2,…},x] solve a list of differentialequations
DSolve[eqn,y[x1,x2,…],{x1,x2,…}] solve a partial differentialequation for y[x1,x2,…]
DSolve[eqn,y,{x1,x2,…}] solve a partial differentialequation for the function y
LaplaceTransform[expr,t,s] 求拉普拉斯變換
InverseLaplaceTransform[expr,s,t] 求拉普拉斯反變換
LaplaceTransform[expr,{t1,t2,…},{s1,s2,…}] the multidimensional Laplacetransform of expr
InverseLaplaceTransform[expr,{s1,s2,…},{t1,t2,…}] the multidimensional inverseLaplace transform of expr
FourierTransform[expr,t,w] 傅里葉變換
InverseFourierTransform[expr,w,t] 傅里葉反變換
通過設置FourierParameters,可設置傅里葉變換的算法
FourierSinTransform[expr,t,w] Fourier sine transform
FourierCosTransform[expr,t,w] Fourier cosine transform
InverseFourierSinTransform[expr,w,t] inverse Fourier sine transform
InverseFourierCosTransform[expr,w,t] inverse Fourier cosinetransform
ZTransform[expr,n,z] Z變換
InverseZTransform[expr,z,n] Z反變換
DiracDelta[x] 衝激函數 Dirac delta function d(x)
HeavisideTheta[x] 類似階躍函數 Heaviside theta function q(x), equal to 0 for x<0 and 1 for x>0
DiracDelta[x1,x2,…] multidimensional Dirac deltafunction
HeavisideTheta[x1,x2,…] multidimensional Heavisidetheta function
DiscreteDelta[n1,n2,…] discrete delta d(n1,n2,…)
KroneckerDelta[n1,n2,…] Kronecker delta
Mean[ ] 求平均值
Mean[{{x1,y1,…},{x2,y2,…},…}] a list of the means of the xi,yi,…
Median[list] 求中間值
Max[list] 求最大值
Variance[list] 求方差
StandardDeviation[list] 求標準差
Quantile[data,q] 求分位數 gives the location before which(100q) percent of the data lie
Commonest[data] list of the elements withhighest frequency
MeanDeviation[data] 求絕對平均差
MedianDeviation[data] 中間數平均差 median absolute deviation,median of Èxi-medianÈ values
Covariance[v1,v2] 求協方差
Correlation[v1,v2] 求相關係數
Expectation[f[x],xélist] 求期望 (可以通過Esc dist Esc來打出é)
BinomialDistribution[n,p] 產生試驗次數爲n,每次實驗成功的概率爲p的二項分佈
BernoulliDistribution[p] 產生成功概率爲p的兩點分佈
NormalDistribution[m,s] 產生正態分佈
PDF[dist,x] 求概率密度函數
FindClusters[data] partition data into lists of similarelements
FindClusters[data,n] partition data into exactly n lists of similar elements
Nearest[{elem1,elem2,…},x] 求最接近值 give the list of elemi to which x is nearest
Fit[{y1,y2,…},{f1,f2,…},x] fit the values yn to a linear combination offunctions fi
Fit[{{x1,y1},{x2,y2},…},{f1, f2,…},x] fit the points (xn,yn) to a linear combination ofthe fi
FindFit[data,form,{p1,p2,…},x] find a fit to form with parameters pi
Fourier[data] 數值的傅里葉變換
InverseFourier[data] 數值的傅里葉反變換
Fit[{f1,f2,…},{fun1,fun2,…},x] 曲線擬合 find a linear combination ofthe funi that best fits the values fi
Fit[data,{fun1,fun2,…},{x,y,…}] fit to a function of severalvariables
FindFit[data,form,{par1,par2,…},x] search for values of the pari that make
form best fit data
FindFit[data,form,pars,{x,y,…}] fit multivariate data
finds a best fit subject tothe parameter constraints
cons
Interpolation[{f1,f2,…}] construct an approximatefunction with values fi at
successive integers
Interpolation[{{x1,f1},{x2,f2},…}] 求近似函數construct an approximatefunction with values fi at points xi
Fourier[{u1,u2,…,un}] 離散傅里葉變換
InverseFourier[{v1,v2,…,vn}] 離散傅里葉反變換
Fourier[{{u11,u12,…},{u21,u22,…},…}] two-dimensional discreteFourier transform
FourierDCT[list] Fourier discrete cosinetransform of a list of real numbers
FourierDST[list] Fourier discrete sinetransform of a list of real numbers
FourierDCT[list,m] Fourier discrete cosinetransform of type m
FourierDST[list,m] Fourier discrete sinetransform of type m
繪圖部分
Plot[f,{x,xmin,xmax}] 繪圖 plot f as a function of x from xmin to xmax
Plot[f,{x,x0,x1,…,xk}] plot f over a series of segments,potentially breaking the curve at each of the xi
Show[plot,option->value] 重畫 redraw a plot with optionschanged
Show[plot1,plot2,…] 聯合繪圖 combine several plots
GraphicsGrid[{{plot1,plot2,…},…}] draw an array of plots
InputForm[plot] show the underlying textualdescription of the plot
Plot3D[f,{x,xmin,xmax},{y,ymin,ymax}] 畫三維圖 make a three-dimensional plotof f as a function of thevariables x and y
ListPlot[{y1,y2,…}] 畫點圖 plot y1,y2,… at x values 1,2,…
ListPlot[{{x1,y1},{x2,y2},…}] plot points (x1,y1),…
ListLinePlot[list] join the points with lines
ListPlot3D[{{z11,z12,…},{z21,z22,…},…}] make a three-dimensional plotof the array of heights zyx
ListPlot3D[{{x1,y1,z1},{x2,y2,z2},…}] make a three-dimensional plotwith heights zi at positions {xi,yi}
ListContourPlot[array] make a contour plot
ListDensityPlot[array] make a density plot
ParametricPlot[{fx,fy},{t,tmin,tmax}] 參數繪圖
ParametricPlot[{{fx,fy},{gx,gy},…},{t,tmin,tmax}] plot several parametric curvestogether
ParametricPlot3D[{fx,fy,fz},{t,tmin,tmax}] make a parametric plot of athree-dimensional curve
ParametricPlot3D[{fx,fy,fz},{t,tmin,tmax},{u,umin,umax}] make a parametric plot of athree-dimensional surface
ParametricPlot3D[{{fx,fy,fz},{gx,gy,gz},…},…] plot several objects together
Play[f,{t,0,tmax}] 播放函數的聲音 play a sound with amplitude f as a function of time t in seconds
Play[f,{t,0,tmax},SampleRate->r] play a sound, sampling it r times a second