SymbMathSymbMath

Computer Algebra System with Learning计算机代数系统学习

Dr. Weiguang HUANG黄博士郭华巍

226 Anzac Pde, Kensington, Sydney, NSW 2033, Australia226年以前偏微分方程、肯辛顿、悉尼、新南威尔士,澳大利亚

Phone:电话: (61 2) 9313858893138588(61 2)

E-mail: DrHuang@DrHuang.com电子邮件:DrHuang@DrHuang.com

http://www.SymbMath.comhttp://www.SymbMath.com

www.DrHuang.comwww.DrHuang.com

2 June 20092009年6月2

Copyright (C) 1990-2009版权(C)1990 - 2009


Contents内容

PART 1第1部分 User's Guide用户手册......................................... 77

1.1。 Introduction介绍.................................................. 77

1.1. 1.1。What is SymbMath什么是SymbMath.................................................. 77

1.2. 1.2。Capabilities能力............................................................. 77

1.3. 1.3。Shareware and Advanced Versions共享和先进的版本......................... 88

1.41.4 A List of Files in SymbMath在SymbMath某个目录下的文件..................................... 88

2. 2。Calculation计算.................................................... 1010

2.1. 2.1。Exact Calculation精确计算................................................... 1010

2.2. 2.2。Discontinuity and One-sided Value断续性和片面的价值........................ 1111

2.3. 2.3。Undefined and Indeterminate Form与不确定性预定义的形式........................ 1111

3. 3。Simplification简化................................................ 1212

3.1. 3.1。Assuming Domain假设领域.................................................. 1313

3.2. 3.2。Comparing and Testing Numbers比较和测试编号........................... 1414

4.4。 Defining Functions, Procedures and Rules定义功能、程序和规则 1515

4.1.4.1。 Defining Functions定义功能.............................................. 1515

4.1.1.4.1.1。 Defining Conditional Functions条件函数定义............................................................ 1515

4.1.2.4.1.2。 Defining Case Functions功能定义案件...................................................................... 1616

4.1.3.4.1.3。 Defining Piece-wise Functions功能定义分片............................................................ 1616

4.1.4.4.1.4。 Defining Recursion Functions递归函数定义.............................................................. 1717

4.1.5.4.4.5款所述。 Defining Multi-Value Functions价值函数定义............................................................. 1717

4.2.4.2。 Defining Procedures定义程序............................................. 1717

4.3.4.3。 Defining Rules定义规则...................................................... 1818

5.5。 Limits限制......................................................... 1818

5.1.5.1。 One-sided Limits片面限制.................................................. 1818

5.2.5.2。 Numeric Limits: nlim()数字限制:nlim()........................................... 2020

6. 6。Differentiation分化............................................... 2020

6.1.6.1。 One-sided Derivatives片面的衍生品.......................................... 2121

6.2.6.2。 Defining f '(x)定义f '(x)........................................................ 2121

7.7。 Integration整合.................................................... 2121

7.1. 7.1。Indefinite Integration不确定性整合.............................................. 2222

7.2. 7.2。Definite Integration明确的整合................................................ 2323

7.3. 7.3。Numeric Integration: ninte()数字集成:ninte().................................... 2424

8.8。 Solving Equations求解方程..................................... 2424

8.1.8.1。 Solving Algebraic Equations求解代数方程................................. 2424

8.2.8.2。 Equation Solver: solve()方程求解解决()....................................... 2525

8.3.8.3。 Polynomial Solver: psolve()多项式求解:psolve().................................. 2727

8.4.8.4。 Numeric Solver: nsolve()数值求解:nsolve()...................................... 2727

8.5.8.5。 Solving Differential Equations解微分方程............................... 2727

8.6.8.6。 Differential Solver: dsolve()微分求解:dsolve().................................. 2727

9.9。 Sums, Products, Series and Polynomials总结、产品、系列和多项式... 2828

9.1.9.1。 Partial Sum部分和........................................................... 2929

9.2.9.2。 Infinite Sum无限金额.......................................................... 2929

9.3.9.3。 Series系列.................................................................. 2929

9.4.9.4。 Polynomials多项式.......................................................... 3030

10. 10。Lists and Arrays, Vectors and Matrices列表和阵列、向量和矩阵..... 3030

10.1.10.1。 Lists名单................................................................. 3131

10.1.1.10.1.1。 Entering Lists进入名单.................................................................................... 3131

10.1.2.10.1.2。 Accessing Lists访问列表................................................................................ 3131

10.1.3.10.1.3。 Modifying Lists修改列表.................................................................................. 3232

10.1.4.10.1.4。 Operating Lists操作列表................................................................................. 3232

10.2.10.2。 Arrays阵列.............................................................. 3333

10.2.1.10.2.1。 Entering Arrays进入阵列.................................................................................... 3333

10.2.2.10.2.2。 Accessing Arrays访问数组................................................................................ 3333

10.2.3.10.2.3。 Modifying Arrays修改数组.................................................................................. 3333

10.2.4.10.2.4。 Operating Arrays操作阵列................................................................................. 3333

10.3.10.3。 Vectors and Matrices向量和矩阵...................................... 3434

11.11分。 Statistics统计................................................... 3434

12.12。 Tables of Function Values表的函数值........................ 3434

13.13岁。 Conversion转换................................................ 3535

13.1.13.1。 Converting to Numbers转换到数字....................................... 3535

13.2.13.2。 Converting to Lists转换列出............................................. 3535

13.3.13.3。 Converting to Strings转换成串.......................................... 3636

13.4.13.4。 Converting to Table转换表............................................ 3636

14.14。 Getting Parts of Expression获得部分的表达.................... 3636

14.1.14.1。 Getting Type of Data得到的数据类型.......................................... 3636

14.2.14.2。 Getting Operators获得运营商............................................... 3636

14.3.14.3。 Getting Operands得到操作数............................................... 3737

14.4.14.4。 Getting Coefficients变系数............................................ 3737

15.15。 Database数据库................................................... 3737

15.1.15.1。 Phone Number电话号码.................................................... 3737

15.2.15.2。 Atomic Weight原子的重量.................................................... 3838

15.3.15.3。 Chemical Reaction化学反应............................................. 3838

16.16岁。 Learning from User学习从用户.................................... 3838

16.1.16.1。 Learning Integrals from a Derivative从学习积分衍生工具................... 3838

16.2.16.2。 Learning Complicated Integrals from a Simple Integral学习复杂的积分从一个简单的积分 4040

16.3.16.3。 Learning Definite Integral from Indefinite Integral学习从不定积分定积分 4040

16.4. 16.4。Learning Complicated Derivatives from Simple Derivative学习复杂的衍生工具已从简单的衍生工具 4141

16.5.16.5。 Learning Integration from Algebra学习代数一体化的....................... 4141

16.6.16.6。 Learning Complicated Algebra from Simple Algebra从简单的代数学习复杂的代数 4141

16.7.16.7。 Learning vs. Programming学习与编程。.................................. 4242

PART 2第二部分 Programmer's Guide程序员的指导........................ 4343

17.17岁。 Programming in SymbMath规划在SymbMath....................... 4343

17.1.17.1。 Data Types数据类型......................................................... 4343

17.1.1.17.1.1。 Numbers编号............................................................................................... 4343

17.1.2.17.1.2。 Constants常数............................................................................................. 4444

17.1.3.17.1.3。 Variables变量.............................................................................................. 4545

17.1.4.17.1.4。 Patterns模式................................................................................................ 4646

17.1.5.17.1.5。 Functions, Procedures and Rules功能、程序和规则...................................................... 4646

17.1.5.1.17.1.5.1。 Standard Mathematical Functions标准数学函数.................................................. 4646

17.1.5.2.17.1.5.2。 Calculus Functions微积分功能........................................................................... 4747

17.1.5.3.17.1.5.3。 Test Functions测试函数.................................................................................. 4848

17.1.5.4.17.1.5.4。 Miscellaneous Functions功能项目................................................................. 5050

17.1.5.5.17.1.5.5。 User-defined Functions用户自定义函数的................................................................ 5151

17.1.5.6.17.1.5.6。 Procedures程序....................................................................................... 5151

17.1.5.7.17.1.5.7。 Rules规则.................................................................................................. 5151

17.1.6.17.1.6。 Equations方程............................................................................................. 5151

17.1.7.17.1.7。 Inequalities不等式........................................................................................... 5252

17.1.8.17.1.8。 Vectors or Lists向量或列出.................................................................................... 5252

17.1.9.17.1.9。 Matrices or Arrays矩阵或数组............................................................................... 5252

17.1.10.17.1.10。 Strings字符串................................................................................................ 5252

17.2.17.2。 Expressions表达式...................................................... 5353

17.2.1.17.2.1。 Operators运营商............................................................................................ 5353

17.2.1.1.17.2.1.1。 Arithmetic Operators算术运算符........................................................................ 5454

17.2.1.2.17.2.1.2。 Relational Operators关系运算符........................................................................ 5454

17.2.1.3.17.2.1.3。 Logical Operators逻辑运算符.......................................................................... 5454

17.2.2.17.2.2。 Function Calls函数调用...................................................................................... 5555

17.3.17.3。 Statements报表....................................................... 5555

17.3.1.17.3.1。 Comment Statements评论语句......................................................................... 5555

17.3.2.17.3.2。 Evaluation Statements评价报表........................................................................ 5656

17.3.3.17.3.3。 Assignment Statements赋值语句...................................................................... 5656

17.3.4.17.3.4。 Conditional条件........................................................................................... 5757

17.3.5.17.3.5。 Loop回路...................................................................................................... 5757

17.3.6.17.3.6。 Switch开关................................................................................................... 5858

17.3.6.1.17.3.6.1。 Output Switch输出开关.................................................................................... 5858

17.3.6.2.17.3.6.2。 Case Switch案例开关...................................................................................... 5858

17.3.6.3.17.3.6.3。 Numeric Switch数字开关................................................................................. 5858

17.3.6.4.17.3.6.4。 Expand Switch扩大开关.................................................................................. 5959

17.3.6.5.17.3.6.5。 ExpandExp SwitchExpandExp开关........................................................................... 5959

17.3.7.17.3.7。 Read and Write Statements读和写报告............................................................... 5959

17.3.8.17.3.8。 DOS CommandDOS命令................................................................................... 6060

17.3.9.17.3.9。 Sequence Statements序列报表........................................................................ 6060

17.4.17.4。 Libraries and Packages图书馆和包装...................................... 6060

17.4.1.17.4.1。 Initial Package init.sminit.sm初始包装......................................................................... 6262

17.4.2.17.4.2。 ExpandLn PackageExpandLn包装............................................................................. 6262

17.4.3.17.4.3。 Chemical Calculation Package化学计算软件包......................................................... 6262

17.5.17.5。 Interface with Other Software接口与其它的软件................................................................. 6363

18.18岁。 Graphics图形.................................................... 6363

18.1.18.1。 Drawing Lines and Arcs画线和弧...................................... 6464

18.2.18.2。 Plotting f(x)密谋f(x)......................................................... 6565

18.3.18.3。 Plotting Parametric Functions x(t) and y(t)绘图参数函数x(t)和y(t).......... 6666

18.4.18.4。 Plotting f(t) in Polar Coordinates密谋f(t)在两极的坐标......................... 6666

18.5.18.5。 Plotting Data阴谋数据....................................................... 6767

18.6.18.6。......................................Printing Graphics on Printer印刷机印刷图形... 6767

Part 3 Reference Guide第三部分参考指南..................................... 6868

19.19岁。 SymbMath Environment: Windows and MenusSymbMath环境:窗口、菜单 6868

19.1.19.1。 File Menu文件菜单........................................................... 6868

19.1.1.19.1.1。 Open开放..................................................................................................... 6868

19.1.2.19.1.2。 New....................................................................................................... 6969

19.1.3.19.1.3。 Save Input保存输入............................................................................................. 6969

19.1.4.19.1.4。 Save Output拯救输出.......................................................................................... 6969

19.1.5.19.1.5。 DOS ShellDOS壳............................................................................................. 6969

19.1.6.19.1.6。 Exit出口........................................................................................................ 6969

19.2.19.2。 Input Menu输入菜单.......................................................... 7070

19.3.19.3。 Run Menu运行菜单........................................................... 7070

19.4.19.4。 Output Menu输出菜单....................................................... 7070

19.5.19.5。 Color Menu颜色的菜单......................................................... 7070

19.5.1.19.5.1。 Menu Line菜单线............................................................................................. 7070

19.5.2.19.5.2。 Input Window输入窗口........................................................................................ 7070

19.5.3.19.5.3。 Input Border输入边境.......................................................................................... 7171

19.5.4.19.5.4。 Output Window输出窗口..................................................................................... 7171

19.5.5.19.5.5。 Output Border输出边境....................................................................................... 7171

19.5.6.19.5.6。 Status Line状态行........................................................................................... 7171

19.6.19.6。 Help Menu帮助菜单.......................................................... 7171

19.7.19.7。 Example Menu例如菜单.................................................... 7272

19.8.19.8。 Keyword Menu关键字菜单................................................... 7272

19.9.19.9。 Editor and Edit Help Menu编辑器和编辑帮助菜单.................................. 7272

19.9.1.19.9.1。 Edit Help Menu编辑帮助菜单.................................................................................... 7272

19.9.1.1.19.9.1.1。 Show Help File显示帮助文件................................................................................. 7373

19.9.1.2.19.9.1.2。 Cursor Movement Commands光标移动命令........................................................ 7373

19.9.1.3.19.9.1.3。 Insert and Delete Commands插入和删除命令......................................................... 7373

19.9.1.4.19.9.1.4。 Search and Replace Commands搜索和替换的命令................................................... 7474

19.9.1.5.19.9.1.5。 Block Commands块命令............................................................................. 7474

19.9.1.6.19.9.1.6。 Special Block Commands特殊区块的命令.............................................................. 7676

19.9.1.9.19.9.1.9。 Miscellaneous Commands杂命令.............................................................. 7676

19.9.1.10.19.9.1.10。 Global Commands全球命令........................................................................ 7777

19.9.2.19.9.2。 Edit Commands编辑命令................................................................................... 7777

19.9.3. 19.9.3。Copy and Paste复制并粘贴.................................................................................... 8080

20.20。 Inside SymbMathSymbMath内...................................... 8282

20.1.20.1。 Internal Structure内部结构................................................ 8282

20.2.20.2。 Internal Format内部格式................................................... 8383

21. 21。System Limits系统限制............................................. 8383

22.22。 Keywords关键词............................................... 8484

22.1.22.1。 Keywords in Topic Order关键词主题为.................................. 8484

22.2.22.2。 Keywords in Alphabetical Order关键词按字母顺序排列........................ 9191

22.3.22.3。 Library Name图书馆的名字.................................................... 9292

22.4.22.4。 Glossary词汇........................................................... 9393


PART 1第1部分 User's Guide用户手册

1.1。 Introduction介绍

1.1.1.1。What is SymbMath什么是SymbMath

SymbMath (an abbreviation for Symbolic Mathematics) is a symbolic calculator that can solve symbolic math problems.SymbMath(缩写符号数学)是一个象征符号计算器那样能解决数学问题。

SymbMath is a computer algebra system that can perform exact, numeric, symbolic and graphic computation. SymbMath计算机代数系统是一个能够进行精确、数字、符号和图形的计算。It manipulates complicated formulas and returns answers in terms of symbols, formulas, exact numbers, tables and graph.操纵复杂的公式和返回它的答案从符号、公式、数目、表格和图表。

SymbMath is an expert system that is able to learn from user's input. SymbMath是一个专家系统是能够学习,从用户的输入。If the user only input one formula without writing any code, it will automatically learn many problems related to this formula (e.g. it learns many integrals involving an unknown function f(x) from one derivative f'(x)).如果用户只输入一个不需要任何代码的公式,它会自动学习很多相关的问题,这个公式(例如它可以学习,许多积分未知函数f(x)从一个衍生f '(x))。

SymbMath is a symbolic, numeric and graphics computing environment where you can set up, run and document your calculation, draw your graph.SymbMath是一个象征,数字和图形计算的环境,你可以建立、运行和文件你的计算,拔出你的图形。

SymbMathSymbMathuses external functions as if standard functions since the external functions in library are auto-loaded.使用外部功能,如果标准自外部函数功能auto-loaded图书馆。

SymbMath is a programming language in which you can define conditional, case, piecewise, recursive, multi-value functions and procedures, derivatives, integrals and rules.SymbMath是一种编程语言,你可以定义有条件,情况下,分段,递归,多元化的价值功能和程序、衍生物、积分和规则。

SymbMath is database where you can search your data.SymbMath是资料库,在那里你可以搜索你的数据。

It runs on IBM PCs (8086) with 400 KB free memory under MS-DOS.它运行在IBM个人电脑(8086)与400 KB释放内存在ms - dos。

1.2.1.2。 Capabilities能力

It can provide analytical and numeric answers for:它可以提供分析和数字回答:

* Differentiation: regular or higher order, partial or total, mixed and implicit differentiation, one-sided derivatives.分化:经常或者高阶,全部或部分一次性、混合和含蓄的分化、片面的衍生物。

* Integration: indefinite or definite integration, multiple integration, infinity as a bound, parametric or iterated implicit integration.整合:不确定或明确的集成、多元整合、无限,当约束、参数或迭代隐含的整合。

* Solution of equations: roots of a polynomial, systems of algebraic or differential equations.解决方程:一个多项式的根、系统的代数或微分方程组。

* Manipulation of expressions: simplification, factoring or expansion, substitution, evaluation.操纵表现:简单化,保理业务或扩充、替代、评价。

* Calculation: exact and floating-point numeric computation of integer, rational, real and complex numbers in the range from minus to plus infinity, even with different units.计算:准确、浮点数值计算对整数的、理性的、真实、复杂的数字范围从减加上无穷大,即使有不同的单位。

* Limits: real, complex or one-sided limits, indeterminate forms.限制:真实、复杂或片面的范围、不确定的形式。

* Complex: calculation, functions, derivatives, integration.复杂:计算、功能、衍生物、整合。

* Sum and product: partial, finite or infinite.金额和产品:部分,有限的或无限的。

* Others: series, lists, arrays, vectors, matrices, tables, etc.其他:系列、列表、阵列、向量,矩阵、表格等。

Also included are:也包括了:

* External functions in library as if standard functions.图书馆作为外部函数如果标准功能。

* Plot: functions, polar, parametric, data, and list.情节:功能、极性、参数、数据、列表。

* Draw: lines, arcs, ellipse, circles, ovals.画画:线,弧,椭圆形、圆形、椭圆形。

*Procedural, conditional, iteration, recursive, functional, rule-based, logic, pattern-matching and graphic programming.程序、条件、迭代,递归,功能齐全,以规则为基础的、逻辑、模式匹配和图形编程。

* Searching database.检索数据库。

1.3.1.3。 Shareware and Advanced Versions共享和先进的版本

You should register with the author if you use SymbMath.你应该登记,如果你使用SymbMath作者。

Please read all *.请仔细阅读所有的*。TXT files before running SymbMath. 在运行SymbMath TXT文件。Please copy-and-past examples in the Help window to practise. 请copy-and-past例子帮助窗口来练习。The printed documents (100+ pages) is available from author.印刷文件(100 +页)可以从作者。

If you get the SymbMath on ZIP format (e.g. sm32a.zip), you should unzip it with parameter -d by如果你得到这个SymbMath在ZIP格式(例如sm32a.zip),你应该用参数d解压

pkunzip -d sm32a c:\symbmathsm32a pkunzip维c:\ symbmath

If you get the SymbMath with the install file, you should install it by如果你得到这个SymbMath与安装档案,你应该先把它安装到你 install安装

On the MS-DOS prompt to run it, type在ms - dos提示运行它,类型 SymbMathSymbMath

SymbMath has two versions: Shareware Version A, and Advanced Version C. The Shareware version lacks the solve(), trig (except sin(x) and cos(x)), and hyperbolic functions, (lack 10% keywords). SymbMath有两个版本:Shareware版本,和先进的版本c Shareware版本缺乏解决()、三角法(除罪(x),因为(x))和双曲线函数,缺乏10%关键字)。You cannot input these lack functions in Shareware version.你不能输入这些缺乏Shareware版本功能。

------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Version版本 Class Lacked functions缺乏功能

Shareware共享 A一个 solve(), hyperbolic,解决()、双曲线,

trig (except sin(x), cos(x))三角法(除罪(x),因为(x))

Advanced先进 CC

Libraries图书馆 * . *。li

Manual手册 printed印刷

...........................................................................................................................

Upgrade升级 same相同

...........................................................................................................................

Multiple多个 copies拷贝 >2> 2

...........................................................................................................................

Site licence站点许可证 >10 copies> 10本

------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

You must provide the photocopy of your license or license number for upgrades.你必须提供你的驾照的复印件或许可证号码为升级。

If you send the author your payment by cheque, money order or bank draft that must be drawn in Australia, you will get the latest version. 如果你把作者你的支票付款方式,现金订单或银行汇票必须画在澳大利亚,你会得到最新的版本。If you sign the license (see the LICENSE.如果你签了许可证(见许可证。TXT file) and send it to the author, you will be a legal user for upgrades. TXT文件)和寄给作者,你会是一个合法用户升级。If you write a paper about this software on publication, you will get a free upgrade.如果你写了一篇关于这个软件在出版时,你会得到一个免费升级。

Its two versions (Shareware and Advanced) are available from the author. 它的两个版本(共享和先进的)可于作者。The Shareware version is available from my web sites.该Shareware版本也可以从我的网站。

The Advanced version is copy-protected, so you must insert the original SymbMath disk into drive A or B before you run SymbMath. 高级的版本是copy-protected,所以你必须插入磁盘到驱动器A原SymbMath跑之前先SymbMath或B。By default, it is drive B. If you use drive A, please copy (or rename) the DRIVE.默认情况下,它是动力如果你使用开,请先将该图标拷贝(或重命名)驱动器。A file to the SYMBMATH.一个文件到SYMBMATH。DRI file, or you edit drive(2) into drive(1) in the SYMBMATH.顶吹文件,或者你编辑驱动(2)到驱动器(1)在SYMBMATH。DRI file.顶吹文件。

1.41.4 A List of Files in SymbMath在SymbMath某个目录下的文件

---------------------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

In directory SymbMath:在目录SymbMath:

SymbMath.exeSymbMath.exe executable SymbMath system.执行SymbMath系统。

SymbMath.iniSymbMath.ini initial file.最初的文件。

SymbMath.h*SymbMath.h * help files, * is numbers.帮助文件,*编号。

SymbMath.driSymbMath.dri indicate which drive the original SymbMath disk is inserted into显示磁盘驱动原SymbMath插入

init.sminit.sm initial SymbMath program file.最初的SymbMath程序文件。

*.sm* .sm packages (user SymbMath program files).软件(用户SymbMath程序文件)。

prolog.errprolog.err prolog error message file.prolog错误信息文件。

In directory SymbMath\BGI:在SymbMath \开的目录。

*.bgi* .bgi BGI graphics drives.开图形驱动器。

*.chr* .chr stroked fonts.抚摸的字体。

In directory SymbMath\library:在目录SymbMath \图书馆:

*.li*来将您引见给李先生 the auto loaded libraries (external functions).汽车装载图书馆(外部功能)。

In directory SymbMath\keyword:在目录SymbMath \关键字:

*.key* .key the keyword files.关键字的文件。

In directory SymbMath\text:在目录SymbMath \文字:

SymbMath.txtSymbMath.txt introduction of SymbMath.介绍SymbMath。

readme.txtreadme.txt the read-me file, this file should be read first.read-me的文件,该文件应该读第一。

problem.txtproblem.txt problems that other software cannot solve, but SymbMath can do.其他软件不能解决问题,但SymbMath能做的事。

comment*.txt注释* .txt comments on SymbMath.SymbMath评论。

statisti.txtstatisti.txt the download statistics at FTP site of garbo.uwasa.fi.下载统计在garbo.uwasa.fi FTP站点的。

shareware.txtshareware.txt Shareware concept.共享的概念。

software.txtsoftware.txt software available from the author.软件可以从作者。

update.txtupdate.txt the latest updates in SymbMath.在SymbMath最新公布的。

------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


2. Calculation2。计算

In the following examples, a line of "IN: " means input, which you type in the Input window, then leave the Input window by pressing <Esc>, finally run the program by the command "Run"; while a line of "OUT: " means output. 在以下的例子,一行“:”是指输入,输入窗口类型,然后让输入窗口按< Esc >,最后由命令运行该程序“跑”;而行":"是指输出。You will see both input and output are displayed on two lines with beginning of "IN: " and "OUT: " in the Output window. 你将会看到两个输入和输出显示在两线开始“:”和“道:“在输出窗口。You should not type the word "IN: ". 你不应该类型单词“:”。Some outputs may be omitted on the examples.一些输出可以省略的例子。

# is a comment statement.号是一个评论的声明。

You can split a line of command into multi-lines of command by the comma ,. 你可以将一条指令为命令multi-lines由逗号。The comma without any blank space must be the last character in the line.逗号没有任何空格必须在最后一个字就行了。

Note that you should not be suprised if some functions in the following examples are not working when their libraries are not in the default directory or missing.注意,你不应该惊讶如果一些功能在以下的例子是当他们不工作的图书馆不是默认目录或者失踪。

2.1. Exact Calculation2.1。精确计算

SymbMath gives the exact value of calculation when the switch numeric := off (default), or the approximate value of numeric calculation when the switch numeric := on or by num().SymbMath给计算的准确价格开关数字:=关(默认),或近似数值计算值开关数字:=或由胡()。

Mathematical functions are usually not evaluated until by num() or by setting numeric := on.通常不被计算数学函数由胡直到()或通过设置数字:=。

SymbMath can manipulate units as well as numbers, be used as a symbolic calculator, and do exact computation. SymbMath可以操作单位以及编号,做为一个象征性的计算器,准确计算。The range of real numbers is from -infinity to +infinity, e.g. ln(-inf), exp(inf+pi*i), etc. SymbMath contains many algorithms for performing numeric calculations. 实数的范围是从-infinity +无限,例如淋巴结(-inf),实验(无穷大+ pi *我)等。SymbMath包含许多算法数值计算执行。e.g. ln(-9), i^i, (-2.3)^(-3.2), 2^3^4^5^6^7^8^9, etc.例如;(9),我^我,(-2.3)^(-3.2),2 ^ ^ ^ ^ 3 4 ^ ^ 5 ^ 7八6 9等。

Note that SymbMath usually gives a principle value if there are multi-values, but the solve() and root() give all values.注意SymbMath通常会给一个有价值的多维价值原则,但解决()和根系()给所有的值。

Example:例如:

Exact and numeric calculations of 1/2 + 1/3.数值计算准确、1/2 +的1/3。

IN:在: 1/2+1/31/2 + 1/3 # exact calculation#精确计算

OUT: 5/6出:5/6

IN:在: num(1/2+1/3)胡(1/2 + 1/3) # numeric calculation#数值计算

OUT: 0.8333333333出:1 .

Evaluate the value of the function f(x) at x=x0 by f(x0).评估有价值的函数f(x)= x0 x由f(x0)。

Example:例如:

Evaluate sin(x) when x=pi, x=180 degree, x=i.评估罪(x)当x = pi、x = 180度,x =我。

IN:在: sin(pi), sin(180*degree)罪(pi)、罪(180 *度)

OUT: 0, 0出:0,0

IN:在: sin(i), num(sin(i))罪(我),胡(罪(我)

OUT: sin(i), 1.175201 i出:罪(我),1.175201我

Example:例如:

Set the units converter from the minute to the second, then calculate numbers with different units.设置单位转换器的第二分钟,计算不同单位数。

IN:在: minute:=60*second分钟:= 60度第二

IN:在: v:=2*meter/second老板:= 2 *米/秒

IN:在: t:=2*minute师:= 2 *分钟

IN:在: d0:=10*meterd0:= 10 *米

IN:在: v*t+d0v * t + d0

OUT: 250 meter出:250米

Evaluate the expression value by评估表达式的值

subs(y, x = x0)替补(y,x = x0)

Example:例如:

Evaluate z=x^2 when x=3 and y=4.z = x ^ 2评估当x和y = = 3 4。

IN:在: z:=x^2赵:= x ^ 2 # assign x^2 to z指定x ^ 2 #始末

IN:在: subs(z, x = 3)替补(z、x = 3) # evaluate z when x = 3当x #评估z = 3

OUT: 9出:9

IN:在: x:=4谢:= 4 # assign 4 to x4 #指定x

IN:在: zz # evaluate z#评估z

OUT: 16出:16

Note that after assignment of x by x:=4, x should be cleared from assignment by clear(x) before differentiation (or integration) of the function of x. Otherwise the x values still is 4 until new values assigned. 注意:当作业x x:= 4,x应该允许从分配(x)之前明确分化(或集成的功能。除此之外,x值x还是4直到新的赋值。If evaluating z by the subs(), the variable x is automatically cleared after evaluation, i.e. the variable x in subs() is local variable. 如果评估由潜艇z(),那么这个变量x是自动清除评估之后,即变量x的局部变量替补()。The operation by assignment is global while the operation by internal function is local, but operation by external function is global. 操作时通过转让是全球性的内部功能的操作是当地人,由外部函数可操作是全球性的问题。This rule also applies to other operations.这个规则同样适用于其它业务。

The complex numbers, complex infinity, and most math functions with the complex argument can be calculated.复杂的数字,复杂的无穷远处,而大多数数学函数复杂的参数可以计算出来。

Example .例子。

IN:在: sign(1+i), sign(-1-i), i^2签署(1 + 1)、标志(1-i),我^ 2

OUT: 1, -1, -1出:1、1,1

Example:例如:

IN:在: exp(inf+pi*i)实验(无穷大+ pi *我)

OUT: -inf出:-inf

IN:在: ln(last)淋巴结(最后)

OUT: inf + pi*i出:步+ pi *我

The built-in constants (e.g. inf, zero, discont, undefined) can be used as numbers in calculation of expressions or functions.内置的常数(例如无穷大,零,discont、不可解释的),可用于计算数字的表情或功能。

2.2.2.2。 Discontinuity and One-sided Value断续性和片面的价值

Some math functions are discontinuous at x=x0, and only have one-sided function value. 一些数学函数不连续在x = x0、只有片面函数值的大小。If the function f(x0) gives the discont as its function value, you can get its one-sided function value by f(x0-zero) or f(x0+zero).如果函数f(x0)给discont作为其功能价值,你就会得到它的片面的功能价值f(x0-zero)或f(x0 +零)。

Example:例如:

IN:在: f(x_) := exp(1/x)f(x_):=经验(1 / x) # define function f(x)#定义函数f(x)

IN:在: f(0)f(0)

OUT: discont出:discont # discontinuity at x=0在x = 0 #不连续

IN:在: f(0-zero)f(0-zero) # left-sided value at x=0-左值号x = 0 -

OUT: 0出:0

IN:在: f(0+zero)f(0 + 0) # right-sided value at x=0+右值号x = 0 +

OUT: inf出:步

2.3.2.3。 Undefined and Indeterminate Form与不确定性预定义的形式

If the function value is undefined, it may be indeterminate form (e.g. 0/0, inf/inf), you can evaluate it by lim() (see Chapter如果函数值的大小是未定义的,它可能不确定的形式(例如。0/0,步/ inf),你就可以评价由小林()(见章节 Limits).限制)。

3. Simplification3。简化

SymbMath automatically simplifies the output expression. SymbMath自动输出表达式,简化了。You can further simplify it by using the built-in variable last in a single line again and again until you are happy with the answer.你可以进一步简化它采用内置可变最后在一个单独的一行一次又一次,直到您满意的答案。

Expressions can be expanded by表达式可能会被扩展

expand(x)扩大(x)

expand := on拓展:=在

expandexp := onexpandexp:=在

Remember that the operation by assignment is global while operation by function is local. 记住,操作时通过转让是全球性的操作功能的本地产品。So expand(x) only expands the expression x, but the switch expand := on expands all expressions between the switch expand := on and the switch expand := off. Second difference betwen them is that the switch expand := on only expands a*(b+c) and (b+c)/p, but does not expands the power (a+b)^2. 扩大(x)只有扩大表达x,但是这种转变扩大:=在膨胀,所有的表情连接交换器扩大:=和开关扩大:=了。第二个变化是,前后开关扩大:=只有扩大一个*(b + c)和(b + c)/ p,但不扩大电源(+ b)^ 2。The expandexp is exp expand.expandexp是经验的扩大。

Example:例如:

IN:在: expand((a+b)^2+(b+c)*p)扩大(a + b)^ 2 +(b + c)* p)

OUT: a^2 + 2 a b + b^2 + b p + c p:一个^ 2 + 2 b + b ^ 2 + b p + c p

IN:在: expand := on拓展:=在

IN:在: (a+b)^2 + (b+c)*p(a + b)^ 2 +(b + c)* p

OUT: (a+b)^2 + b p + c p出:a + b)^ 2 + b p + c p

----------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

............... expand(x) ....................................................................................扩大(x)

(a+b)^2(a + b)^ 2 to a^2+2*a*b+b^2一个^ 2 + 2 * * ^ 2 b + b

(a+b)^n(a + b)^ n to a^n+ ...... 一个^ n +……+b^n^ n + b n is positive integer正整数n是

............... ...............expand(x) and expand := on ..........................扩大(x)和扩展:=在..........................

a*(b+c)一个*(b + c) to a*b + a*c* * * * * * b + c

(b+c)/p(b + c)/ p to b/p + c/pb / p + c/p

............... ...............expandexp := on .....................................expandexp:=在.....................................

e^(a+b)e ^(a + b) to e^a *e ^ * * * e^be ^ b

------------------------------------------------------------------------------------------------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

where a+b can be many terms or a-b.在+ b能有许多条款或故。

Expressions can be factorised by表达式是可以factorised

factor(x)因子(x)

e.g.例句。

IN:在: factor(a^2 + 2*a*b + b^2)因子(一个^ 2 + 2 b + b * * ^ 2)

OUT: (a + b)^2出:a + b)^ 2

Polynomials of order less than 5 can be factorised by多项式的秩序不少于5个可以factorised

factor(y, x)因子(y,x)

Example:例如:

IN:在: factor(x^2+5*x+6, x)因子(x ^ 2 + 5 * x + 6,x)

OUT: (2 + x) (3 + x)出:(2 + x)(3 + x)

Example:例如:

Reduce sqrt(x^2).减少sqrt(x ^ 2)。

IN:在: sqrt(x^2)sqrt(x ^ 2)

OUT: x*sign(x)出:* *签署(x)

This output can be further simplified if you know properties of x.这种输出可以进一步简化如果你知道属性x。

A first way is to evaluate x*sign(x) by substituting sign(x) with 1 if x is positive.一分之一的方法是评价x(x)*标志取代签署(x),如果x是积极的。

IN:在: sqrt(x^2)sqrt(x ^ 2)

OUT: x*sign(x)出:* *签署(x)

IN:在: subs(last, sign(x) = 1)替补(最后签署(x)= 1)

OUT: x出:x

where a special keyword last stands for the last output, e.g. here last is x*sign(x).在一个特殊的关键字的最后一站在过去的输出,例如在这里签个是x(x)*。

3.1. Assuming Domain3.1。假设领域

A second way is to assume x>0 before evaluation. 另一种是x > 0之前认为的评价。If you assume the variable x is positive or negative, the output expression is simpler than that if you do not declare it.如果你承担变量x是积极的还是消极的,输出表达简单的比,如果你不申报。

IN:在: assume(x > 0, y <0)假设(x > 0,y < 0) # assume x > 0, y < 0> 0 #假设x,y < 0

OUT: assumed出:假设

IN:在: sqrt(x^2), sqrt(y^2), sqrt(z^2)sqrt(x ^ 2),sqrt(y ^ 2),sqrt(z ^ 2)

OUT: x*sign(x), y*sign(y), z*sign(z)出:* *签署(x),y *签署(y)、z *签署(z)

IN:在: last最后 # simplify last output#简化最后输出

OUT: x, -y, z*sign(z)出:x,消息、z *签署(z)

In this way, all of x is affected until the assume() is cleared by clear(). 这样,所有的x是影响承担(),直到被清楚()。The first method is local simplification, but the second method is global simplification.第一种方法是当地的简单化,但第二种方法是全球性的简单化。

By default, |x| < inf and all variables are complex, except that variables in inequalities are real, as usual only real numbers can be compared. 默认情况下,| | < inf和x��量是复杂的,除了变量不等式是很实际的,像往常一样唯一真正的编号可比的。e.g. x is complex in sin(x), but y is real in y > 1.如x是复杂的罪(x),但y是真实的y > 1。

Table 3.1表3.1 Assuming假设

--------------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Assume承担 Assignment作业 Meaning意义

assume(x>y)假设(x > y) x>y := 1x >杨:= 1 # assume x > y假设x >号y

assume(x>=y)假设(x > = y) x>=y := 1x > =杨:= 1 # assume x >= y假设x > =号y

assume(x<y)假设(x < y) x<y := 1杨:x < = 1 # assume x < y假设x号< y

assume(x<=y)假设(x < = y) x<=y := 1杨:x < = = 1 # assume x <= y假设x < =号y

assume(x==y)假设(x = = y) x==y := 1x = =杨:= 1 # assume x == y#假设x = = y

assume(x<>y)假设(x < > y) x<>y := 1x < >杨:= 1 # assume x <> y假设x < >号y

iseven(b) := 1iseven(b):= 1 # assume b is even假设b是平坦的。#

isodd(b) := 1isodd(b):= 1 # assume b is odd#假设b很奇怪

isinteger(b) := 1isinteger(b):= 1 # assume b is integer假设b号整数

isratio(b) := 1isratio(b):= 1 # assume b is ratio假设b是#比例

isreal(b) := 1来(b):= 1 # assume b is real#假设b是真实的

iscomplex(b) := 1iscomplex(b):= 1 # assume b is complex假设b相当复杂。#

isnumber(b) := 1isnumber(b):= 1 # assume b is number假设b号码是#

islist(b) := 1islist(b):= 1 # assume b is a list假设b是一号名单

isfree(y,x) := 1isfree(y,x):= 1 # assume y is free of x#假设y是免费的x

issame(a,b) := 1issame(a,b):= 1 # assume a is same as b假设一个号一样b

sign(b) := 1签署(b):= 1 # assume b is positive complex假设b是积极#复杂

sign(b) := -1签署(b):= 1 # assume b is negative complex假设b是消极#复杂

------------------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The assume() can be cleared by clear(). 这个假设()能被清理清晰()。e.g. clear(x>y).例如清楚(x > y)。

You can restrict the domain of a variable by assuming the variable is even, odd, integer, real number, positive or negative.你可以限制一个变量的领域通过假设变量为均匀,奇怪,整数,实数、积极还是消极的。

Example:例如:

IN:在: isreal(b) := 1来(b):= 1 # assume b is real#假设b是真实的

IN:在: sqrt(b^2)sqrt(b ^ 2)

OUT: abs(b)出:abs(b)

Table 3.3表3.3 Simplification in different domains简化在不同领域

----------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

expression表达 complex复杂 real真正 x > 0x > 0

sqrt(x^2)sqrt(x ^ 2) x sign(x)x签署(x) |x|| | x xx

x*sign(x)x *签署(x) x sign(x)x签署(x) |x|| | x xx

|x|*sign(x)| | *标志x(x) |x| sign(x)| |标志x(x) xx xx

|x|/x| | x / x |x|/x| | x / x 1/sign(x)1 /签署(x) 11

x+infx + inf x+infx + inf infinf

x-infx-inf x-infx-inf -inf-inf

abs'(x)abs的(x) |x|/x| | x / x 1/sign(x)1 /签署(x) 11

-------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

3.2. Comparing and Testing Numbers3.2。比较和测试编号

You can compare two numbers by relational operators:你可以比较两个编号的关系运算符。

a > b一个> b

a < b一个< b

a <= b一个< = b

a >= b一个> = b

a <> b一个< > b

a == b一个= = b

Example:例如:

IN:在: 2 > 1, 2 < 12 > 1、2 < 1

OUT: 1, 0出:1、0

You also can compare two numbers, even complex numbers z1 and z2 by你也可以比较两个编号,甚至人z1与z2复数

islarger(z1, z2)islarger(z1,本体)

isless(z1, z2)isless(z1,本体)

issame(z1, z2)issame(z1,本体)

Example:例如:

compare 1+i and 1-i.1 +我和1-i比较。

IN:在: islarger(1+i, 1-i)islarger(1 +我,1-i) # is 1+i larger than 1-i ?号是1 +我比1-i吗?

OUT: 1出:1 . # yes, 1+i > 1-i#是的,1 +我> 1-i

You can compare square of a variable a^2 > 0 if you know the property of the variable.你可以比较一下一个变量一个广场^ 2 > 0如果知道你的财产的变量。

Example:例如:

IN:在: assume(a > 0)假设(> 0)

IN:在: a^2 > 0, 1/a > 0一个^ 2 > 0,1 / > 0

OUT: 1, 1出:1、1

You can test if x is even, odd, integer, real, number or list by the functions:你可以测试甚至x,单,整数,真正的、数量或列表的功能:

iseven(x)iseven(x)

isodd(x)isodd(x)

isinteger(x)isinteger(x)

isreal(x)(x)来

isnumber(x)isnumber(x)

islist(x)islist(x)

isfree(y,x)isfree(y,x)

islarger(a,b)islarger(a,b)

isless(a,b)isless(a,b)

issame(a,b)issame(a,b)

Example:例如:

IN:在: iseven(2)iseven(2) # is 2 even ?# 2甚至吗?

OUT: 1出:1 . # yes#是的

Note that comparison by the is* functions return either 1 if it is true or 0 otherwise, but comparison by relational operators gives 1 if it is true, 0 if it is fault, or left unevaluated otherwise.注意的是*功能比较回报或如果它是真实的或0不同的看法,但比较关系运算符给1如果这是真的,如果它是0错误,或离开unevaluated不然。

4.4。 Defining Functions, Procedures and Rules定义功能、程序和规则

Anytime when you find yourself using the same expression over and over, you should turn it into a function.当你发现你自己随时都使用同样的表情,你应该把它变成一个功能。

Anytime when you find yourself using the same definition over and over, you should turn it into a library.当你发现你自己随时都使用相同的定义,你应该把它变成一个图书馆。

You can make your defined function as if the built-in function, by saving your definition into disk file as a library with the function name plus extension .你可以让你的定义如果内置功能作用,以节省您的定义到磁盘文件作为一个库函数的名字加上延伸。li as the filename. 李的文件名。e.g. saving the factoria function as the factoria.例如节约factoria factoria的功能。li file (see Section Libraries and Packages).李文件(请看段图书馆和包装)。

4.1.4.1。 Defining Functions定义功能

You can define your own functions by你可以定义你自己的函数

f(x_) := x^2f(x_):= x ^ 2

Here are some sample function definitions:这里有一些样本函数定义:

f(x_) := cos(x + pi/3)f(x_):=因为(x + pi / 3)

g(x_, y_) := x^2 - y^2g(x_,y_):y = x ^ ^ 2 - 2

The argument in the definition should be the pattern x_. 辩论的定义应该x_模式。Otherwise f() works only for a specific symbolic value, e.g. x when defining f(x):=x^2. 否则f()只能为一个特定的符号价值,例如x当定义f(x)= x ^ 2。The pattern x_ should be only on the left side of the assignment.模式x_只能在左边的这个任务。

Once defined, functions can be used in expressions or in other function definitions:一旦界定、功能可用于表达方式或在其他函数定义:

y := f(3.2)杨:= f(3.2)

z := g(4.1, -5.3)赵:=克(4.1,-5.3)

Example:例如:

Define a new function for x^2, then evaluate it.定义一个新的函数x ^ 2,然后评价它。

IN:在: g(x) := x^2g(x):= x ^ 2

IN:在: g(2), g(a),g(2),g(a), g(x)g(x)

OUT: g(2), g(a),出:g(2),g(a), x^2x ^ 2 # work only for a symbolic value x#工作只有一个象征价值x

IN:在: f(x_) := x^2f(x_):= x ^ 2

IN:在: f(2), f(a)外(2),f(一)

OUT: 4, a^2出:4、一个^ 2 # work for any value#为其工作的价值

4.1.1.4.1.1。 Defining Conditional Functions条件函数定义

You can define a conditional function by the if() function:你可以定义一个条件作用的()如果功能:

f1(x_) := if(x>0 thenf1(x_):要是(x > 0然后 1)1)

f2(x_) := if(x>0 then x^2 else x)f2(x_):要是(x > 0 x ^ 2然后其他x)

or by inequalities:或不平等:

f3(x_) := x>0f3(x_):= x > 0

f4(x_) := (x>0) * x^2 + (x<=0) * xf4(x_):=(x > 0)* x ^ 2 +(x < = 0)* x

On the first definition by if(), when f1() is called it gives 1 if x>0, or left unevaluated otherwise. 在第一个定义,如果(),当f1()把它称为给1 x > 0或者离开unevaluated不然。On the second definition by the if(), when f2() is called it gives x^2 if x>0, x if x<=0, or left unevaluated otherwise. 第二个定义,如(),当f2()把它称为给x ^ 2 x > 0,x x < = 0或者离开unevaluated不然。On the third definition by the inequality, when f3() is called, it gives 1 for x>0, 0 for x<=0, or x>0 for symbolic value of x. On the last definition, when f4() is called, it is evaluated for any numeric or symbolic value of x.在第三的定义的不平等,当f3()被称为,它给1 x > 0,0 x < = 0,或者x > 0 x符号价值。最后定义,当f4()被称为,它对任何数字或符号的价值的x。

Remember that the words "then" and "else" can be replaced by comma ,.记得说“然后”和“其他”可以被逗号。

You cannot differentiate nor integrate the conditional function defined by if(), but you can do the conditional functions defined by inequalities.你不能分辨条件的作用也将规定如果(),但你还可以做条件函数定义为不平等。

You can define a function evaluated only for numbers by你可以定义一个函数只有总数的评价

f(x_) := if(isnumber(x) then x^2)f(x_):要是(isnumber(x)然后x ^ 2)

This definition is different from the definition by f(x_) := x^2. 这个定义不同于定义f(x_):= x ^ 2。On the latter, when f() is called, it gives x^2, regardless whatever x is. 在后者,当f()被称为,它给x ^ 2,不论x。On the former, when f() is called, it gives x^2 if x is a number, or left unevaluated otherwise.对于前者,当f()被称为,它给x ^ 2如果x是一个数字,或左unevaluated不然。

Example:例如:

evaluate to x^2 only if x is number, by defining a conditional function.评估x ^ 2如果x是号码,通过定义一个有条件的功能。

IN:在: f(x_) := if(isnumber(x) then x^2)f(x_):要是(isnumber(x)然后x ^ 2)

IN:在: f(2), f(a)外(2),f(一)

OUT: 4, f(a)出:4 f(a)

IN:在: f(x_) := if(x>0 then x^2)f(x_):要是(x > 0然后x ^ 2)

IN:在: f(2), f(-2), f(a)外(2),外(2),f(一)

OUT: 4, f(-2), f(a)出:4 f(2),f(一)

IN:在: f(x_) := if(x>0 then x^2 else x)f(x_):要是(x > 0 x ^ 2然后其他x)

IN:在: f(2), f(-2), f(a)外(2),外(2),f(一)

OUT: 4, 2, f(a)出:4,2 f(a)

4.1.2.4.1.2。 Defining Case Functions功能定义案件

You can define the case function by different pattern name. 你可以定义案件功能不同的模式的名字。The case function is similar to the case statement in BASIC language.情况类似的案件函数声明在基本的语言。

Example:例如:

IN:在: f(x_) := if( x > 0 and x < 1 then 1)f(x_):要是(x > 0和x < 1,那么一)

IN:在: f(u_) := if( u > 1 and u < 2 then 2)f(u_):要是(u > 1和u < 2然后2)

IN:在: f(v_) := if( v > 2 and v < 3 then 3)f(v_):要是(v > 2和v < 3然后,3)

IN:在: f(0.2), f(1.2), f(2.2)f(0.2)、f(1.2),f(2.2)

OUT: 1, 2, 3出:1、2、3

4.1.3.4.1.3。 Defining Piece-wise Functions功能定义分片

You can define a piece-wise function.你可��定义一个分片功能。

Example:例如:

define定义

/ x/ x if x < 0如果x < 0

f(x) =f(x)= 00 if x = 0如果x = 0

\ x^2\ x ^ 2 if x > 0如果x > 0

then evaluate f(-2), f(0), f(3), f(a), f'(x), diff(f(x), x=3).然后评估外(2)、f(0),f(3)、f(a)、f '(x),差异(f(x)、x = 3)。

IN:在: f(x_) := x*(x<0)+x^2*(x>0)f(x_):* = x(x < 0)+ x ^ 2 *(x > 0)

IN:在: f(-2), f(0), f(3), f(a)外(2)、f(0),f(3)、f(a)

OUT: -2, 0, 9, (a < 0) a + (a > 0) a^2出:2,0,- 9(< 0)+(> 0)一个^ 2

IN:在: f'(x)f '(x)

OUT: (x < 0) + 2 x (x > 0)出:(x < 0 + 2 x(x > 0)

IN:在: diff(f(x), x=3)差异(f(x)、x = 3)

OUT: 6出:6

4.1.4.4.1.4。 Defining Recursion Functions递归函数定义

You can define a recursion function.你可以定义一个递归函数。

Example:例如:

IN:在: factoria(1) := 1factoria(1):= 1

IN:在: factoria(n_) := if(n > 1, (n-1)*factoria(n-1))factoria(n_):要是(n > 1,(n-1)* factoria(n-1)

4.1.5.4.4.5款所述。 Defining Multi-Value Functions价值函数定义

You can define a function with the multi function values.你可以定义一个函数和多功能的价值观。

Example:例如:

IN:在: squreroot(x_) := [sqrt(x), -sqrt(x)]squreroot(x_):=[sqrt(x),-sqrt(x))

IN:在: squreroot(4)squreroot(4)

OUT: [2, -2]出:[1,2]

4.2.4.2。 Defining Procedures定义程序

You can define a function as a procedure by你可以定义一个函数程序

f(x_) := block(command1, command2, ...f(x_):=区块(command1,command2,……, commandN),commandN)

f(x_) := block(command1, command2, ...f(x_):=区块(command1,command2,……, commandN, local(a)),commandN,当地(a))

By default, all variables within procedure are global, except for variables declared by local(). 默认情况下,所有的变量在程序都是全球性的,除了变量声明当地()。The multi-statement should be grouped by block(). 错误的应按区块()。The block() only outputs the result of the last statement or the second last one as its value. 块()的结果只有输出最后的陈述或第二最后一个为其价值。The multi-line must be terminated by a comma, (not by a comma and a blank space). 线必须终止用逗号,而不是由一个逗号和一个空白的空间)。Local() must be the last one in block().本地()必须在最后一个块()。

Example:例如:

define a numeric integration procedure ninte() and calculate integral of x^2 from x=1 to x=2 by call ninte().定义一个数字集成程序和计算ninte x ^ 2积分x = 1到2 x =叫ninte()。

IN:在: ninte(y_,x_,a_,b_) := block( numeric:=on,ninte(y_ x_ b_已,,,):=区块(数字:=,

dd:=(b-a)/50,戴夫:=(b-a)/ 50人,

aa:=a+dd,aa:= +茶桶空行,

bb:=b-dd,bb:= b-dd,

y0:=subs(y, x = a),y0:=替补(y,x =),

yn:=subs(y, x = b),yn:=替补(y,x = b),

(sum(y,x,aa,bb,dd)+(y0+yn)/2)*dd,(全额(x,y,aa,bb,dd)+(y0 + yn / 2)*茶桶空行,

local(dd,aa,bb,y0,yn) )本地(dd,aa,bb,y0、yn)

IN:在: ninte(x^2, x, 1, 2)ninte(x ^ 2、x、1,2)

4.3.4.3。 Defining Rules定义规则

You can define transform rules. 你可以定义转换规则。Defining rules is similar to defining functions. 定义定义规则类似的功能。In defining functions, all arguments must be simple variables, but in defining rules, the first argument can be a complicated expression.在定义功能,所有变量参数必须简单,但在确定规则,第一个参数可以是一个复杂的表达式。

Example:例如:

Define log rules.定义日志的规则。

IN:在: log(x_ * y_) := log(x) + log(y)日志(x_ * y_):=日志(x)+日志(y)

IN:在: log(x_ ^ n_) := n*log(x)日志(x_ n_ ^):= n *日志(x)

IN:在: log(a*b)日志(* b)

OUT: log(a) + log(b)出:日志(a)+日志(b)

Example:例如:

IN:在: sin(-x_) := -sin(x)罪(-x_):= -sin(x)

IN:在: sin(-a)罪(-)

OUT: -sin(a)出:-sin(a)

Example:例如:

Define derivatives (see Chapter 4.5.2 Defining f'(x)).定义衍生物(见章定义的4.5.2 f(x))。

IN:在: f'(x_) := sin(x)f '(x_):=罪(x)

IN:在: f'(t)福”(t)

OUT: sin(t)出:罪(t)

Example:例如:

Define integrals (see Chapter 4.6.1 Indefinite Integration).定义积分(见章节不确定性整合4.6.1)。

IN:在: inte(f(x_),x_) := sin(x)希尔(f(x_),x_):=罪(x)

IN:在: inte(f(t),t)希尔(f(t),t)

OUT: sin(t)出:罪(t)

Example:例如:

Define the trig simplification rules.定义三角法简化规则。

IN:在: simplify(sin(x_)^2, x_) := 1/2*(1-cos(x))简化(罪(x_)^ 2、x_):= 1/2 *(1-cos(x))

IN:在: simplify(sin(x)^2,x)简化(罪(x)^ 2、x)

OUT: 1/2 (1 - cos(x))出:1/2(1 - cos(x))

Example:例如:

Define Laplace transform rules.定义拉普拉斯变换规则。

IN:在: laplace(sin(t_), t_) := 1/(t^2+1)拉普拉斯(罪(t_),t_):= 1 /(t ^ 2 + 1)

IN:在: laplace(sin(s), s)拉普拉斯(罪(s),s)

OUT: 1/(s^2 + 1)出:1 /(s ^ 2 + 1)

5.5。 Limits限制

5.1.5.1。 One-sided Limits片面限制

You can finds real or complex limits, and discontinuity or one-sided value.你可以找到真正的或复杂的限制,以及不连续或片面的价值。

First find the expression value by subs(y, x = x0) or the function value by f(x0) when x = x0.首先找到表达式的值由替补(y,x = x0)或功能价值由f(x0)当x = x0。

If the result is the discont (i.e. discontinuity), then use the one-sided value x0+zero or x0-zero to try to find the one-sided function or expression value.如果结果是discont(即中断),然后用片面x0 +零或x0-zero价值,试图寻找片面函数或表达式的值。

For a function f(x), you can evaluate the left- or right-sided function value, similar to evaluate the normal function value:为一个函数f(x),你就可以评价左-右函数值或类似于正常功能的评估价值。

f(x0-zero)f(x0-zero)

f(x0+zero)f(x0 + 0)

For an expression y, you can evaluate its one-sided expression value by为一个表达式y,你就可以评价其片面表达式的值

subs(y, x = x0-zero)替补(y,x = x0-zero)

subs(y, x = x0+zero)替补(y,x = x0 + 0)

The discont (discontinuity) means that the expression has a discontinuity and only has the one-sided value at x=x0. 这discont(中断)意味着有一个传统的表情,只有在x = x0片面的价值。You should use x0+zero or x0-zero to find the one-sided value. 你应该用x0 +零或x0-zero找到片面的价值。The value of f(x0+zero) or f(x0-zero) is the right-sided or left-sided function value as approaching x0 from positive (+inf) or negative (-inf) direction, respectively, i.e. as x = x0+ or x = x0-.f的价值(x0 + 0)或f(x0-zero)是右侧或左侧函数值从接近x0正(+ inf)或负(-inf)的方向,分,即x = = x0 x0 +或x -。

If the result is undefined (indeterminate forms, e.g. 0/0, inf/inf, 0*inf, and 0^0), then find its limit by如果结果是未定义的(不确定的形式、例句。0/0,步/无穷大,0 * ^ 0 inf,0),然后找到它的限制

lim(y, x = x0)小林(y,x = x0)

If the limit is discont, then you can find a left- or right-sided limit when x approaches to x0 from positive (+inf) or negative (-inf) direction at discontinuity by如果这个限制是discont,然后你可以找到一个左-右限制或当x方法从x0正(+ inf)或负(-inf)方向不连续

lim(y, x = x0+zero)小林(y,x = x0 + 0)

lim(y, x = x0-zero)小林(y,x = x0-zero)

Example:例如:

Evaluate y=exp(1/x) at x=0, if the result is discontinuity, find its left-sided and right-sided values (i.e. when x approaches 0 from positive and negative directions).y =实验评估(1 / x)在x = 0,如果结果不连续性、找到它的左和右值(例如当x方法0从积极和消极的方向。

IN:在: y:=exp(1/x)杨:=经验(1 / x)

IN:在: subs(y, x = 0)替补(y,x = 0)

OUT: discont出:discont # discontinuity at x=0在x = 0 #不连续

IN:在: subs(y, x = 0+zero), subs(y, x = 0-zero)替补(y,x = 0 + 0),替补(y,x = 0-zero)

OUT: inf, 0出:无穷大,0

Example:例如:

How to handle the following one-sided values ?如何处理好以下片面的价值观吗?

Let f(x) = 1 when x < 1, f(x) = 1 when x > 1 (and not defined at x = 1).让f(x)= 1当x < 1,f(x)= 1当x > 1(而不是定义于x = 1)。

Let g(x) = 1 when x < 1, g(x) = 1 when x > 1, and g(1) = 2.让克(x)= 1当x < 1,g(x)= 1当x > 1、g(1)= 2。

Let h(x) = 1 when x < 1, h(x) = 2 when x >= 1.让h(x)= 1当x < 1、h(x)= 2当x > = 1。

Let k(x) = 1 when x < 1, k(x) = 2 when x > 1, and k(1) = 3.让k(x)= 1当x < 1、钾(x)= 2当x > 1,k(1)= 3。

Now ask SymbMath to compute现在问SymbMath计算

(1) the limit as x approaches 1,(1)限制1 x的方法,

(2) the limit as x approaches 1 from the left, and(2)限制一号从x方法(左)和

(3) the limit as x approaches 1 from the right(3)限制一号从x方法正确

for each of the above piecewise defined functions.对于每一种分段函数上面。

# define functions#定义功能

f(x_) :=f(x_):= if(x<1 or x>1, 1)如果(x < 1或x > 1,1)

f(1+zero):=1外(1 + 0):= 1

f(1-zero):=1f(1-zero):= 1

g(x_) := if( x<1 or x>1, 1)g(x_):要是(x < 1或x > 1,1)

g(1):=2g(1):= 2

g(1+zero):=1g(1 + 0):= 1

g(1-zero):=1g(1-zero):= 1

h(x_) := if( x<1, 1, 2)h(x_):要是(x < 1、1、2)

h(1+zero):=2h(1 + 0):= 2

h(1-zero):=1h(1-zero):= 1

k(x_) := if( x<1, 1, if( x>1, 2))k(x_):要是(x < 1,1,如果(x > 1、2))

k(1):=3凯西(1):= 3

k(1+zero):=2凯西(1 + 0):= 2

k(1-zero):=1k(1-zero):= 1

# evaluate functions#评估功能

IN:在: f(1), g(1), h(1), k(1)外(1),g(1),h(1)、钾(1)

OUT: f(1), 2, 2, 3出:f(1)、2、2、3位

IN:在: f(1+zero), g(1+zero), h(1+zero), k(1+zero)外(1 + 0),g(1 + 0),h(1 + 0)、钾(1 + 0)

# right-hand side value at x=1+右手边值# x = 1 +

OUT: 1, 1, 1, 1出:1,1,1,1

IN:在: f(1-zero), g(1-zero), h(1-zero), k(1-zero)f(1-zero),g(1-zero),h(1-zero)、钾(1-zero)

# left-hand side value at x=1-左手边值号x = 1 -

OUT: 1, 1, 2, 2出:1、1、2、2

Example:例如:

Find limits of types 0/0 and inf/inf.找到0/0和限制类型步/无穷大。

IN:在: p:=(x^2-4)/(2*x-4)警:=(x ^ 2 - 4)/(2 * x-4)

IN:在: subs(p, x = 2)替补(p、x = 2)

OUT: undefined出:未定义

IN:在: lim(p, x = 2)小林(p、x = 2)

OUT: 2出:2

IN:在: subs(p, x = inf)替补(p、x = inf)

OUT: undefined出:未定义

IN:在: lim(p, x = inf)小林(p、x = inf)

OUT: inf出:步

5.2.5.2。 Numeric Limits: nlim()数字限制:nlim()

If symbolic limit falls, you should try numeric limit by如果象征性的限制下,你应该试试数字限制

nlim(y, x=x0)nlim(y,x = x0)

e.g. nlim(sin(x)/x, x=0)例如nlim(罪(x)、x / x = 0)

6. Differentiation6。分化

Differentiate an expression y with respect to x by区分一个表达式y就x

d(y, x)d(y,x)

Differentiate a simple function f(x) with respect to x by划分出一个简单的函数f(x)关于x

f'(x)f '(x)

Differentiate y in the n order ( n > 0 ) by在划分为y氮(n > 0)

d(y, x, n)d(x,y,n)

Differentiate y at x = x0 by在x = x0划分y

diff(y, x = x0)比较(y,x = x0)

Differentiate y at x = x0 in the n order (n > 0) by在x = x0划分y在n秩序(n > 0)

diff(y, x = x0, n)比较(y,x = x0、n)

Example:例如:

Differentiate sin(x) and x^(x^x).区分罪(x)和x ^(x ^ x)。

IN:在: sin'(x)罪”(x) # sin'(x) is the same as d(sin(x), x).#罪”(x)是一样的d(罪(x)、x)。

OUT: cos(x)出:因为(x)

IN:在: d(x^(x^x), x)d(x ^(x ^ x)、x)

OUT: x^(x^x) (x^(-1 + x) + x^x ln(x) (1 + ln(x)))出:x ^(x ^ x)(x ^(1 + x)+ x ^;x(x)(1 +淋巴结(x))

If you differentiate f(x) by f'(x), x must be a simple variable and f(x) must be unevaluated.如果你区分f(x)f”(x)、x必须是一个简单的变量和f(x)必须unevaluated。

f'(x0) is the same as d(f(x0),x0), but different from diff(f(x), x=x0). f '(x0)是一样的d(f(x0),x0),但不同于差异(f(x)、x = x0)。f'(x0) first evaluates f(x0), then differentiates the result of f(x0). f '(x0)首先评估f(x0),然后划分结果f(x0)。But diff(f(x), x=x0) first differentiates f(x), then replace x with x0. 但是差异(f(x)、x = x0)首先划分f(x),然后替换与x0 x。Note that sin'(x^6) gives cos(x^6) as sin'(x^6) is the same as d(sin(x^6), x^6). 注意罪”(x ^ 6)给因为(x ^ 6)如罪”(x ^ 6)是一样的d(罪(x ^ 6)、x ^ 6)。sin'(0) gives d(0,0) as sin(0) is evaluated to 0 before differentiation, you should use diff(sin(x),x=0) which gives 1.罪”(0)给d(0,0)如罪(0)评估为0,你应该用在分化差异(罪(x)、x = 0)为1。

Example:例如:

Differentiate the expression f=sin(x^2+y^3)+cos(2*(x^2+y^3)) with respect to x, and with respect to both x and y.区分表达式女=罪(x ^ 2 + y ^ 3)+因为(2 *(x ^ 2 + y ^ 3)关于x,并就两个x和y。

IN:在: f := sin(x^2+y^3)+cos(2*(x^2+y^3))女:=罪(x ^ 2 + y ^ 3)+因为(2 *(x ^ 2 + y ^ 3))

IN:在: d(f, x)d(f,x)

OUT: 2 x cos(x^2 + y^3) - 4 x sin(2 (x^2 + y^3))出:2 *因为(x ^ 2 + y ^ 3),4×罪(2(x ^ 2 + y ^ 3))

IN:在: d(d(f, x), y)d(d(f,x,y) # mixed derivative with x and y.与#混合衍生物x和y。

OUT: -6 x y^2 sin(x^2 + y^3) - 12 x y^2 cos(2 (x^2 + y^3))出:6倍^ 2 y罪(x ^ 2 + y ^ 3)- y ^ 2的12倍,因为(2(x ^ 2 + y ^ 3))

6.1.6.1。 One-sided Derivatives片面的衍生品

Differentiate y at x = x0-zero or 0+zero (the left- or right- sided derivative) by在x = x0-zero划分y或0 + 0(左边或右边- - - - - - - - - - - -站导数)

diff(y, x = x0-zero)比较(y,x = x0-zero)

diff(y, x = x0+zero)比较(y,x = x0 + 0)

Example:例如:

IN:在: diff(ln(x), x=0)齿轮淋巴结(x)、x = 0)

OUT: discont出:discont # discontinuity at x=0在x = 0 #不连续

IN:在: diff(ln(x), x=0-zero)齿轮淋巴结(x)、x = 0-zero) # left-sided derivative at x=0-#左导数时,x = 0 -

OUT: -inf出:-inf

IN:在: diff(ln(x), x=0+zero)齿轮淋巴结(x)、x = 0 + 0) # right-sided derivative at x=0+右导数时,# x = 0 +

OUT: inf出:步

6.2.6.2。 Defining f '(x)定义f '(x)

Defining derivatives is similar to defining rules. 类似的定义界定衍生物的规则。You only need to define derivatives of a simple function, as SymbMath automatically apply the chain rule to its complicated function.你只需要定义衍生物的简单的函数,运用SymbMath自动链法则,其复杂的功能。

Example:例如:

IN:在: f'(x_) := sin(x)f '(x_):=罪(x)

IN:在: f'(x)f '(x)

OUT: sin(x)出:罪(x)

IN:在: f'(x^6)f '(x ^ 6) # the same as d(f(x^6), x^6)#一样的d(f(x ^ 6)、x ^ 6)

OUT: sin(x^6)出:罪(x ^ 6)

IN:在: d(f(x^6), x)d(f(x ^ 6)、x)

OUT: 6 x^5 sin(x^6)出:6 ^ 5罪x(x ^ 6)

7.7。 Integration整合

You can find integrals of x^m*e^(x^n), x^m*e^(-x^n), e^((a*x+b)^n), e^(-(a*x+b)^n), x^m*ln(x)^n, ln(a*x+b)^n, etc., (where m and n are any real number).你能找到x ^ m *积分的e ^(x ^ n)、x ^ ^ m * e(-x ^ n)、e ^((* x + b)^ n)、e ^(-(* x + b)^ n)、x ^ m *淋巴结(x)^ n、淋巴结(* x + b)^ n等,(在m和n是任何真正的数字)。

It is recommended that before you do symbolic integration, you should simplify integrand, e.g. expand the integrand by expand() and/or by setting the switch expand:=on and/or expandexp:=on.建议你象征整合前,你应该被积函数进行简化,例如扩大被积函数的扩展()和/或设定的开关扩大:=在和/或expandexp:=。

If symbolic integration fails, you can define a simple integral and/or derivative, (or adding integral into the inte.如果符号整合失败,你可以定义一个简单的积分和/或衍生品(或添加到强烈的积分。li library), then do integration again (see Chapter Learning From User).李图书馆),然后再做整合(见一章的学习,从用户)。

7.1. Indefinite Integration7.1。不确定性整合

Find the indefinite integrals of expr by发现不定积分的expr

inte(expr, x)希尔(expr、x)

Find the double indefinite integrals by发现双不定积分

inte(inte(expr, x), y)希尔(交互(expr、x、y)

Note that the arbitrary constant is not represented.注意,任意常数并不代表。

Example:例如:

Find integrals of 1/a, 1/b and 1/x, knowing a >0, b is real.发现积分的1、1 / b和1 / x,知道> 0,b是真实的。

IN:在: assume(a>0), isreal(b):=1假设(>),来(b):= 1

IN:在: inte(1/a, a), inte(1/b, b), inte(1/x, x)希尔(1 / a,一个),交互(1 / b、b),交互(1 / x,x)

OUT: ln(a), ln(|b|), ln(x*sign(x))出:淋巴结(a)、淋巴结(b | |),淋巴结(x *签署(x))

Example:例如:

Find indefinite integrals.发现不定积分。

IN:在: inte(sin(a*x+b), x)强烈的(罪(一个* x + b),x) # integrands involving sin(x)# integrands涉及罪(x)

OUT: -cos(b + a x)/a出:-cos(b +一个x)

IN:在: inte( sin(x)/x^2, x)强烈的(罪(x)/ x ^ 2、x)

OUT: ci(x) - sin(x)/x出:ci(x)-罪/ x(x)

IN:在: inte( x*sin(x), x)强烈的(x *罪(x)、x)

OUT: -x cos(x) + sin(x)出:-x因为(x)+罪(x)

IN:在: inte(sin(x)*cos(x), x)强烈的(罪(x)*因为(x)、x)

OUT: (1/2)*sin(x)^2出:(1/2)* ^ 2罪(x)

IN:在: inte( e^(x^6), x)希尔(e ^(x ^ 6)、x) # integrands involving e^xintegrands涉及e ^ x号

OUT: 1/6 ei(-5/6, x^6)出:1/6 ei(-5/6、x ^ 6)

IN:在: inte( x^2*e^x, x)强烈的(x ^ 2 * e ^ x,x)

OUT: ei(2, x)出:ei(2 x)

IN:在: inte( x*e^(-x), x)强烈的(x ^ * e(-x)、x)

OUT: -e^(-x) - x e^(-x)出:. ^(-x)- x e ^(-x)

IN:在: inte( e^x/sqrt(x), x)希尔(e ^ x / sqrt(x)、x)

OUT: ei(-0.5, x)出:ei(-0.5 - x)

IN:在: inte(x^1.5*exp(x), x)强烈的(x ^ 1.5 *经验(x)、x)

OUT: ei(1.5, x)出:ei(1.5 - x)

IN:在: inte(sin(x)*e^x, x)强烈的(罪(x)* e ^ x,x) # integrals involving sin(x) and e^x涉及犯罪#积分(x)和e ^ x

OUT: 1/2 * (sin(x) - cos(x)) * e^x出:1/2 *(罪(x)- cos(x))* e ^ x

IN:在: inte( x*ln(x), x)强烈的(x *淋巴结(x)、x) # integrands involving ln(x)# integrands涉及淋巴结(x)

OUT: -1/4 x^2 + 1/2 x^2 ln(x)出:1/4 x ^ 2 ^ 2 + 1/2 x(x);

IN:在: inte( ln(x)^6, x)希尔(淋巴结(x)^ 6,x)

OUT: li(6, x)出:李(6、x)

IN:在: inte( ln(x)/sqrt(x), x)希尔(淋巴结(x)/ sqrt(x)、x)

OUT: -4 sqrt(x) + 2 sqrt(x) ln(x)出:4 sqrt(x)+ 2 sqrt(x)淋巴结(x)

IN:在: inte( ln(x)/sqrt(1 + x), x)希尔(淋巴结(x)/ sqrt(1 + x)、x)

OUT: -4 sqrt(1 + x) + 2 sqrt(1 + x) ln(x) - 2 ln((-1 + sqrt(1 + x))/(1 + sqrt(1 + x)))出:4 sqrt(1 + x)+ 2 sqrt(1 + x);取出(x)- 2(1 + sqrt(1 + x))/(1 + sqrt(1 + x))

IN:在: inte( 1/(a x + b), x)希尔(1 /(x + b),x) # integrands involving polynomials# integrands涉及多项式

OUT: ln((b + a x) sign(b + a x))/a出:淋巴结((b +一个x)签署(b +一个x))

IN:在: inte( x/(x^2 + 5 x + 6), x)强烈的(x(x ^ 2 + 5倍+ 6)、x)

OUT: 1/2 ln(|6 + 5 x + x^2|) - 5/2 ln(|(2 + x)/(3 + x)|)出:1/2淋巴结(| 6 + 5倍+ x ^ 2 |)-整合淋巴结(|(2 + x)/(3 + x)|)

IN:在: inte( (x^3 + x)/(x^4 + 2 x^2 + 1), x)希尔((x ^ 3 + x)/(x ^ ^ 4 + 2×2 + 1)、x)

OUT: 1/4 ln((1 + 2 x^2 + x^4) sign(1 + 2 x^2 + x^4))出:1/4淋巴结(1 + 2 x ^ ^ 2 + x 4)签订(1 + 2 x ^ ^ 2 + x 4))

Example:例如:

Find the line integral.找到的线积分。

IN:在: x:=2*t谢:= 2 * t

IN:在: y:=3*t杨:= 3 * t

IN:在: z:=5*t赵:= 5 * t

IN:在: u:=x+y你:= x + y

IN:在: v:=x-y老板:= x - y

IN:在: w:=x+y+z魏:= x + y + z

IN:在: inte(u*d(u,t)+v*d(v,t)+w*d(w,t), t)希尔(u * d(u、t)+ v * d(v,t)+ w * d(w,t),t)

OUT: 63 t^2出:63 t ^ 2

Example:例如:

Integrate x^2*e^x, then expand it by the mean of the packages "ExpandEi.整合x ^ ^ 2 * e x,然后扩大它的“ExpandEi意味着的包装。sm" (expand ei(n,x)).sm”(扩大ei(n、x))。 The packages "ExpandGa.ExpandGa包”。sm" (expand gamma(n,x)) and "ExpandLi.sm”(扩大伽玛(氮、x))和“ExpandLi。sm" (expand li(n,x)) are similar one.sm”(扩大李(氮、x))相似的对话。

IN:在: inte(x^2*e^x, x)强烈的(x ^ 2 * e ^ x,x)

OUT: ei(2,x)出:ei(2 x) # ei()# ei()

IN:在: readfile("ExpandEi.sm")readfile(“ExpandEi.sm”)

IN:在: ExpandEi(ei(2, x))ExpandEi(ei(2 x))

OUT: x^2 e^x - 2 x e^x + 2 e^x出:x ^ ^ 2 e ^ 2 x e x - x + 2 e ^ x # ei() is expanded美国饭店协会教育学院()号扩展

Defining integrals is similar to defining rules.类似于定义界定积分规则。

Example:例如:

IN:在: inte(f(x_), x_) := sin(x)希尔(f(x_),x_):=罪(x)

IN:在: inte(f(t), t)希尔(f(t),t)

OUT: sin(t)出:罪(t)

7.2. Definite Integration7.2。明确的整合

Find definite integrals by external functions找到明确由外部功能积分

inte(expr, x from xmin to xmax)希尔(expr,从x xmin到xmax)

inte(expr, x from xmin to singularity to xmax)希尔(expr,从x xmin奇异性,对xmax)

Example:例如:

Find the definite integral of y=exp(1-x) with respect to x taken from 0 to infinity.找到了定积分的y =经验(1-x)关于x采取从0到无限。

IN:在: inte(exp(1-x), x from 0 to inf)强烈的预期(1-x)、x从0到无穷大)

OUT: e出:呃

Example:例如:

do discontinuous integration of 1/x^2 and 1/x^3 with discontinuity at x=0.做整合/ x不连续^ 1 ^ 2和1 / x第三不连续在x = 0。

IN:在: inte(1/x^2, x from -1 to 2)希尔(1 / x ^ 2、x从1到2) # singularity at x=0x = 0 #奇异点

OUT: inf出:步

IN:在: inte(1/x^3, x from -1 to 1)希尔(1 / x ^ 3、x从1到1) # singularity at x=0x = 0 #奇异点

OUT: 0出:0

IN:在: inte(sqrt((x-1)^2), x from 0 to 2)希尔(sqrt(x-1)^ 2)、x从0到2) # singularity at x=1x = 1 #奇异点

OUT: 1出:1 .

SymbMath usually detect singularity, but sometime it cannot, in this case you must provide singularity.通常SymbMath检测奇异点,但是有时它进不去的,在这种情况下,你必须提供奇异点。

Example:例如:

IN:在: inte(1/(x-1)^2, x from 0 to 1 to 2)希尔(1 /(x-1)^ 2、x从0到1 - 2) # provide singularity at x=1#提供奇异点x = 1

OUT: inf出:步

Example:例如:

complex integration.复杂的整合。

IN:在: inte(1/x, x from i to 2*i)希尔(1 / x,从x我2 *我)

OUT: ln(2)出:;(2)

7.3.7.3。 Numeric Integration: ninte()数字集成:ninte()

The external function对外功能

ninte(y, x from xmin to xmax)ninte(y,从x xmin到xmax)

does numeric integration.做数字集成。

Example:例如:

Compare numeric and symbolic integrals of 4/(x^2+1) with respect to x taken from 0 to 1.积分的数值和符号比较4(x ^ 2 + 1)关于x是从0到1。

IN:在: ninte(4/(x^2+1), x from 0 to 1)ninte(4 /(x ^ 2 + 1)、x从0到1)

OUT: 3.1415出:1 .

IN:在: num(inte(4/(x^2+1), x from 0 to 1))胡(交互(4 /(x ^ 2 + 1)、x从0到1))

OUT: 3.1416出:1 .

8.8。 Solving Equations求解方程

8.1. Solving Algebraic Equations8.1。求解代数方程

The equations can be operated (e.g. +, -, *, /, ^, expand(), diff(), inte()). 方程可操作(例如。+,-,*,/,^,扩大()()、强烈的差别()。The operation is done on both sides of the equation, as by hand. 操作上做双方的方程,为手工做的。You can find roots of a polynomial, algebraic equations, systems of equations, differential and integral equations.你可以找到一个多项式的根,代数方程,方程系统,微分和积分方程。

You can get the left side of the equation by你能得到的方程的左侧

left(left_side = right_side)左(left_side = right_side)

or get the right side by或者让右边

right(left_side = right_side)右(left_side = right_side)

You can assign equations to variables.你可以指定方程变量。

Example:例如:

IN:在: eq1:= x + y = 3eq1:= x + y = 3

IN:在: eq2:= x - y = 1eq2:= x - y = 1

IN:在: eq1+eq2eq1 + eq2

OUT: 2 x = 4出:2 x = 4

IN:在: last/2最后2

OUT: x = 2出:x = 2

IN:在: eq1-eq2eq1-eq2

OUT: 2 y = 2出:2 y = 2

IN:在: last/2最后2

OUT: y = 1出:y = 1

Example:例如:

Solve an equation sqrt(x+2*k) - sqrt(x-k) = sqrt(k), then check the solution by substituting the root into the equation.sqrt解决一个方程(x + 2 * k)- sqrt(x-k)= sqrt(k),然后检查溶液代替这个根方程。

IN:在: eq1 := sqrt(x + 2*k) - sqrt(x - k) = sqrt(k)eq1:= sqrt(x + 2 * k)- sqrt(x - k)= sqrt(k)

OUT: eq1 := sqrt(x + 2*k) - sqrt(x - k) = sqrt(k)出:eq1:= sqrt(x + 2 * k)- sqrt(x - k)= sqrt(k)

IN:在: eq1^2eq1 ^ 2

OUT: ((2*k + x)^0.5 - ((-k) + x)^0.5)^2 = k出:(2 * k + x)^ 0.5 -((-k)+ x)^ 0.5)^ 2 = k

IN:在: expand(last)扩大(最后)

OUT: 2*x + k + (-2)*(2*k + x)^0.5*((-k) + x)^0.5 = k出:2 * x + k +(2)*(2 * k + x)^ 0.5 *(-k)+ x)^ 0.5 = k

IN:在: last-k-2*xlast-k-2 * x

OUT: (-2)*(2*k + x)^0.5*((-k) + x)^0.5 = (-2)*x出去。(2)*(2 * k + x)^ 0.5 *(-k)+ x)^ 0.5 =(2)* x

IN:在: last/(-2)最后(2)

OUT: (2*k + x)^0.5*((-k) + x)^0.5 = x出:(2 * k + x)^ 0.5 *(-k)+ x)^ 0.5 = x

IN:在: last^2最后^ 2

OUT: (2*k + x)*((-k) + x) = x^2出:(2 * k + x)*(-k)+ x)= x ^ 2

IN:在: expand(last)扩大(最后)

OUT: (-2)*k^2 + k*x + x^2 = x^2出去。(2)* ^ 2 k + k * x + x ^ 2 = x ^ 2

IN:在: last-x^2+2*k^2last-x ^ ^ 2 + 2 * 2 k

OUT: k*x = 2*k^2出:阿k * x = 2 * ^ 2 k

IN:在: last/k最后/ k

OUT: x = 2*k出:x = 2 * k

IN:在: subs(eq1, x = right(last))替补(eq1、x =权利(最后))

OUT: k^0.5 = k^0.5出:阿k ^ ^ 0.5 = 0.5 k

You can solve algebraic equations step by step, as above. 你可以解决代数方程一步一步,如上。This method is useful in teaching, e.g. showing students how to solve equations.在教学中,那么这个方法是非常有用,例如为学生们展示如何解决方程。

8.2.8.2。 Equation Solver: solve()方程求解解决()

The solve() functions()功能解决

solve(expr1 = expr2, x)解决(expr1 = expr2、x)

solve([expr1 = expr2, expr3 = expr4], [x, y])解决([expr1 = = expr4 expr2,expr3]、[x,y])

solve a polynomial and systems of linear equations on one step. 解决一个多项式和系统的线性方程组在足下。It is recommended to set the switch expand:=on when solve the complicated equations. 建议设置开关扩大:=当解决复杂的方程式。All of the real and complex roots of the equation will be found by solve(). 所有真正的和复杂的方程的根必被找到解决()。The function solve() outputs a list of roots when there are multi-roots. 解决()输出功能表有multi-roots根。You can get one of roots from the list, (see Chapter 4.9 Arrays, Lists, Vectors and Matrices).你可以找一个根从名单上,(见章节4.9阵列、列表、向量和矩阵)。

Example:例如:

Solve a+b*x+x^2 = 0 for x, save the root to x.解决一个+ b * x + x ^ 2 = 0 x,节省了根系对x。

IN:在: solve(a+b*x+x^2 = 0, x)解决a + b * x + x ^ 2 = 0,x) # solve or re-arrange the equation for x#解决的公式或自行x

OUT: x = [-b/2 + sqrt((b/2)^2 - a),出:x =[-b / 2 + sqrt(b / 2)^ 2 - a), -b/2 - sqrt((b/2)^2 - a)]-b / 2 - sqrt(b / 2)^ 2 -一个)

IN:在: x := right(last)谢:=权利(最后) # assign two roots to x指派两根x号

OUT: x := [-b/2 + sqrt((b/2)^2 - a),出:谢:=[-b / 2 + sqrt(b / 2)^ 2 - a), -b/2 - sqrt((b/2)^2 - a)]-b / 2 - sqrt(b / 2)^ 2 -一个)

IN:在: x[1]x[1] # the first root#第一根

OUT: -b/2 + sqrt((b/2)^2 - a)出:-b / 2 + sqrt(b / 2)^ 2 - a)

IN:在: x[2]x[2] # the second root#第二根

OUT: -b/2 - sqrt((b/2)^2 - a)出:-b / 2 - sqrt(b / 2)^ 2 - a)

Example:例如:

Solve x^3 + x^2 + x + 5 = 2*x + 6.解决x ^ 3 + x ^ 2 + x + 5 = 2 * x + 6。

IN:在: num(solve(x^3+x^2+x+5 = 2*x+6, x))胡(解决(x ^ 3 + x ^ 2 + x + 5 = 2 * x + 6,x))

OUT: x = [1, -1, -1]出:x =[1]1,1)

The function solve() not only solves for a simple variable x but also solves for an unknown function, e.g. ln(x).解决()的功能不仅可以解决了一个简单的变量x还解决了一个未知的功能,例如淋巴结(x)。

Example:例如:

Solve the equation for ln(x).为解决方程;(x)。

IN:在: solve(ln(x)^2+5*ln(x) = -6, ln(x))解决(淋巴结(x)^ 2 + 5 *淋巴结(x)= 6、淋巴结(x))

OUT: ln(x) = [-2, -3]出:淋巴结(x)=[2、3)

IN:在: exp(last)(最后)实验

OUT: x = [exp(-2), exp(-3)]出:x =[实验,实验(2)(3))

Example:例如:

Rearrange the equations.重新安排方程。

IN:在: eq := [x+y = 3+a+b, x-y = 1+a-b]情商:=[x + y = 3 + + b,x - y = 1 +故) # assign equations to eq#分配方程式式

IN:在: solve(eq, [x,y])解决(eq(x,y) # rearrange eq for x and y#重排eq为x和y

OUT: [x = -1/2*(-4 - 2 a), y = -1/2*(-2 - 2 b)]出:[x = 1/2 *(4 - 2 a),y = 1/2 *(2 - 2 b)

IN:在: solve(eq, [a,b])解决(eq(a,b) # rearrange eq for a and b#重排eq为a和b

OUT: [a = -1/2*(4 - 2 x), b = -1/2*(2 - 2 y)]出:[= 1/2 *(4 - 2 x),b = 1/2 *(2 - 2 y)

IN:在: solve(eq, [a,y])解决(eq,[一个,y]) # rearrange eq for a and y#重新排列为一个和y情商

OUT: [b = -1/2*(2 - 2 y), x = -1/2*(-4 - 2 a)]出:[b = 1/2 *(2 - 2 y)、x = 1/2 *(4 - 2 a))

IN:在: solve(eq, [x,b])解决(eq(x,b]) # rearrange eq for x and b#重新排列x和b情商

OUT: [a = 1/2*(-4 + 2 x), y = 1/2*(2 + 2 b)]出:[= 1/2 *(4 + 2 x),y = 1/2 *(2 + 2 b)

8.3.8.3。 Polynomial Solver: psolve()多项式求解:psolve()

The external function对外功能

psolve(f(x), x)psolve(f(x)、x)

solves f(x)=0 for x. It is similar to solve(), but it only can solve polynomial with order < 3.解决了f(x)= 0 x。这就像解决(),但是它只能求解多项式订单< 3。

e.g.例句。

IN:在: psolve(x^2+5*x+6, x)psolve(x ^ 2 + 5 * x + 6,x)

OUT: [-2, -3]出:[2、3)

8.4.8.4。 Numeric Solver: nsolve()数值求解:nsolve()

The external functions外部功能

nsolve(f(x) = x, x)nsolve(f(x)= x,x)

nsolve(f(x) = x, x,x0)nsolve(f(x)= x,x,x0)

numerically solves an algebraic equation with an initial value x0. 一种代数方程数值解决x0一个初始值。By default x0=1. 默认情况下x0 = 1。nsolve() only gives one solution near x0, omitting other solutions.nsolve()只给一个解决办法靠近x0、删除其他的解决方案。

Example:例如:

IN:在: nsolve( cos(x) = x, x)nsolve(因为(x)= x,x)

OUT: x = 0.73911289091出:x = 0.73911289091

IN:在: nsolve( sin(x) = 0, x,0)nsolve(罪(x)= 0,x,0) # similar to asin( sin(x)=0 )asin #相似(罪(x)= 0)

OUT: x = 0出:x = 0 # only gives one solution near x0=0解决#只给附近x0 = 0

IN:在: nsolve( sin(x) = 0, x,3)nsolve(罪(x)= 0,x,3)

OUT: x = 3.14出:x = 3.14 # only gives one solution near x0=3解决#只给附近x0 = 3

8.5.8.5。 Solving Differential Equations解微分方程

You can solve the differential equations:你能解决这个微分方程:

y'(x) = f(x)y”(x)= f(x)

by integrating the equation.通过整合方程。

y'(x) is the same as d(y(x),x).y”(x)是一样的d(y(x)、x)。

Example:例如:

solve y'(x)=sin(x) by integration.解决y”(x)=罪(x)整合。

IN:在: inte( y'(x) = sin(x), x)希尔(y”(x)=罪(x)、x)

OUT: y(x) = constant - cos(x)出:y(x)=持续不断的——因为(x)

8.6.8.6。 Differential Solver: dsolve()微分求解:dsolve()

The external function对外功能

dsolve(y'(x) = f(x,y), y(x), x)dsolve(y”(x)= f(x,y),y(x)、x)

can solve the first order variables separable and linear differential equations能解决这一阶变量和线性微分方程可分离

y'(x) = h(x)y”(x)= h(x)

y'(x) = f(y(x))y”(x)= f(y(x))

y'(x) = f(y(x))*xy”(x)= f(y(x))* x

y'(x) = g(x)*y(x)y”(x)= g(x)性感(x)

y'(x) = g(x)*y(x)+h(x)y”(x)= g(x)性感(x)+ h(x)

on one step. 在一个步骤。Notice that y'(x) must be alone on the left hand side of the equation. 注意到y”(x)必须独自在左手边的方程。It is recommended to set the switch expand:=on when solving the complicated differential equations.建议设置开关扩大:=当解决这个复杂微分方程组。

Example:例如:

Solve y'(x) = sin(x) by dsolve().解决y”(x)=罪(x)dsolve()。

IN:在: dsolve( y'(x) = sin(x), y(x), x)dsolve(y”(x)=罪(x),y(x)、x)

OUT: y(x) = constant - cos(x)出:y(x)=持续不断的——因为(x)

Example:例如:

Solve differential equations by dsolve(). 通过求解微分方程dsolve()。If the result is a polynomial, then rearrange the equation by solve().如果结果是一个多项式,然后重新排列方程解决()。

IN:在: dsolve(y'(x) = x/(2+y(x)), y(x), x)dsolve(y”(x)= x /(2 + y(x)),y(x)、x)

OUT: 2*y(x) + 1/2*y(x)^2 = constant + x^2出:2 * y(x)+ 1/2性感(x)^ ^ 2 =不断+ x 2

IN:在: solve(last, y(x))解决(最后,y(x))

OUT: y(x) = [-2 + sqrt(4 - 2*(-constant - x^2)),出:y(x)=[2 + sqrt(4 - 2 *(-constant - x ^ 2)),

-2 - sqrt(4 - 2*(-constant - x^2))]sqrt 2 -(4 - 2 *(-constant - x ^ 2))

Example:例如:

Solve differential equations by dsolve().通过求解微分方程dsolve()。

IN:在: dsolve(y'(x) = x*exp(y(x)), y(x), x)dsolve(y”(x)= x *经验(y(x)),y(x)、x)

OUT: -e^(-y(x)) = constant + x^2出:. ^(可能的(x))+ x ^ 2 =不变

IN:在: dsolve(y'(x) = y(x)^2+5*y(x)+6, y(x), x)dsolve(y”(x)= y(x)^ 2 + 5性感(x)+ 6,y(x)、x)

OUT: ln((4 + 2 y(x))/(6 + 2 y(x))) = constant + x出:淋巴结(4 + 2 y(x))/(6 + 2 y(x))=不断+ x

IN:在: dsolve(y'(x) = y(x)/x, y(x), x)dsolve(y”(x)= y(x)/ x,y(x)、x)

OUT: y(x) = constant x sign(x)出:y(x)=不断x签署(x)

IN:在: dsolve(y'(x) = x + y(x), y(x), x)dsolve(y”(x)= x + y(x),y(x)、x)

OUT: y(x) = -1 - x + constant*e^x出:y(x)= 1 - x + e ^不断* x

9.9。 Sums, Products, Series and Polynomials总结、产品、系列和多项式

You can compute partial, finite or infinite sums and products. 你可以计算部分,有限的或无限的金额和产品。Sums and products can be differentiated and integrated. 金额和产品可分化和综合。You construct functions like Taylor polynomials or finite Fourier series. 你喜欢泰勒多项式函数或构建有限傅立叶级数。The procedure is the same for sums as products so all examples will be restricted to sums.程序是相同的,所以所有款项作为产品的例子将会限制在总结。 The general formats for these functions are:一般格式为这些功能有:

sum(expr, x from xmin to xmax)钱,从x xmin expr对xmax)

sum(expr, x from xmin to xmax step dx)钱,从x xmin expr xmax一步,dx)

prod(expr, x from xmin to xmax)促进(expr,从x xmin到xmax)

prod(expr, x from xmin to xmax step dx)促进(expr,从x xmin xmax一步,dx)

The expression expr is evaluated at xmin, xmin+dx, ...表达是xmin expr的评估,xmin + dx,… up to the last entry in the series not greater than xmax, and the resulting values are added or multiplied.到最后条目不能大于xmax系列,产生的价值观是添加或成倍增加。 The part "step dx" is optional and defaults to 1.部分“步dx”是可选择的而且默认1。 The values of xmin, xmax and dx can be any real number.xmin的价值,xmax和dx可以是任何的实数。

Here are some examples:这里是一些例子:

sum(j, j from 1 to 10)和(j,j从1到10)

for 1 + 2 + .. 1 + 2 +…+ 10.+ 10。

sum(3^j, j from 0 to 10 step 2)金额(3 ^ j,j从0到10第二步)

for 1 + 3^2 + ... 1 + 3 ^ 2 +…+ 3^10.10 + 3 ^。

Here are some sample Taylor polynomials:这里有一些样品泰勒多项式:

sum(x^j/j!(x ^总和j / j !, j from 0 to n)[j].从0到n)

for exp(x).为实验(x)。

sum((-1)^j*x^(2*j+1)/(2*j+1)!(1)和(x ^ ^ j *(2 * m + 1)/(2 * m + 1)!, j from 0 to n)[j].从0到n)

for sin(x) of degree 2*n+2.罪(x)的程度2 * n + 2。

Remember, the 3 keywords (from, to and step) can be replaced by the comma ,.记住,三个关键词(从与措施)可以被逗号。

9.1.9.1。 Partial Sum部分和

The function功能

partsum(f(x),x)partsum(f(x)、x)

finds the partial sum (symbolic sum).发现部分和(象征性金额)。

Example:例如:

Find the sum of 1^2 + 2^2 ... 找到的总和^ 1 ^ 2 + 2 2…+ n^2.+ n ^ 2。

IN:在: partsum(n^2, n)partsum(n ^ 2 n)

OUT: 1/6 n (1 + n) (1 + 2 n)出:1/6 n(1 + n)(1 + 2 n)

9.2.9.2。 Infinite Sum无限金额

The function功能

infsum(f(x), x)infsum(f(x)、x)

finds the infinite sum, i.e. sum(f(x), x from 0 to inf).发现无限和,即和(f(x)、x从0到无穷大)。

Example:例如:

IN:在: infsum(1/n!infsum(1 / n !, n),n)

OUT: e出:呃

9.3.9.3。 Series系列

The external functions外部功能

series(f(x), x)系列(f(x)、x)

series(f(x), x, order)系列(f(x)、x、顺序)

to find the Taylor series at x=0. 找到泰勒级数在x = 0。The argument (order) is optional and defaults to 5.的论点(顺序)是可选的,默认为5。

Example:例如:

Find the power series expansion for cos(x) at x=0.发现幂级数增长因为(x)在x = 0。

IN:在: series(cos(x), x)系列(因为(x)、x)

OUT: 1 - 1/2 x^2 + 1/24 x^4出:1 - 1/2 x ^ ^ 4×2 + 1/24

The series expansion of f(x) is useful for numeric calculation of f(x). 本系列扩展f(x)是有效的数值计算f(x)。If you can provide derivative of any function of f(x) and f(0), even though f(x) is unknown, you may be able to calculate the function value at any x, by series expansion. 如果您能提供任何函数的导数,f(x)和己(0),即使f(x)是未知的,你可以计算函数值的大小在任何x,级数展开。Accuracy of calculation depends on the order of series expansion. 计算的准确性取决于级数展开的顺序。Higher order, more accuracy, but longer calculation time.高阶、更准确,但计算时间长。

Example:例如:

calculate f(1), knowing f'(x)=-sin(x) and f(0)=1, where f(x) is unknown.计算f(1),知道f(x)= -sin”和f(x)= 1(0),在f(x)是未知的。

IN:在: f'(x_) := -sin(x)“(x_):f(x)= -sin

IN:在: f(0) := 1f(0):= 1

IN:在: f(x_) := eval(series(f(x), x))f(x_):=:(系列(f(x)、x)) # must eval()必须():

OUT: f(x_) := 1 - 1/2 x^2 + 1/24 x^4出:f(x_):= 1 - 1/2 x ^ ^ 4×2 + 1/24

IN:在: f(1)外(1)

OUT: 13/24出:13/24

9.4.9.4。 Polynomials多项式

Polynomials are automatically sorted in order from low to high.自动分类为多项式从低到高。

You can pick up one of coefficient of x in polynomials by你可以选择一个x在多项式系数

coef(poly, x^n)系数(聚、x ^ n)

e.g.例句。

IN:在: coef(x^2+5*x+6, x)系数(x ^ 2 + 5 * x + 6,x)

OUT: 5出:5

Note that you cannot pick up the coefficient of x^0 by coef(y,x^0).注意,你不能拿起系数x ^ 0系数(y,x ^ 0)。

You can pick up one of coefficient of x in polynomials with order < 5 by你可以选择一个系数多项式与秩序x的< 5

coef(poly, x,n)系数(聚,x,n)

e.g.例句。

IN:在: coef(x^2+5*x+6, x,0)系数(x ^ 2 + 5 * x + 6,x,0)

OUT: 6出:6

You can pick up all of coefficients of x in polynomials with order < 5 by你可以选择所有的系数多项式与秩序x的< 5

coefall(poly, x)coefall(聚、x)

e.g.例句。

IN:在: coefall(x^2+5*x+6, x)coefall(x ^ 2 + 5 * x + 6,x)

OUT: [6, 5, 1]出:[6、5,1] # 6 + 5*x + x^26 # + 5 * x + x ^ 2

IN:在: coefall(a*x^2+b*x+c, x)coefall(x ^ 2 + b * * x + c,x)

OUT: [c, b, a]出:[c、b,) # symbolic values of coefficients#符号价值系数

You can pick up the highest order of x in polynomials with order < 5 by你可以选择最高的秩序为x的多项式与< 5

order(poly, x)订单(聚、x)

e.g.例句。

IN:在: order(x^2+5*x+6, x)订单(x ^ 2 + 5 * x + 6,x)

OUT: 2出:2

You can factor polynomials in order < 5 with respect to x by你可以为因素多项式< 5就x

factor(poly, x)因子(多边形,x)

e.g.例句。

IN:在: factor(x^2+5*x+6, x)因子(x ^ 2 + 5 * x + 6,x)

OUT: (2 + x) (3 + x)出:(2 + x)(3 + x)

10.10。Lists and Arrays, Vectors and Matrices列表和阵列、向量和矩阵

You can construct lists and arrays of arbitrary length, and the entries in the lists and arrays can be of any type of value whatsoever: constants, expressions with undefined variables, or equations.可以构建清单和任意长度的数组,数组列表条目,可以是任何类型的价值无论:常数,与未定义的变量表达式或方程。

A vector or matrix can be represented by a list or array. 一个向量和矩阵可以表示为一个列表或阵列。In a matrix, the number of elements in each row should be the same, e.g. [[a11, a12], [a21, a22]].在一个母体中,大量的元素在每一行应当是相同的,例如。[[a11,a12]、[,38,a22]]。

10.1.10.1。 Lists名单

10.1.1.10.1.1。 Entering Lists进入名单

You can define a list by putting its elements between two square brackets. 你可以定义一个列表把它的元素在两个方括号。e.g. [1,2,3]例句。[1、2、3)

You can define lists another way, with the command:你可以定义列表另一种方式,该命令:

[ list(f(x), x from xmin to xmax step dx) ][列表(f(x),从x xmin xmax一步,dx)

This is similar to the sum command,这是类似于金额的命令, but the result is a list:但结果是一个列表:

[f(xmin), f(xmin+dx), ...(f(xmin),f(xmin + dx),…, f(xmin+x*dx), ...]f(xmin + x * dx),…)

which continues until the last value of xmin + x*dx持续到最后的价值xmin + x * dx吗 <= xmax.xmax < =。

You also can assign the list to a variable, which variable name become the list name:你也可以指定一个变量的名单,名单上的名字成为变量的名字:

a := [1,2,3]答:=[1、2、3) # define the list of a定义列表的号

b := [f(2), g(1), h(1)]乙:=[外(2),g(1),h(1) # assumes f,g,h defined#承担f,g、h定义

c := [[1,2],3,[4,5]]顾客:=[[1,2],3,[4、5]] # define the list of c#定义的名单c

Lists are another kind of value in SymbMath, and they can be assigned to variables just like simple values. 列表是一个SymbMath另一种价值,他们可以被指定给变量就像简单的值。(Since variables in SymbMath language are untyped, you can assign any value to any variable.).(因为untyped SymbMath语言变量,你可以指定任何价值任何变量)。

A function can have a list for its value:一个函数可以拥有一张价值:

f(x_) := [sqrt(x), -sqrt(x)]f(x_):=[sqrt(x),-sqrt(x))

e.g.例句。

IN:在: squreroot(x_) := [sqrt(x), -sqrt(x)]squreroot(x_):=[sqrt(x),-sqrt(x))

IN:在: squreroot(4)squreroot(4)

OUT: [2, -2]出:[1,2]

A function can have a list for its argument:一个函数可以有它的参数列表:

abs([-1,2])abs([1,2])

Try试着

a := [ list(j^2, j from 0 to 10 step 1) ]答:=[列表(m ^ 2、j从0到10个步骤1)

f(x_) := [ list(x^j, j from 0 to 6 step 1) ]f(x_):=[列表(x ^ j,j从0到6步骤1)

b := f(-2)乙:= f(2)

10.1.2.10.1.2。 Accessing Lists访问列表

You can find the value of the j-th member in a list by你能找到j-th成员的值在一个列表

member([a,b], j)会员(会员(a,b),j)

The first member of a list is always member(x, 1).第一届会员总是成员名单(x,1)。

If you have assigned a list to a variable x, you can access the j-th element by the list index x[j]. 如果你有分配给一个变量x的一个列表,您可以访问列表的元件,j-th指数x[j].The first element of x is always第一个元素的x是永远 x[1].x[1]。 If the x[j] itself is a list, then its j-th element is accessed by repeating the similar step.如果x[j]本身就是一个名单,那么它的j-th元素是通过重复类似的步骤。But you can not use the list index unless the list is already assigned to x.但是你不能使用,除非清单列表索引已分配给x。

e.g.例句。

IN:在: x := [[1,2],3,[4,5]]谢:=[[1,2],3,[4、5]] # define the x list定义x名单。#

IN:在: x[1], x[2]x[1]、[2]x # take its first and 2nd element#取其第一和2nd元素

OUT: [1, 2], 3出:[1,2],3

IN:在: xx # access the entire list of x#访问的整个目录x

OUT: [[1, 2], 3, [4,5]]出:[[1,2],3,[4、5]]

IN:在: member(x, 2)会员(x,2) # same as x[2]# x[2]一样

OUT: 3出:3

An entire sub-list of a list x整个sub-list名单x can be accessed with the command x[j], which is the list:该命令可以被存取x[j],这是列表:

[x[j], x[j+1], ... [j],[x x[j + 1],……]]

10.1.3.10.1.3。 Modifying Lists修改列表

The subs() replaces the value of the element in the list, as in the variables. 潜艇()代替了价值的元素在列表,如在变量。e.g.例句。

IN:在: subs([a,b,c], a = a0)替补([a、b、c)之后,一个= a0)

OUT: [a0, b, c]出:[a0,b,c)

Note that you cannot modify lists by assignment.注意,你不能修改列表通过转让。

10.1.4.10.1.4。 Operating Lists操作列表

Lists can be added, subtracted, multiplied, and divided by other lists or by constants.名单可以补充道,扣、增多,其他的名单或除以常量。 When two lists are combined, they are combined term-by-term, and the combination stops when the shortest list is exhausted.当两个列表是结合之后,他们term-by-term相结合,会在最短的列表结合款子已提清。 When a scalar is combined with a list, it is combined with each element of the list.当一个标量结合一个列表,结合每个元素的列表。 Try:试一试:

a := [1,2,3]答:=[1、2、3)

b := [4,5,6]乙:=[4、5、6)

a + b+ b

a / ba / b

3 * a3 *

b - 4b - 4

Example 4.9.2.4.1.4.9.2.4.1例子。

Two lists are added.两个列表是补充说。

IN:在: [a1,a2,a3] + [b1,b2,b3][a1、a2、a3]+[b1、b2、b3)

OUT: [a1 + b1, a2 + b2, a3 + b3]出:[a1,a2 + + b1,b2 a3 + b3)

IN:在: last[1]最后一个[1]

OUT: a1 + b1出:a1 + b1

If L is a list, then如果我是一个清单,然后 f(L) results in a list of the values, even though f() is the differentiation or integration function (d() or inte()).f(L)会导致一连串的价值,即使f()或整合功能分化(d()或交互()。

IN:在: sqrt([a, b, c])sqrt([a、b、c])

OUT: [sqrt(a), sqrt(b), sqrt(c)]出:[sqrt(a)、sqrt(b),sqrt(c))

IN:在: d([x, x^2, x^3], x)d((x ^ 2、x、x ^ 3]、x)

OUT: [1, 2*x, 3*x^2]出:[1、2、3 * * * x ^ 2]

If you use a list as the value of a variable in a function, SymbMath will try to use the list in the calculation.如果你使用一个列表,作为一个变量的价值功能,SymbMath将试图把这张清单的计算。

You can sum all the elements in a list x by你只能全额的所有元素。在一个列表x

listsum(x)listsum(x)

Example:例如:

IN:在: listsum([a,b,c]^2)listsum([a、b、c]^ 2)

OUT: a^2 + b^2 + c^2:一个^ ^ 2 + 2 + b c ^ 2

This function takes the sum of the squares of all the elements in the list x.这个函数之和的广场的所有元素列表x。

You can do other statistical operations (see Section 4.10. 你可以做其它的统计操作(请参见第4.10节。Statistics) on the list, or plot the list of numeric data (see Section 5. 统计)在列表上,或者情节的名单(见第5节数字数据。Plot).情节)。

You can find the length of a list (the number of elements in a list) with:你能找到一个列表的长度(所包含的元素数量在一个列表):

length(a)长度(a)


10.2.10.2。 Arrays阵列

10.2.1.10.2.1。 Entering Arrays进入阵列

You can define an array of a by assigning its element value into its index:你可以定义一个数组的元素值,在通过赋值指标:

a[1]:=1一个[1]:= 1

a[2]:=4一个[2]:= 4

or you can define arrays another way, with the command:或者你可以定义数组的另一种方式,该命令:

do(a[x]:=f(x), x from xmin to xmax step dx)做一个[x]:= f(x),从x xmin xmax一步,dx)

e.g.例句。

do(a[j] := 2*j, j from 1 to 2)做一个[j]:[j]. = 2 * j从1到2)

You can define 2-dimentional array by你可以定义2-dimentional阵列

a[1,1]:=11一个[- 1,1]:= 11

a[1,2]:=12一个[1,2]:= 12

a[2,1]:=21一个(2,1]:= 21

a[2,2]:=22一个[2,2]:= 22

or

do(do(a[j,k]:=j+k, j,jmin,jmax,dj), k,kmin,kmax,dk)(做一个[j、k]:= j + k,j,jmin,dj,jmax)、钾、kmin,kmax,骑士)

10.2.2.10.2.2。 Accessing Arrays访问数组

After defining an array of a, you can access one of its element by its index以一个数组的形式返回一个定义,你可以访问它的一个元件,其指标

IN:在: a[1]一个[1]

OUT: 1出:1 .

You also can list out all of its elements by你也可以列出所有的要素

list(a[j], j,1,2,1)列表(一个[j],j,第1、2、1)

e.g.例句。

IN:在: do(a[j]:=2*j, j,1,2,1)做一个[j]:= 2 * j,j,第1、2、1)

IN:在: list(a[j], j,1,2)列表(一个[j],j,1,2)

OUT: 1, 4出:1、4

10.2.3.10.2.3。 Modifying Arrays修改数组

You can modify an array by assigning new value into its index你能修改数组通过指定新的价值转化为指标

IN:在: a[1]:=2一个[1]:= 2

10.2.4.10.2.4。 Operating Arrays操作阵列

e.g.例句。

after defining 2 arrays a and b, find their dot time, a .2数组定义a和b,找出他们的点时间,一个。* b.* b。

IN:在: a[1]:=1, a[2]:=2一个[1]:= 1,一个[2]:= 2 # define array a#定义一个数组

IN:在: b[1]:=11, b[2]:=12b(1):= 11,b[2]:= 12 # define array b#定义数组b

IN:在: p:=0警:= 0

IN:在: do(p:=p + a[j]*b[j], j,1,2,1)(鲍西娅:= p +一个[j]. * b[j],j,第1、2、1) # a .#。* b* b

10.3.10.3。 Vectors and Matrices向量和矩阵

You can uses arrays or lists to represent vectors, and lists of lists to represent matrices.你可以使用数组或列表来代表向量,并列举的列表来代表矩阵。

Vectors and matrices can be operated by "+" and "-" with vectors and matrixes, by "*" and "/" with a scalar, and by diff() and inte(). 向量和矩阵可以经营以“+”和“-”与向量和矩阵,以“*”和“/”与一个标量,和强烈的差别()和()。These operations are on each element, as in lists.这些操作都在每个元素,就像在列表。

You can use lists as vectors, adding them and multiplying them by scalars. 你可以使用,列出矢量,增加他们的多元化他们标量。For example, the dot product of two vectors of a and b is:例如,两个向量积的a、b是:

sum(a[j]*b[j], j from 1 to jmax)和一个[j]. * b[j],j从1到jmax)

You can even make this into a function:你甚至可以使这成为一个功能:

dottime(x_, y_) := listsum(x*y)dottime(x_,y_):= listsum(x性感)

e.g.例句。

represent the dot product of two vectors by arrays代表了两个向量的数量积的数组

IN:在: a[1]:=1, a[2]:=2一个[1]:= 1,一个[2]:= 2 # define array a#定义一个数组

IN:在: b[1]:=11, b[2]:=12b(1):= 11,b[2]:= 12 # define array b#定义数组b

IN:在: p:=0警:= 0

IN:在: do(p:=p + a[j]*b[j], j,1,2,1)(鲍西娅:= p +一个[j]. * b[j],j,第1、2、1) # a .#。* b* b

represent the dot product of two vectors by lists代表点两个向量的产品列表

IN:在: dottime([1,2], [11,12])dottime([1,2],[11、12]) # by lists in function dottime()通过列表功能dottime号()

How about the cross product:十字架如何产品:

cross(a,b) = [a[2]*b[3]-b[2]*a[3],a[3]*b[1]-b[3]*a[1],a[1]*b[2]-b[1]*a[2]]飞越(a,b)=[[2][3]-b b * *[2][3],一个[3]* b[1][3]-b *[1],一个[1][2]* b * -b[1][2]]

11.11分。 Statistics统计

Some statistical functions are:一些统计功能有:

average(x), max(x), min(x), listsum(x), length(x)平均(x)马克斯(x)、最小(x),listsum(x),长度(x)

A list of numbers can be calculation on statistics.一串数字的计算可以统计。

Example:例如:

IN:在: p := [1, 2, 3]警:=[1、2、3)

IN:在: average(p), max(p), min(p), length(p)平均水平(p),马克斯(p)、最小(p)、长度(p)

OUT: 2, 3, 1, 3出:2、3、1、3

Not only a list of number but also a list of symbolic data can be operated by some statistic functions to show how to do the statistic operation.不仅是一个列表的列表的号码,但也具有象征意义的数据可以操作的一些统计功能,说明统计操作。

IN:在: p := [a, b, c]警:=[a、b、c)

IN:在: average(p)平均(p)

OUT: 1/3*(a + b + c)出:1/3 * a + b + c)

IN:在: listsum(p)listsum(p)

OUT: a + b + c:一个+ b + c

IN:在: length(p)长度(p)

OUT: 3出:3

12.12。 Tables of Function Values表的函数值

If you want to look at a table of values for a formula, you can use the table command:如果你想看看表值的一种模式,你可以用桌子的命令:

table(f(x), x)表(f(x)、x)

table(f(x), x from xmin to xmax)表(f(x),从x xmin到xmax)

table(f(x), x from xmin to xmax step dx)表(f(x),从x xmin xmax一步,dx)

It causes a table of values for f(x) to be displayed with x=xmin, xmin+dx, ...它导致了一个价值表f(x),以显示x = xmin,xmin + dx,…, xmax.,xmax。 If xmin, xmax, and step omit, then xmin=-5, xmax=5, and dx=1 for default. 如果xmin,xmax,步骤省略,然后xmin = 5,xmax = 5,dx = 1为默认值。You can specify a function to be in table(),你可以指定一个功能表(),

Example:例如:

Make a table of x^2.做一张桌子,x ^ 2。

IN:在: table(x^2, x)表(x ^ 2、x)

OUT:出去。

-5,5, 2525

-4,4, 1616

-3,3, 99

-2,2, 44

: :

: :

Its output can be written into a disk file for interfacing with other software (e.g. the numeric computation software).其输出可以写进一个磁盘文件与其它的软件接口(如数值计算软件)。

13.13岁。 Conversion转换

Different types of data may be converted each other.不同类型的数据可以被转换彼此。

13.1.13.1。 Converting to Numbers转换到数字

The complex number is converted to the real number by复杂的号码是转化为实际数字

re(z), im(z), abs(z), arg(z), sign(z)稀土(z),我(z)、abs(z)、高温(z)、标志(z)

The real number is converted to the integer number by实际数字转换为整数数字

trunc(x)trunc(x)

round(x)圆(x)

The real number is converted to the rational number by实际数字转化为有理数

ratio(x)比(x)

The rational number is converted to the real number by有理数转化为实际数字

num(x)胡(x)

numeric:=on数字:=在

The rational number is converted to the integer number by有理数转换为整数数字

nume(x)nume(x)

deno(x)deno(x)

The string is converted to the real number if possible, by这个字符串转换为实际数字,如果可能

number("123")数字(“123”)

13.2.13.2。 Converting to Lists转换列出

You can convert sum to a list of terms by您可以转换和术语的列表

term(a+b)术语a + b)

IN:在: term(a+b)术语a + b)

OUT: [a, b]出:[a,b)

You can convert product to a list of multipliers by您可以转换产品名单乘数

mult(a*b)mult(* b)

IN:在: mult(a*b)mult(* b)

OUT: [a, b]出:[a,b)

You can convert an array x to a list by你可以转换成一个数组列表x

[ list(x[j], j,1,jmax,1) ][列表(x[j],j,1、jmax,1)

13.3.13.3。 Converting to Strings转换成串

You can convert numbers to strings by您可以转换数字字符串

string(123)字符串(123)

IN:在: string(123)字符串(123)

OUT: "123"出:“123”

13.4.13.4。 Converting to Table转换表

A list of real numbers can be converted to a table by真正的数字列表可以转化成一个表

table()表()

Example:例如:

IN:在: x := [5,4,3,2,1]谢:=[5、4、3、2、1]

IN:在: table(x[j], j from 1 to 4 step 1)表(x,j[j]. 1至4步骤1)

OUT:出去。

1,1, 55

2,2, 44

3,3, 33

4,4, 22

14.14。 Getting Parts of Expression获得部分的表达

14.1.14.1。 Getting Type of Data得到的数据类型

You can get type of data by你可以使用的一种数据类型

type(x)类型(x)

IN:在: type(2)类型(2)

OUT: "integer"出:“整数”

14.2.14.2。 Getting Operators获得运营商

You also can get operators by你也能得到运营商

type(x)类型(x)

IN:在: type(a>b)(a > b)型

OUT: ">"出:“>”

IN:在: type(sin(x))型(罪(x))

OUT: "sin()"出:“罪()”

14.3.14.3。 Getting Operands得到操作数

The functions功能

left(x=a), left(a > b)左(x =),左(一个> b)

right(x=a), right(a > b)正确的(x =),右(a > b)

pick up the left- and right- side of the equation and inequality.捡起左和右- - - - - - - - - - - -等式两边的和不平等现象。

IN:在: left(a>b), right(a>b)左(一个> b),右(> b)

OUT: a, b出:a、b

You can get the j-th term of sum by你能得到的j-th学期之

member(term(a+b), j)会员(术语a + b),j)

IN:在: member(term(a+b), 1)会员(术语a + b),1)

OUT: a:一个

You can get the arguments of a function by你可以得到���个函数的参数

argue(f(x))认为(f(x))

IN:在: argue(sin(x))认为(罪(x))

OUT: x出:x

14.4.14.4。 Getting Coefficients变系数

A coefficient of x^n in an expression can be picked up by系数x ^ n在一个表达式可以捡起

coef(p, x^n)系数(p、x ^ n)

e.g.例句。

IN:在: coef(a + b*x + c*x^2 + d*x^3, x)系数a + b * x + c * * ^ * x ^ 2 + d 3、x)

OUT: b指出:b

You can get a coefficient of x^n (where 0<= n < 4) in polynomials ordered up to 4 by你会得到一个系数x ^ n(其中0 < = n < 4)命令4个多项式

coef(poly, x,n)系数(聚,x,n)

(see Chapter Polynomials for detail).(见章节多项式细节)。

15.15。 Database数据库

After you create a database file as a library (external function), you can search your data by finding its function value.在你创建一个数据库文件作为一个图书馆(外部功能,您可以搜索您的数据通过找到它的功能价值。

15.1.15.1。 Phone Number电话号码

If you have created the database file "phoneNo.如果你创建了“phoneNo数据库文件。li" as follow:李”如下:

-------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

phoneno("huang") := "6974643"phoneno(“璜”):= " 6974643 "

phoneno("john")phoneno(“约翰”) := "12345":= " 12345 "

--------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

You can find out phone No. 你可以找到电话号码。of someone from the phone No. 从电话号码的人。database file "phoneNo.“phoneNo数据库文件。li" by the external function李”由外在功能

phoneno("name")phoneno(“名字”)

Example:例如:

find out phone No. 找到电话号码。of huang.黄的。

IN:在: phoneno("huang")phoneno(“黄”)

OUT: 6974643出:6974643

15.2.15.2。 Atomic Weight原子的重量

You can search atomic weight of chemical element from the database file "atom_wei.li".您可以搜索您的化学元素原子的重量从数据库文件”atom_wei.li”。

e.g.例句。

What is atomic weight of chemical element H ?什么是化学元素H原子的重量吗?

IN:在: atom_wei(H)atom_wei(H)

OUT: 1出:1 .

15.3.15.3。 Chemical Reaction化学反应

You can predict products for chemical reactions from the database file "react.li".你能预测产品从数据库文件的化学反应”react.li”。

Example 4.14.2.4.14.2例子。

What are the products when HCl + NaOH react ?什么是产品当盐酸+氢氧化钠反应?

IN:在: react(HCl+NaOH)反应(盐酸+氢氧化钠)

OUT: H2O + NaCl出:H2O +盐

16.16岁。 Learning from User学习从用户

One of the most important feature of SymbMath is its ability to deduce and expand its knowledge. 其中一个最重要的特征就是它能SymbMath演绎并扩大自己的知识。If you provide it with the necessary facts, SymbMath can solve many problems which were unable to be solved before. 如果你为其提供必要的事实,SymbMath可以解决许多问题无法解决过的。The followings are several ways in which SymbMath is able to learn from your input.以下几种方法,SymbMath是能够学习,从你的投入。

16.1.16.1。 Learning Integrals from a Derivative从学习积分衍生工具

Finding derivatives is much easier than finding integrals. 衍生工具是更加容易的找到比找到积分。Therefore, you can find the integrals of a function from the derivative of that function.因此,你可以在网上找到的一个函数的积分及衍生的功能。

If you provide the derivative of a known or unknown function, SymbMath can deduce the indefinite and definite integrals of that function. 如果你提供的衍生已知的或未知的功能,SymbMath就可以推断出不确定性和积分的功能,明确。If the function is not a simple function, you only need to provide the derivative of its simple function. 若功能并不是一个简单的函数,你只需要提供的衍生物,它简单的功能。For example, you want to evaluate the integral of f(a*x+b), you only need to provide f'(x).例如,你想要评价积分f(* x + b),你只需要提供f '(x)。

If you know a derivative of an function f(x) (where f(x) is a known or unknown function), SymbMath can learn the integrals of that function from its derivative.如果你知道一个衍生的一个函数f(x)(在f(x)是一个已知或未知函数),SymbMath能学会了那个函数的积分从它的衍生工具。

Example:例如:

check SymbMath whether or not it had already known integral of f(x)SymbMath检查是否已经知道积分的f(x)

IN:在: inte(f(x), x)希尔(f(x)、x)

OUT: inte(f(x), x)出:强烈的(f(x)、x)

IN:在: inte(f(x), x, 1, 2)希尔(f(x)、x、1,2)

OUT: inte(f(x), x, 1, 2)出:强烈的(f(x)、x、1,2)

As the output displayed only what was typed in the input without any computed results, imply that SymbMath has no knowledge of the indefinite and definite integrals of the functions in question. 作为输出显示稿子只有在输入没有任何的计算结果,暗示SymbMath没有知识的不确定性和明确的函数积分的问题。Now you teach SymbMath the derivative of f(x) on the first line, and then run the program again.现在你教SymbMath导数,f(x)在第一排,然后运行节目了。

IN:在: f'(x_) := exp(x)/xf '(x_):=经验/ x(x)

IN:在: inte(f(x), x)希尔(f(x)、x)

OUT: x*f(x) - e^x出:* * f(x)- e ^ x

IN:在: inte(f(x), x, 1, 2)希尔(f(x)、x、1,2)

OUT: e - f(1) + 2*f(2) - e^2出:e - f(1)+ 2 *外(2)- e ^ 2

As demonstrated, you only supplied the derivative of the function, and in exchange SymbMath logically deduced its integral.示范,你只供衍生的功能,并在交换SymbMath整体逻辑演绎。

Another example is另一个例子是

IN:在: f'(x_) := 1/sqrt(1-x^2)f '(x_):= 1 / sqrt(1-x ^ 2)

IN:在: inte(f(x), x)希尔(f(x)、x)

OUT: sqrt(1 - x^2) + x*f(x)出:sqrt(1 - x ^ 2)+ x * f(x)

IN:在: inte(k*f(a*x+b), x)希尔(k * f(* x + b),x)

OUT: k*(sqrt(1 - (b + a*x)^2) + (b + a*x)*f(b + a*x))/a出:阿k *(sqrt(1 -(b +一* x)^ 2)+(b +一* x)* f(b +一* x))

IN:在: inte(x*f(a*x^2+b), x)强烈的(x * f(x ^ * 2 + b),x)

OUT: sqrt(1-(a*x^2 + b)^2) + (a*x^2 + b)*f(a*x^2 + b)出:sqrt(1 -(* x ^ 2 + b)^ 2)+(* x ^ 2 + b)* f(x ^ * 2 + b)

The derivative of the function that you supplied can be another derivative or integral.导数,贵公司所提供的功能可以是另一个衍生著作或构成一个整体。

Example:例如:

IN:在: f'(x_) := eval(inte(cos(x),x))f '(x_):=:(交互(因为(x)、x))

OUT: f'(x_) := sin(x)出:f '(x_):=罪(x)

IN:在: inte(f(x), x)希尔(f(x)、x)

OUT: -sin(x)出:-sin(x)

IN:在: inte(f(a*x + b), x)希尔(f(* x + b),x)

OUT: -sin(b + a*x)/a出:-sin(b +一* x)/

IN:在: inte(x*f(x), x)强烈的(* * f(x)、x)

OUT: -cos(x) - x*sin(x)出:-cos(x)- x *罪(x)

IN:在: inte(x^1.5*f(x), x)强烈的(x ^ 1.5 * f(x)、x)

OUT: 1.5*inte(sqrt(x)*sin(x), x) - x^1.5*sin(x)出:1.5 *交互(sqrt(x)*罪(x)、x)- x ^ 1.5 *罪(x)

IN:在: inte(x^2*f(x), x)强烈的(x ^ 2 * f(x)、x)

OUT: -2*x*cos(x) + 2*sin(x) - x^2*sin(x)出:2 * * *因为(x)+ 2 *罪(x)- x ^ 2 *罪(x)

IN:在: inte(x*f(x^2), x)强烈的(* * f(x ^ 2)、x)

OUT: -sin(x^2)出:-sin(x ^ 2)

IN:在: inte(x^3*f(x^2), x)强烈的(x ^ 3 * f(x ^ 2)、x)

OUT: -0.5*cos(x^2) - 0.5*x^2*sin(x^2)出:-0.5 *因为(x ^ 2)- 0.5 * x ^ 2 *罪(x ^ 2)

IN:在: inte(f(x)/(x^1.5), x)希尔(f(x)/(x ^ 1.5)、x)

OUT: -2/sqrt(x)*f(x) + 2*inte(sin(x)/sqrt(x), x)出:2 / sqrt(x)* f(x)+ 2 *交互(罪(x)/ sqrt(x)、x)

IN:在: inte(f(x)/(x^2), x)希尔(f(x)/(x ^ 2)、x)

OUT: -f(x)/x + si(x)出:发送(x)/ x + si(x)

16.2.16.2。 Learning Complicated Integrals from a Simple Integral学习复杂的积分从一个简单的积分

You supply a simple indefinite integral, and in return, SymbMath will perform the related complicated integrals.你提供一个简单的不定积分,作为回报,SymbMath将履行相关的复杂积分。

Example:例如:

Check whether SymbMath has already known the following integrals or not.检查是否SymbMath已经知道下面的积分。

IN:在: inte(f(x), x)希尔(f(x)、x)

OUT: inte(f(x), x)出:强烈的(f(x)、x)

IN:在: inte((2*f(x)+x), x)希尔(2 * f(x)+ x)、x)

OUT: inte((2*f(x)+x), x)出:强烈的(2 * f(x)+ x)、x)

IN:在: inte(inte(f(x)+y), x), y)希尔(交互(f(x + y)、x、y)

OUT: inte(inte(f(x)+y), x), y)出:强烈的(交互(f(x + y)、x、y)

Supply, like in the previous examples, the information: integral of f(x) is f(x) - x; then ask the indefinite integral of 2*f(x)+x, and a double indefinite integral of 2*f(x) + x, and a double indefinite integral of respect to both x and y. Change the first line, and then run the program again.供应,跟过去的例子,信息:整体的f(x)是f(x)- x,然后问的不定积分2 * f(x)+ x,双不定积分的2 * f(x)+ x,对双不定积分两个x和y。改变第一线,然后运行节目了。

IN:在: inte(f(x_), x_) := f(x) - x希尔(f(x_),x_):= f(x)- x

IN:在: inte(2*f(x)+x, x)希尔(2 * f(x)+ x、x)

OUT: 2*f(x) - 2*x + 1/2*x^2出:2 * f(x)- 2 * x + 1/2 * x ^ 2

IN:在: inte(inte(f(x)+y, x), y)希尔(交互(f(x + y,x,y)

OUT: f(x)*y - x*y + x*y^2出:f(x)性感- x性感+ x性感^ 2

You can also ask SymbMath to perform the following integrals:你还可以请求SymbMath履行下列积分。

inte(inte(f(x)+y^2, x), y),希尔(交互(f(x + y ^ 2、x,y),

inte(inte(f(x)*y, x), y),希尔(交互(f(x)性感,x),y),

inte(x*f(x), x),强烈的(* * f(x)、x),

triple integral of f(x)-y+z, or others.三重积分的f(x)消息+ z和其他项目。

16.3.16.3。 Learning Definite Integral from Indefinite Integral学习从不定积分定积分

You continue to ask indefinite integral.你继续问不定积分。

IN:在: inte(inte(f(x)+y, x from 0 to 1), y from 0 to 2)希尔(交互(f(x + y,x从0到1),y从0到2)

OUT: 2 f(1)出:2 f(1)

16.4. Learning Complicated Derivatives from Simple Derivative16.4。学习复杂的衍生工具已从简单的衍生工具

SymbMath can learn complicated derivatives from a simple derivative, even though the function to be differentiated is an unknown function, instead of standard function.SymbMath可以学习复杂的衍生工具已从一个简单的衍生,虽然功能分化是一种未知函数,而不是标准功能。

Example :例如:

Differentiate f(x^2)^6, where f(x) is an unknown function.区分f(x ^ 2)^ 6,在f(x)是一个未知的功能。

IN:在: d(f(x^2)^6, x)d(f(x ^ 2)^ 6,x)

OUT: 12 x f(x^2)^5 f'(x^2)出:12倍f(x ^ 2)^ 5 f '(x ^ 2)

Output is only the part derivative. 输出只有部分衍生工具。f'(x^2) in the output suggest that you should teach SymbMath f'(x_). f '(x ^ 2)在输出建议你应该教SymbMath f '(x_)。e.g. the derivative of f(x) is another unknown function df(x), i.e. f'(x_) = df(x), assign f'(x_) with df(x) and run it again.例如导数,f(x)是另一个未知函数df(x),即f '(x_)= df(x),分配f '(x_)与df(x)并运行它了。

IN:在: f'(x_) := df(x)f '(x_):= df(x)

IN:在: d(f(x^2)^6, x)d(f(x ^ 2)^ 6,x)

OUT: 12 x f(x^2)^5 df(x^2)出:12倍f(x ^ 2)^ 5 df(x ^ 2)

This time you get the complete derivative.这回你得到完整的衍生工具。

16.5.16.5。 Learning Integration from Algebra学习代数一体化的

If you show SymbMath algebra, SymbMath can learn integrals from that algebra.如果你表现出SymbMath代数、SymbMath积分,可以学习代数。

Example :例如:

Input f(x)^2=1/2-1/2*cos(2*x), then ask for the integral of f(x)^2.输入f(x)^ 2 = 1/2-1/2 *因为(2 * x),然后请求积分的f(x)^ 2。

IN:在: f(x)^2 := 1/2-1/2*cos(2*x)f(x)^ 2 = 1/2-1/2 *因为(2 * x)

IN:在: inte(f(x)^2, x)希尔(f(x)^ 2、x)

OUT: 1/2 x - 1/4 sin(2 x)出:1/2 x - 1/4罪(2 x)

SymbMath is very flexible. SymbMath非常灵活。It learned to solve these problems, even though the types of problems are different, e.g. learning integrals from derivatives or algebra.学会解决这些问题,即使是不同类型的问题,例如学习积分或金融衍生代数。

16.6.16.6。 Learning Complicated Algebra from Simple Algebra从简单的代数学习复杂的代数

SymbMath has the ability to learn complicated algebra from simple algebra.SymbMath具有学习的能力,从简单的代数复杂的代数。

Example:例如:

Transform sin(x)/cos(x) into tan(x) in an expression.变换(x)/因为罪(x)成褐色(x)在一个表达式。

IN:在: sin(x)/cos(x) := tan(x)因为罪(x)/(x):=褐色(x)

IN:在: x+sin(x)/cos(x)+ax +罪(x)/因为(x)+一

OUT: a + x + tan(x):一个+ x +褐色(x)

16.7.16.7。 Learning vs. Programming学习与编程。

The difference between learning and programming is as follows: the learning process of SymbMath is very similar to the way human beings learn, and that is accomplished by knowing certain rule that can be applied to several problems. 学习和编程的区别如下:SymbMath的学习过程非常类似于人类学习的方式,那就是知道一定规律来完成,可以应用于几个问题。Programming is different in the way that the programmer have to accomplish many tasks before he can begin to solve a problem. 规划是不同的,必须完成许多任务程序员才能开始解决问题。First, the programmer defines many subroutines for the individual integrands (e.g. f(x), f(x)+y^2, 2*f(x)+x, x*f(x), etc.), and for individual integrals (e.g. the indefinite integral, definite integral, the indefinite double integrals, indefinite triple integrals, definite double integrals, definite triple integrals, etc.), second, write many lines of program for the individual subroutines, (i.e. to tell the computer how to calculate these integrals), third, load these subroutines, finally, call these subroutines. 首先,程序员定义为个人integrands许多子程序(如f(x),f(x + y ^ 2、2 * f(x)+ x、x * f(x)等),并为个人积分(如不定积分、定积分、不确定性双积分,长三重积分,确定双积分,明确的三重积分等),第二,写了许多行程序为个人子程序,(即告诉计算机如何计算这些积分),第三,负荷这些子程序,最后,称这些子程序。That is precisely what SymbMath do not ask you to do.那正是SymbMath不要求你去做的事。

In one word, programming means that programmers must provide step-by-step procedures telling the computer how to solve each problems. 一个字,编程意味着程序员们必须提供程序告诉计算机如何一步一步的来解决每一个问题。By contrast, learning means that you need only supply the necessary facts (usually one f'(x) and/or one integral of f(x)), SymbMath will determine how to go about solutions of many problems.相比之下,学习意味着你只需要提供必要的事实(通常是一个f '(x)和/或一个积分的f(x)),SymbMath决定怎样去解决许多问题。

If the learning is saved as a library, then you do not need to teach SymbMath again when you run SymbMath next time.学习被存储为一个图书馆,那么你不需要再教SymbMath当你运行SymbMath下次吧。


PART 2第二部分 Programmer's Guide程序员的指导

17.17岁。 Programming in SymbMath规划在SymbMath

SymbMath is an interpreter, and runs a SymbMath program in the Input window, which is written by any editor in the text (ASCII) file format.SymbMath是翻译,并运行一个SymbMath输入窗口的计划,这是任何编辑写的ASCII文本文件格式。

SymbMath language is a procedure language, which is executed from top to bottom in a program, like BASIC, FORTRAN, or PACSAL. SymbMath语言是一种程序语言,实行从上到下一个程序中,如基本、FORTRAN,或PACSAL。It also is an expression-oriented language and functional language.它也是一个expression-oriented语言和功能的语言。

The SymbMath program consists of a number of statements. 这SymbMath程序由一批报表。The most useful statement contains expressions, the expression includes data, and the most important data is functions.最有用的声明包含表达式,表达式包括数据,而且最重要的数据的功能。

The structure of SymbMath language is:SymbMath语言的结构是:

data -> expression -> statement -> program数据- - - - - - - > >表达陈述——>程序

Note that upper and lower case letters are different in SymbMath language, (e.g. abc is different from ABC) until the switch lowercase := on.注意,上部和小写字母不同语言SymbMath,(例如abc不同于abc)直到开关小写:=。

In the following examples, a line of "IN: " means input, which you type in the Input window, then leave the Input window by <Esc>, finally run the program by the command "Run"; while a line of "OUT:" means output. 在以下的例子,一行“:”是指输入,输入窗口类型,然后让输入窗口在< Esc >,最后由命令运行该程序“跑”;而行":"是指输出。You will see both input and output are displayed on two lines with beginning of "IN: " and "OUT: " in the Output window. 你将会看到两个输入和输出显示在两线开始“:”和“道:“在输出窗口。You should not type the word "IN: ". 你不应该类型单词“:”。Some outputs may be omit on the examples.一些输出可以省略的例子。

# is a comment statement.号是一个评论的声明。

You can split a line of command into multi-lines of command by the comma ,. 你可以将一条指令为命令multi-lines由逗号。The comma without any blank space must be the last character in the line.逗号没有任何空格必须在最后一个字就行了。

17.1.17.1。 Data Types数据类型

The data types in SymbMath language is the numbers, constants, variables, functions, equations, arrays, array index, lists, list index, and strings. 数据类型在SymbMath语言是数字,常数、变量、函数、方程、数组,数组,列表,列出指标和字符串。All data can be operated. 所有的数据可操作性强的设想。It is not necessary to declare data to be which type, as SymbMath can recognise it.这是没有必要申报数据是哪个类型,如SymbMath能够识别它。

17.1.1.17.1.1。 Numbers编号

The types of numbers are integer, rational, real (floating-point), and complex numbers in the range from -infinity to infinity.数字的整数的类型,理性的,真正的(浮点数),而复杂的数字范围从-infinity无限膨胀。

In fact, the range of the input real numbers is事实上,这个范围的输入实数

-inf, -(10^300)^(10^300) to -10^(-300), 0, 10^(-300) to (10^300)^(10^300), inf.-inf,(10 ^ 300)^(10 ^ 300)到-10 ^(-300)、0、10 ^(-300年)至(10 ^ 300)^(10 ^ 300),无穷大。

The range of the output real numbers is the same as input when the switch numeric := off, but when the switch numeric := on, it is范围的实数输出是一样的开关输入端时,流数值:=掉,但当开关数字:=,它是

-inf, -1.-inf(1)。E300 to -1.E300为1。E-300, 0, 1.E - 300,0,- 1。E-300 to 1.E - 300比1。E300, inf.E300,无穷大。

It means that the number larger than 1.那意味着数字大于1。e300 is converted automatically to inf, the absolute values of the number less than 1.e300自动转换为无穷大,数字的绝对值小于1。e-300 is converted to 0, and the number less than -1e300 is converted to -inf.e - 300是转化为0,而且这个数目小于1 e300转化为-inf。

For examples:例如:

-------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Numbers编号 Type类型

2323 integer整数

2/32/3 rational理性

0.230.23 real真正

2.3E22.3 E2 real真正

2+3*i2 + 3 *我 complex复杂

2.3+i2.3 +我 complex复杂

---------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

That "a" and "b" are the same means a-b = 0, while that they are different means a-b <> 0.“a”和“b”意味着couple一样= 0,而他们是不同的手段故< > 0。

For the real numbers, the upper and lower case letters E and e in exponent are the same, e.g. 1e2 is the same as 1E2.因为真实的编号,上部大、小写字母E和E指数都是相同的,例如1 e2 1 e2是一样的。

17.1.2.17.1.2。 Constants常数

The constants are the unchangeable values. 一个自然常数是不变的价值观。There are some built-in constants. 有一些内置的常量。The name of these built-in constants should be avoided in the user-defined constants.这些内置常数的名字应该避免在用户定义的常量。

------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Built-in Constants内置常数 Meanings意义

pi:=3.1415926536农夫:= 3.1415926536 the circular constant.圆形的常数。

e:=2.7182818285艾凡:= 2.7182818285 the base of the natural logarithms.基地的自然对数。

i:=sqrt(-1)我:= sqrt(1) the imaginary sign of complex numbers.想象复杂的标志数字。

infinf infinity.无限。

-inf-inf negative infinity.负无限。

c_infc_inf complex infinity, both real and imaginary parts无限复杂,无论是真实和想象的部分

of complex numbers are infinity. 复杂的数字是无限。e.g. inf+inf*i.如步+ inf *我。

constant不断 the integral constant.积分常数。

discontdiscont discontinuity, e.g. 1/0. 不连续性、例句。1/0。(You can evaluate the one-sided value(你可以评估片面的价值 by x=x0+zero or x0-zero if the value of expression is discont).x = x0 +零或x0-zero的价值表现为discont)。

x0-zerox0-zero to evaluate left-sided value when x approach x0左值评价方法x0当x

from negative (-inf) direction, as zero -> 0.从负(-inf)的方向,因为零- > 0。

x0+zerox0 +零 to evaluate right-sided value when x approach x0价值评价方法x0右侧x

from positive (+inf) direction, as zero -> 0.从正(+ inf)的方向,因为零- > 0。

undefined未定义 the undefined value, e.g. indeterminate forms:无形价值,如不确定的形式。

0/0, inf/inf, 0*inf, 0^0, etc.0/0,步/无穷大,0 *步,0 ^ 0等)。

--------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Zero is the positive-directed 0, as the built-in constant. 零是positive-directed 0,内置的常数。f(x0+zero) is the right-hand sided function value when x approaches to x0 from the positive direction, i.e. x = x0+. f(x0 + 0)是右边站函数值的方法从当x x0正方向,即x = x0 +。f(x0-zero) is the left-sided function value when x approaches to x0 from the negative direction, i.e. x = x0-. f(x0-zero)是左功能价值当x方法从反方向x0,即x = x0 -。e.g. f(1+zero) is the right-hand sided function value when x approaches to 1 from the positive (+infinity) direction, i.e. x = 1+, f(1-zero) is the left-hand sided function value when x approaches to 1 from the negative (-infinity) direction, i.e. x = 1-; exp(1/(0+zero)) gives inf, exp(1/(0-zero)) gives 0.如f(1 + 0)是右边站函数值x的方法时,从积极的1(+无限)方向,即x = 1 + f(1-zero)是左手面函数值x的方法时一号从负(-infinity)方向,即x = 1 -;实验(1 /(0 + 0)给步、exp(1 /(0-zero)给0。

The inf, discont and undefined can be computed as if numbers.这步,就可以计算和未定义discont好像编号。

Example:例如:

IN:在: inf+2, discont+2, undefined+2步+ 2,discont + 2,+ 2定义

OUT: inf, discont, undefined出:无穷大,discont、不可解释的

Notice that the discont and undefined constants are different. 注意到discont和未定义常量是不同的。If the value of an expression at x=x0 is discont, the expression only has the one-sided value at x=x0 and this one-sided value is evaluated by x=x0+zero or x=x0-zero. 一个表达式的值是否在x = x0是discont,表达的只有片面的价值在x = x0片面的价值,这是评估x = x0 +零或x = x0-zero。If the value of an expression at x=x0 is undefined, the expression may be evaluated by the function lim().一个表达式的值是否在x = x0是未定义的,表达可能是由评价函数小林()。

Example: evaluate exp(1/x) and sin(x)/x at x=0.例如:评估经验(1 / x)和赎罪(x)/ x在x = 0。

IN:在: f(x_) := exp(1/x)f(x_):=经验(1 / x)

OUT: f(x_) := exp(1/x)出:f(x_):=经验(1 / x)

IN:在: f(0)f(0)

OUT: discont出:discont # f(0) is discontinuity, only has one sided value# f(0)是不连续的,只有单方面的价值

IN:在: f(0+zero)f(0 + 0) # right-sided value#右值

OUT: inf出:步

IN:在: f(0-zero)f(0-zero) # left-sided value#左值

OUT: 0出:0

IN:在: subs(sin(x)/x, x = 0)替补(罪(x)、x / x = 0)

OUT: undefined出:未定义

IN:在: lim(sin(x)/x, x = 0)小林(罪(x)、x / x = 0) # it is evaluated by lim()它是由评价# l()

OUT: 1出:1 .

17.1.3.17.1.3。 Variables变量

The sequence of characters is used as the name of variables. 这一连串的字符被用来作为变量的名字。Variable names can be up to 128 characters long. 变量名称可达到128个字符长。They must begin with a letter and use only letters and digits.他们必须以字母开头字母和字母和数字仅使用。 SymbMath knows upper and lower case distinctions in variable names, so AB, ab, Ab and aB are the different variables. SymbMath知道上部和下部情况区别,在变量名,所以AB、AB、AB和AB型都是不同的变量。They are case sensitive until the switch lowercase is set to on (i.e. lowercase := on).他们都是大小写敏感的,直到将开关小写(即小写:=。

Variables can be used to store the results of calculations. 变量可以用来存储结果的计算。Once a variable is defined, it can be used in another formula. 一旦一个变量的定义是,它可以用来在另一个公式。Having defined X as above, you could define Y := ASIN(X). 有确定的X以上,你可以定义杨:= ASIN(X)。You can also redefine a variable by storing a new value in it.你也能重新定义一个变量通过保存一个新值。 If you do this, you will lose the original value entirely.如果你这样做,你将丢失完全的原有价值。

Assign a result to a variable, just put给一个变量分配结果,就把

<var-name> :=< var-name >:= expression表达

e.g.例句。 x := 2 + 3谢:= 2 + 3 # assign value to x#分配价值x

Variables can be used like constants in expressions.变量可以当作常数表达式。

For example:例如:

a := 2 + 3答:= 2 + 3

b := a*4乙:= * 4

If an undefined variable is used in an expression, then the expression returns a symbolic result (which may be stored in another variable).如果一个未定义的变量是用于一个表达式,然后返回一个象征性表达结果(它可以被存储在另一个变量)。 Pick an undefined variable name, say x, and enter:选择一个未定义的变量的名字时,请说x,进入:

y := 3 + x杨:= 3 + x # formula results since x undefined结果自#公式x未定义的

x := 4谢:= 4 # Now x is defined现在x是#定义

yy # y returns 7, but its value is still the formula 3 + x7 # y回报,但其价值仍然是3 + x的公式

x := 7谢:= 7 # revalue x#人民币升值x

yy # new value for y#新价值y

Note that in symbolic computation, the variable has not only a numeric value but also a symbolic value.值得注意的是,在符号计算,变不仅数值也是一种象征性的价值。

Symbolic values for variables are useful mostly for viewing the definitions of functions and symbolic differentiation and integration.象征价值是有用的大多为变量的定义和浏览功能分化和整合。象征

Watch out for infinite recursion here.小心无穷递归在这里。 Defining定义

x := x+3谢:= x + 3

when x has no initial value, it will not cause an immediate problem, but any future reference to x当x没有初始值,它不会立即产生一个问题,但是未来的参考x will result in an infinite recursion !将导致一个无穷递归!

A value can be assigned to the variable, by one of three methods:一个值可以被指定给变量,通过三种方法:

(1) the assignment :=,(1)作业:=,

(2) the user-defined function f(),(2)用户自定义函数f(),

(3) subs(y, x = x0).(3)替补(y,x = x0)。

e.g.例句。

y:=x^2杨:= x ^ 2

x:=2谢:= 2 # assignment#作业

yy

f(2)外(2) # if f(x) has been defined, e.g. f(x_):=x^2.#如果f(x)已被定义,如f(x_):= x ^ 2。

subs(x^2, x = 2)替补(x ^ 2、x = 2) # evaluate x^2 when x = 2.评估x ^ 2 #当x = 2。

The variable named last is the built-in as the variable last is always automatically assigned the value of the last output result.最后的变量称为内置当作变量最后总是会自动设置的价值,最后输出结果。

The usual used independent variable is x.通常使用独立变量是x。

By default, |x| < inf and all variables are complex, except that variables in inequalities are real, as usual only real numbers can be compared. 默认情况下,| | < inf和x��量是复杂的,除了变量不等式是很实际的,像往常一样唯一真正的编号可比的。e.g. x is complex in sin(x), but y is real in y > 1.如x是复杂的罪(x),但y是真实的y > 1。

You can restrict the domain of a variable by assuming the variable is even, odd, integer, real number, positive or negative (see Chapter Simplification and Assumption).你可以限制一个变量的领域通过假设变量为均匀,奇怪,整数,实数、正面或负面的(请看简化与假设章)。

17.1.4.17.1.4。 Patterns模式

Patterns stand for classes of expressions.站在课程模式的表情。

__ any expression.任何表达式。

x_x_ any expression, given the name x.任何表达式,给出了名字x。

Patterns should appear on the left-hand side of the assignment only, not on the right-hand side of the assignment. 模式应该出现在左手边的任务仅仅,不是右侧的任务。Patterns are only used in definition of functions, procedures and rules.只用于定义模式的功能、程序和规则。

Patterns are used to define functions and rules for pattern match.模式用于定义功能和模式匹配规则。

17.1.5.17.1.5。 Functions, Procedures and Rules功能、程序和规则

These are two types of functions: internal and external. 这些是两种类型的功能:内部和外部的。The internal function is compiled into the SymbMath system. 内部功能是编译成SymbMath系统。The external function is the library written in SymbMath language, which is automatically loaded when it is needed. 外部功能是图书馆SymbMath语言写的,必要时自动加载。(See Chapter Library and Package). (见章节图书馆和包装)。The usage of both types are the same. 使用两种类型是相同的。You can change the property or name of the external function by modifying its library file, or you add a new external function by creating its library file, but you cannot change the internal function.你能改变自己的财产或名称的外部功能通过修改库文件,或者你添加一个新的外部功能的创造出自己的库文件,但是你不能改变内部功能。

17.1.5.1.17.1.5.1。 Standard Mathematical Functions标准数学函数

Different versions of SymbMath have different number of standard mathematical functions. 不同版本的SymbMath有不同数量的标准数学函数。The Advanced Version C has all of them. 新版本的C具有他们所有的人。See the following table in detail for other versions. 看下面的表格的详细其他版本。All below standard functions, (except for random(x), n!所有低于标准功能,(除了随机(x)、n !, fac(n) and atan2(x,y)), can be differentiated and integrated symbolically.,前沿空中管制官(n)和atan2(x,y),可以分化和综合象征性地。


Table 17.1.5.1表17.1.5.1 Standard Mathematical Functions标准数学函数

------------------------------------------------------------------------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Functions功能 Meanings意义

random(x)随机(x) generate a random number.产生一个随机数。

n!护士! factorial of n.n阶乘矩。

fac(n)前沿空中管制官(n) the same as n!.一样的n。

sqrt(x)sqrt(x) square root, the same as x^0.5.平方根,与x ^ 0.5。

root(x,n)根(x,n) all n'th root of x.所有的'th根氮x。

exp(x)实验(x) the same as e^x.同e ^ x。

sign(x)签署(x) 1 when re(x) > 0, or both re(x) = 0 and im(x) > 0; 0 whenx=0;当你(x)> 0,或者两者都是(x)= 0的时候,我(x)> 0;0 whenx = 0;

-1 otherwise.1不然。

abs(x)abs(x) absolute value of x.绝对值x。

ln(x)淋巴结(x) natural logarithmic function of x, based on e.自然对数函数x,基于e。

log10(x)t(x)

sin(x)罪(x) sine function of x.正弦函数x。

cos(x)因为(x)

............................... above functions in Shareware Version A ...............以上的功能在一个............... Shareware版本

tan(x)褐色(x)

csc(x)csc(x)

sec(x)秒(x)

cot(x)cot(x)

asin(x)asin(x) arc sine function of x, the inverse of sin(x).电弧x的正弦函数,推导了罪(x)。

acos(x)函数(x)

atan(x)atan(x)

acot(x)acot(x)

asec(x)了一类正则(x)

acsc(x)研究会(x)

atan2(x,y)atan2(x,y)

............................. .............................above functions in Student Version B .................以上的功能.................学生版本B

sinh(x)sinh(x) hyperbolic sine function of x.双曲正弦函数x。

cosh(x)事业(x)

tanh(x)tanh(x)

csch(x)csch(x)

sech(x)sech(x)

coth(x)coth(x)

asinh(x)作用(x) arc hyperbolic sine function of x, the inverse of sinh(x).电弧双曲正弦函数x,反过来的sinh(x)。

acosh(x)函数(x)

atanh(x)函数(x)

acoth(x)acoth(x)

asech(x)asech(x)

acsch(x)acsch(x)

--------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

17.1.5.2.17.1.5.2。 Calculus Functions微积分功能

Calculus functions are for calculus calculation. 微积分法计算功能。The first argument of the function is for evaluation, and the second argument is a variable that is with respect to.第一个参数是评价中的作用,第二个参数是一个变量,以尊重。

Table 17.1.5.2表17.1.5.2 Calculus Functions微积分功能

--------------------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Functions功能 Meanings意义

subs(y, x = x0)替补(y,x = x0) evaluates y when x = x0.当x = x0 y评价。

lim(y, x = x0)小林(y,x = x0) gives the limit of y when x approaches x0. 给出了极限当x方法x0 y。Note that the correct answers注意正确的答案 usually for the indeterminate forms: 0/0, inf/inf, 0*inf, 0^0, inf^0.通常为不确定的形式:0/0,步/无穷大,0 *步,0 ^ 0,inf ^ 0。

d(y, x)d(y,x) differentiate y with respect to x.区分y就x。

d(y, x, order)d(x,y,顺序) gives the nth order derivative of y with respect to an undefined variable x.给出了第n次阶导数的y就一个未定义的变量x。

d(y)d(y) implicit differentiation.隐含的分化。

inte(y, x)希尔(y,x) find the indefinite integral of y with respect to an undefined variable x.找到的不定积分y就一个未定义的变量x。

inte(y,x,a,b)希尔(y,x,a,b) find the definite integral of y with respect to an undefined variable x taken找到了定积分的y就一个未定义的变量x缠住了 from x=a to x=b.从x =一个x = b。

inte(y,x,a,b,c)希尔(y,x,a,b,c) find the definite integral of y with respect to an undefined variable x taken找到了定积分的y就一个未定义的变量x缠住了 from x=a to x=b, then to x=c, where b is singularity.从x =一个x = b,然后对x = c,在b是奇异点。

inte(y, x from a to b)希尔(y,x从a到b) the same as inte(y,x,a,b).强烈的一样(y,x,a,b)。

inte(y)交互(y) implicit integration, used to integrate the differential equations.隐式集成,用来整合微分方程组。

dsolve(y'(x)=f(x,y), y(x), x)dsolve(y”(x)= f(x,y),y(x)、x) solve differential equations.求解微分方程。

sum(y, x from xmin to xmax)和(y,从x xmin到xmax) sum of y step=1.笔y = 1步。

sum(y, x from xmin to xmax step dx)和(y,从x xmin xmax一步,dx) sum of y.笔y。

prod(y, x from xmin to xmax)促进(y,从x xmin到xmax) product of y step=1.y一步产品= 1。

prod(y, x from xmin to xmax step dx)促进(y,从x xmin xmax一步,dx) product of y.产品的y。

----------------------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

If a second argument x is omitted in the functions d(y) and inte(y), they are implicit derivatives and integrals. 如果x是省略了第二个参数的功能d(y)和希尔(y),他们是隐含的金融衍生品和积分。If f(x) is undefined, d(f(x), x) is differentiation of f(x). 如果f(x)是未定义的,d(f(x)、x)是分化的f(x)。These are useful in the differential and integral equations. 这些都是有用的在微分形式和积分方程。(see later chapters).(见后面的章节)。

For examples:例如:

inte(inte(F,x), y) is double integral of F with respect to both variables x and y.希尔(交互(F,x,y)是二重积分的两个变量F对x和y。

d(d(y,x),t) is the mixed derivative of y with respect to x and t.d(d(y,x),t)是混合的衍生物x和y就t。

The keywords "from" "to" "step" "," are the same as separators in multi-argument functions. 关键字“从”、“至”“步”、“同分离器在multi-argument功能。e.g. inte(f(x), x, 0, 1) are the same as inte(f(x), x from 0 to 1).例如交互(f(x)、x,0,1)是一样的交互(f(x)、x从0到1)。

Examples:例子:

--------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

differentiation分化 d()d() d(x^2,x)d(x ^ 2、x)

integration整合 inte()交互() inte(x^2,x)强烈的(x ^ 2、x)

limit限制 lim()小林() lim(sin(x)/x, x = 0)小林(罪(x)、x / x = 0)

---------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

17.1.5.3.17.1.5.3。 Test Functions测试函数

Table 17.1.5.3.1表17.1.5.3.1 The is*(x) Functions这是*(x)功能

---------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Function功能 Meaning意义

isodd(x)isodd(x) test if x is an odd number.测试如果x是奇数。

iseven(x)iseven(x) test if x is an even number.如果x是测试一个偶数。

isinteger(x)isinteger(x) test if x is an integer number.测试如果x是一个整数。

isratio(x)isratio(x) test if x is a rational number.如果x是一种合理的测试号码。

isreal(x)(x)来 test if x is a real number.如果x是一个真正测试号码。

iscomplex(x)iscomplex(x) test if x is a complex number.如果x是一种复杂的测试号码。

isnumber(x)isnumber(x) test if x is a number.如果x是测试一个数字。

islist(x)islist(x) test if x is a list.如果x是测试一个列表。

isfree(y,x)isfree(y,x) test if y is free of x.测试如果y是免费的x。

issame(a,b)issame(a,b) test if a is the same as b.测试是否有相同的b。

islarger(a,b)islarger(a,b) test if a is larger than b.测试是否有高于b。

isless(a,b)isless(a,b) test if a is less than b.测试是否有少于b。

----------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

All of the is* functions give either 1 if it is true or 0 otherwise.所有的是*功能给他们任何一方如果它是真实的或0聪明。

The type(x) gives the type of x. Its value is a string.类型(x)给出了x型。它的值是一个字符串。


Table 17.1.5.3.2表17.1.5.3.2 The type(x) functions功能类型(x)

--------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

xx type(x)类型(x)

11 integer整数

1.11.1 real真正

2/32/3 ratio

1+i1 +我 complex复杂

sin(x)罪(x) sin()罪()

[1,2][1,2] []

a一个 symbol象征

"a"“a” string字符串

a+b+ b ++

a*b一个* b *

a^b一个^ b ^

a=b一个= b ==

a==b一个= = b === =

a>b一个> b >

a>=b一个> = b >=> =

a<b一个< b <

a<=b一个< = b <=< =

a<>b一个< > b <>

a,ba、b ,

---------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

You also can test x, e.g. if x is type of real number, by你也可以测试x,如果x是类型的实数、

type(x)=="real"式(x)= = "真正的"

17.1.5.4.17.1.5.4。 Miscellaneous Functions功能项目

Table 17.1.5.4.1表17.1.5.4.1 Algebra Functions代数函数

---------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

expand(F)扩大(F) expand (a+b)^2 to a^2 + 2*a*b + b^2.扩大a + b)2 ^ ^ 2 + 2,* * ^ 2 b + b。

factor(F)因子(F) factorise a^2 + 2*a*b + b^2 to (a+b)^2.一个factorise ^ 2 + 2 b + b * * ^ 2 a + b)^ 2。

solve(f(x)=0, x)解决(f(x)= 0,x) solve polynomial and systems of linear equations求解多项式和系统的线性方程组

---------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Note: the Shareware Version has not solve().注:该Shareware版本还没有解决()。

For example:例如:

------------------------------------------------------------------------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

solving解决 solve()解决() solve(x^2+1 = 0, x)解决(x ^ 2 + 1 = 0,x)

expanding扩大 expand()扩大() expand((a+b)^2)扩大(a + b)^ 2)

factoring保理 factor()因子() factor(a*c+b*c)因子(a * c + b * c)

----------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Conversion functions convert a type of data to another type of data.转换函数转换一种类型的数据,另一种类型的数据。

Table 17.1.5.4.2表17.1.5.4.2 Conversion Functions转换功能

---------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

listsum([a,b])listsum([a、b]) convert list to sum.转换表的数目。

coef(expr, x^2)系数(expr、x ^ 2) gives the coefficient of x^2 in expr.给出了x ^ 2系数expr。

left(x^2=b)左(x ^ 2 = b) left hand side of an equation.左手边的一个等式。

right(x^2=b)正确的(x ^ 2 = b) right hand side of an equation.右手边的一个等式。

re(x)稀土(x) real part of complex numbers.真正的一部分。复数

im(x)我(x) imaginative part of complex numbers.想象力的一部分复数。

num(x)胡(x) convert x to the floating-point number.转换x的浮点数。

ratio(x)比(x) convert x to the rational number.转换x理性号码。

round(x)圆(x) convert x to the rounded integer.转换x形圆整数。

trunc(x)trunc(x) convert x to the truncated integer.转换x的截断整数。

----------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Table 17.1.5.4.3表17.1.5.4.3 The List and Table Functions这张清单,表功能

-------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

list(f(x), x from xmin to xmax step dx)列表(f(x),从x xmin xmax一步,dx) lists of f(x).名单的f(x)。

table(f(x), x from xmin to xmax step dx)表(f(x),从x xmin xmax一步,dx) data table of function values.数据表的功能价值。

--------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Above functions can be operated and chained, like the standard functions.以上功能操作和锁住,标准一样的功能。

17.1.5.5.17.1.5.5。 User-defined Functions用户自定义函数的

You can define the new functions, which include the standard functions, calculus functions, and algebraic operators.你可以定义的新功能,包括标准功能,微积分功能,代数运算符。

Define a new function f(x) by定义一个新的函数f(x)

f(x_) := x^2f(x_):= x ^ 2

and then call f(x) as the standard functions. 就叫f(x)为标准的功能。The function name can be any name, except for some keywords. 函数的名称可以是任何名字,除了一些关键词。(for the maximum number of arguments, see Chapter(最大数目的参数,看一章 System Limits).系统限制)。

Clears a variable or function from assignment by清除变量或函数从分配

clear(x)清晰的(x) # clear x from assignment.明确的任务。从x号

clear(f(x))清楚(f(x)) # clear f(x) from assignment.#清楚f(x)从任务。

clear(a>0)清楚(> 0) # clear a>0 from assignment.从一个> 0 #明确的任务。

Variables can be used in function definitions. 变量可以用在函数定义。It leads to an important difference between functions and variables.这导致一个非常重要的区别函数和变量。 When a variable is defined, all terms of the definition are evaluated.当一个变量的定义是,所有的术语的定义进行了评估。 When a function is defined, its terms are not evaluated; they are evaluated when the function is evaluated. 当一个函数的定义,其条件没有评价;他们正在评估当函数进行了评价。That means that if a component of the function definition is changed, that change will be reflected the next time the function is evaluated.这意味着如果一个组件的功能定义也发生了变化,这变化可反映下次功能进行了评价。

17.1.5.6.17.1.5.6。 Procedures程序

A procedure is similar to a function, but the right side of assignment in its definition is multi statements grouped by block(). 一个程序类似作用,但右侧作业多报表它的定义是按区块()。The block(a,b,c) groups a,b,c and only returns the last argument as its value, or returns the second last argument as its value if the last argument is local(). 块(a,b,c)集团a、b、c和只返回最后一个参数为价值,或者返回倒数第二个参数为价值如果最后的论点是当地()。It is used as grouper in definition of a procedure. 作为一个程序的定义上。All variables in block are global, except for variables declared by local().所有变量的块都是全球性的,除了变量声明当地()。

e.g. f(x_):=block(p:=x^6,p,local(p))如f(x_):=区块(p = x ^:6、磷、当地(p))

Remember that you can split a line of program into multi-lines program at comma ,.记住,你可以将一行程序程序multi-lines逗号。

17.1.5.7.17.1.5.7。 Rules规则

A rule is similar to a function. 一条规则是类似的功能。In definition of function, all arguments of function are simple variables, but in definition of rules, the first argument may be a complicated expression.在定义的功能,都是简单的变量参数的功能,但在定义的规则,第一个观点是一个复杂的表达式。

e.g.例句。

f(x_,y_) := x^2+y^2f(x_,y_):= x + y ^ 2 ^ 2 # defining function#定义功能

f(x_,y_) := block(a:=2, a+x^2+y)f(x_,y_):=区块(答:= 2,一个+ x ^ 2 + y) # defining procedure#定义程序

log(x_ * y_) := log(x)+ log(y)日志(x_ * y_):=日志(x)+日志(y) # defining rule#定义规则

17.1.6.17.1.6。 Equations方程

An equation is an equality of two sides linked by an equation sign =, e.g. x^2+p = 0, where the symbol = stands for an equation. 一个方程是一个平等两面相连方程签署=,例如x ^ 2 + p = 0,那里的符号=代表一个等式。Note that the symbols "=", "==" and ":=" are different: ":=" is the assignment, "==" is the equal sign, but "=" is the equation sign.注意符号“=”、“= = "和":= "是不同的:“:= "是你的任务,”= = "就是平等的标志,但“=”是方程标志。

Example:例如:

IN:在: 2 = 22 = 2

OUT: 2 = 2出:2 = 2 # unevaluated# unevaluated

IN:在: 2 == 22 = = 2

OUT: 1出:1 . # evaluated to 1 (true)1 #评估(正确的)

Systems of equations are a list of equations, e.g.方程系统是一个方程中,举例说明。

[a1*x+a2*y=a3, b1*x+b2*y=b3].[a1 a2 * * x + y = a3,b1 * x + y = b3 b2 *]。

17.1.7.17.1.7。 Inequalities不等式

e.g.例句。

a < b一个< b less than少于

a <= b一个< = b less than or equal to小于或等于一

a > b一个> b greater than大于

a >= b一个> = b greater than or equal to大于或等于

a == b一个= = b equal to等于

a <> b一个< > b not equals不等于

17.1.8.17.1.8。 Vectors or Lists向量或列出

Lists are similar to lists in such language as PROLOG.列出清单类似这样PROLOG语言。

[a, b, c] is a list.[a、b、c)是一个列表。

[a, b, [c1, c2]] is a list of lists.[a,b,(c1,c2]]是一个列表的列表。

The list index is the index for n-th element in a list. 名单上的指标指数的形式元素在一个列表。e.g. b[2] indicates the second element in the list b.如b[2]表明第二元素在表b。

The built-in list index is last[number]. 内置的列表索引是最后一次(数值)。The name of last output list is last, e.g. last[1] is the first element in the last output list.最后输出的名字列表上,例如去年[1]是第一个元素在最后输出名单。

17.1.9.17.1.9。 Matrices or Arrays矩阵或数组

Arrays are the same as those in such language as PASCAL and FORTRAN. 数组是一样在这样的语言,就像帕斯卡,FORTRAN语言。But you can use arrays without declaring arrays, unlike in PASCAL and FORTRAN.但你可以使用数组没有宣布数组,不像帕斯卡,FORTRAN语言。

e.g.例句。

a[1]:=1一个[1]:= 1

a[2]:=4一个[2]:= 4

The array index is the index for n-th element in an array. 数组的索引数组中的元素的形式。e.g. a[2] indicates the second element in the array a.例如一个[2]表示数组的第二个因素。

17.1.10.17.1.10。 Strings字符串

A string is a sequence of characters between two quotation marks. 一个字符串是一连串的字符在两个引号。e.g. 例句。"1234567890". “1234567890”。Note that 1234 is number but "1234" is string. 注意,1234号码,但“1234”,是字符串。The number can be calculated and only has 11 of max digits, while string cannot be calculated and has 64000 of max characters long.能计算和数量只有11 max位数,而不能计算字符串有64000个马克斯字符渴望。

Note that the output of strings in SymbMath is without two quotation marks. 需要注意的是,在SymbMath输出串无两个引号。This makes text output to graph and database more readable.这使得文本输出图和数据库更易读。

Strings can be stored in variables, concatenated, broken, lengthen, and converted to numbers if possible.字符串可以被存储在变量、接、破碎、加长,并转换为数字,如果可能的话。

e.g.例句。

IN:在: p := "abc"警:=“abc” # "abc" is stored in variable p“abc”号被储存在可变p

OUT: p := abc出:p:= abc

IN:在: concat("s","t")concat(“s”,“t”) # concatenate "s" and "t"#连结" s "和" t "

OUT: st出:圣

IN:在: length("abc")长度(“abc”) # count length of "abc"#计数长度的“abc”

OUT: 3出:3

IN:在: number("123")数字(“123”) # convert string "123" into number 123转换串号“123”到123号

OUT: 123出:123

IN:在: type(a), type("a")(a)型、类型(“a”)

OUT: symbol, string出:符号,字符串

17.2.17.2。 Expressions表达式

The expressions (i.e. expr) are made up of operators and operands. 表达式(即expr)是由运算符和操作数。Most operator are binary, that is, they take two operands; the rest are unitary and take only one operand. 大多数经营者都是二进制的,也就是说,他们把两个操作数,其他的都是统一的,只带一个操作数。Binary operators use the usual algebraic form, e.g. a+b.二元操作符通常的代数形式使用,如+ b。

There are two kinds of expressions: numeric and Boolean. 有两种表现:数字和布尔。The numeric expression is combination of data and algebraic operators while the Boolean expression is combination of data and relational operators and logic operators. 这个数字表达相结合的数据和代数算子组合在布尔表达式的数据和关系运算符和逻辑运算符。These two kinds of expressions can be mixed, but the numeric expression has higher priority than Boolean operators. 这两种表达式是可以混合,但数字表示有更高优先级的布尔运算符。x*(x>0) is different from x*x>0. * *(x > 0)不同于* * x > 0。x*x>0 is the same as (x*x)>0.* * x > 0是一样的(x * x)> 0。

e.g.例句。

a+b+3+ b + 3 numeric expression,数字表达,

a>0一个> 0 Boolean expression布尔表达式

a>0 and b>0一个> 0和b > 0 Boolean expression布尔表达式

(x>0)*x(x > 0)* x mixed numeric and Boolean expression混合的数字和布尔表达式

17.2.1.17.2.1。 Operators运营商

Table 17.2.1表17.2.1 Operators运营商

--------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Operation操作 Operators运营商 Examples实例 Order秩序

comma逗号 , a:=2, b:=3答:= 2。b:= 3 11

assignment作业 :=:= p:=2+3警:= 2 + 3 22

and and a>2 and a<8一个>和< 8 2 22

or or a>2 or b>2一个> 2或b > 2 22

equation方程 == x^2+x+1 = 0x ^ 2 + x + 1 = 0 33

equal平等 === = a==2一个= = 2 33

larger than大于 > a>2一个> 2 33

larger and equal更大的平等>=> = a>=2一个> = 2 33

less than少于 < a<2一个< 2 33

less and equal越来越平等 <=< = a<=2一个< = 2 33

unequal不平等 <> a<>2一个< > 2 33

plus加上 ++ a+b+ b 44

minus减去 -- a-bcouple 44

mutilation损毁 * a*b一个* b 55

division分工 / a/ba / b 55

power权力 ^ a^b一个^ b 66

power权力 ** a**b一个* * b 66

factorial阶乘 ! n!护士! 66

positive积极 ++ +a+一 77

negative负面 -- -a- 77

function功能 f()f() sin(x)罪(x) 77

list index列表索引 f[]f[] f[1]f[1] 77

parentheses括号 () (a+b)*c(a + b)度) 77

list列表 [] [a,b](a,b) 77

------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

All functions have the same 7th order.所有功能有相同的7th秩序。

Operations with higher order precede, otherwise operations with equal precedence are performed from left to right.高阶前作业,否则相同优先级业务执行从左向右。 These are the usual algebraic conventions.这是通常的代数公约。

a^b^c is the same as (a^b)^c.一个c ^ ^ b是一样的(^ b)c ^。

You can get operators by type(x).你可以通过类型运营商(x)。

17.2.1.1.17.2.1.1。 Arithmetic Operators算术运算符

-------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

plus加上 ++ a+b+ b 44

minus减去 -- a-bcouple 44

mutilation损毁 * a*b一个* b 55

division分工 / a/ba / b 55

power权力 ^ a^b一个^ b 66

power权力 ** a**b一个* * b 66

---------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

17.2.1.2.17.2.1.2。 Relational Operators关系运算符

Before you can write loops, you must be able to write statements that evaluate to 1 or 0, and before you can do that, you must be able to write useful statements with logical values. 你可以写循环之前,您必须能够写评估声明1或0,之前,你可以做到这一点,你必须能够写有用的报表和逻辑值。In mathematics, these are relational statements.在数学中,这些都是关系陈述。

SymbMath allows you to compare numbers six ways:SymbMath允许你比较编号六个方法:

a < b一个< b less than少于

a <= b一个< = b less than or equal to小于或等于一

a > b一个> b greater than大于

a >= b一个> = b greater than or equal to大于或等于

a == b一个= = b equal to等于

a <> b一个< > b not equals不等于

SymbMath uses the double equals sign == (like C language) for "is equal to" to distinguish this operator from the equation =.采用双SymbMath等号= =(如C语言)为“等于“鉴别该算子方程的=。

The result of a comparison of two real numbers is either 1 or 0. 结果的比较两个实数要么是1或0。If the comparison is not both real numbers, it left unevaluated.如果类比并不涉及不动产编号,留下unevaluated。

17.2.1.3.17.2.1.3。 Logical Operators逻辑运算符

SymbMath uses the logical operators:SymbMath采用逻辑运算符。 AND, and OR.,或。 You can combine comparison operators with them to any level of complexity. 你可以将比较运算符和他们有任何程度的复杂性。In contrast to Pascal, logical operators in SymbMath have a lower order or precedence than the comparisons, so a < b相比之下,帕斯卡尔,逻辑运算符在SymbMath有较低的优先级顺序或比比较,所以< b and c > d works as expected.c > d作品与预期相符。 The result of combining logical values with结果相结合的逻辑值

logical operators is another logical value (1 or 0).逻辑运算符是另一个逻辑值(1 - 0)。 Bit operations on integers can be performed using the same operations, but result is integers.整数位操作可以进行使用相同的手术,但是结果是整数。

SymbMath uses the "short-circuit" definition of AND and OR when the arguments are Boolean.SymbMath用“短路”的定义,或当参数和布尔。 Here are tables that show how AND and OR are defined:这里有表显示,或被定义:

a AND ba和b

--------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

bb 11 00

a一个

11 11 00

00 00 00

------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

a OR ba或b

--------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

bb 11 00

a一个

11 11 11

00 11 00

------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Short-circuit evaluation is used because often one condition must be tested before another is meaningful.采用短路评价因为往往一个条件必须被测试在一个很有意义的。

The result of Boolean expression with logic operators is either 1 or 0. 布尔表达式的结果与逻辑操作要么是1或0。Boolean expression like (1 < 3 or 1 > 4) return a real value 1 or 0.像布尔表达式(1 < 3或1 > 4)返回一个真正的价值1或0。 Numeric expressions can replace Boolean ones, provided they evaluate to 1 or 0.布尔的数字表达式可以取代,只要他们评估以1或0。 The advantage here is that you can define the step function that is 0 for x < a and 1 for x > a by entering:这里的优势在于,你可以定义步骤功能,是0 x(x和1 >一个进入:

step(x_, a_) := x > a步骤(,已x_):= x >

To define the function:定义的功能有:

f(x) = x-1f(x)= x-1 if x < 1如果x < 1

= x^2-x= x ^ 2-x if x >= 1如果x > = 1

enter:进入:

f(x_) := (x-1)*(x < 1) + (x^2-x)*(x >= 1)f(x_):=(x-1)* < 1 + x(x ^ 2-x)*(x > = 1)

These functions can be differentiated and integrated symbolically.这些功能可以分化和综合象征性地。

17.2.2.17.2.2。 Function Calls函数调用

A function call activates the function specified by the function name. 一个函数调用激活函数指定的函数名。The function call must have a list of actual parameters if the corresponding function declaration contains a list of formal parameters. 这个函数必须有一个列表实际参数对应的函数声明包含了一串的形式参数。Each parameter takes the place of the corresponding formal parameter. 每一个参数代替了相应的正式的参数。If the function is external, the function call will automatically load the library specified by its function name plus extension .如果功能外,这个函数将自动载入图书馆功能的名字加上规定延长。LI when needed.李需要时。

Some examples of the function calls follow:函数调用一些例子如下:

sin(x)罪(x) # load the library sin.#负荷图书馆的罪。li when needed李在需要的时候

inte(x^2, x)强烈的(x ^ 2、x) # load the library inte.图书馆#负载密集。li when needed李在需要的时候

17.3.17.3。 Statements报表

17.3.1.17.3.1。 Comment Statements评论语句

# is the comment statement sign.号是评论声明标志。

You can add comments into a line, or even produce a single line which is entirely a comment, by preceding the comment sign with #.你可以添加评论到一条线,甚至产生一个单一的流水线,完全是一个注释,签约前的评论#。

For example:例如:

# This is my program这是我的计划。#

3 + 43 + 4 # My first calculation#我第一次计算

Comments make your calculations more understandable, whether you are making a printed record of what you are doing or if you just want to jot some notes to yourself while you are working.让你的计算评价更易于理解,你是否正在打印记录你正在做的,或者如果你只想要写一些笔记给自己当你工作。

17.3.2.17.3.2。 Evaluation Statements评价报表

The evaluation statement has the format:评价声明已格式:

expression表达

SymbMath evaluates any expression which in a line and gives the value of the expression. 任何SymbMath评价对一条直线上的表达,并给出了价值的表达方式。e.g.例句。

IN:在: 3 + 43 + 4

OUT: 7出:7 # the value of 3+4# 3 + 4的价值

IN:在: d(x^6, x)d(x ^ 6,x)

OUT: 6 x^5出:6 x ^ 5 # the value of d(x^6, x)号d的价值(x ^ 6,x)

IN:在: subs(last, x = 1)替补(最后,x = 1) # evaluate the last output when x = 1.评估最后输出时# x = 1。

OUT: 6出:6

The last output can be saved to a variable for the later use by the built-in variable "last", e.g. f :=last.最后的输出可以保存到一个变量备用的“最后一次”的内部变量,例如福:=持久。

17.3.3.17.3.3。 Assignment Statements赋值语句

The assignment in SymbMath language is similar to assignment in such language as PASCAL.在SymbMath语言任务分派到类似这样的语言,就像帕斯卡。

An assignment operator is一个赋值运算符是 :=:=

The assignment statement specifies that a new value of expr2 be assigned to expr1, and saved into memory. 声明指定作业,一个新的价值被指定给expr1 expr2,留到内存中。The form of the assignment statements is赋值语句的形式

expr1 := expr2expr1:= expr2

You can use assignment for storing result.你可以使用分配存储的结果。

You can assign the result of calculation or any formula to a variable with a command like:你可以指定或任何公式计算结果与一个命令给一个变量,例如: X := SIN(4.2).谢:=罪(4.2)。

The assignments are useful for long calculations.作业是非常有用的,长时间的计算。 You can save yourself a lot of recalculations by always storing the results of your calculations in your own variables instead of leaving them in the default variable last.你可以为自己省下不少recalculations总是将结果储存你的计算在自己的变量,而不是让他们在默认的变量的最后一次。

You can destroy the assignment to X with the command clear(X). 你可以摧毁分配给该命令清楚X(X)。If X stored a large list, you could regain a considerable amount of memory by clearing X. Also, since a variable and a function can have the same name, you can clear a variable p, not a function p(x).如果X储存一大名单,你可以重获相当数量的内存净化X。同时,由于变量和一个函数具有相同的名字,你可以专门清理一个变量p,而不是一个函数p(X)。

The assignment operator is also used in the definition of a function or procedure.在赋值运算符也被用于定义一个函数或过程。

Variables can be used in function definitions, and that leads to an important difference between functions and variables.变量可以用在函数定义,这导致一种非常重要的区别函数和变量。 When a variable is defined, all terms of the definition are evaluated.当一个变量的定义是,所有的术语的定义进行了评估。 When a function is defined, its terms are not evaluated; they are evaluated when the function is evaluated.当一个函数的定义,其条件没有评价;他们正在评估当函数进行了评价。 That means that if a component of the function definition is changed, that change will be reflected the next time the function is evaluated.这意味着如果一个组件的功能定义也发生了变化,这变化可反映下次功能进行了评价。

e.g.例句。

IN:在: p:=2+3警:= 2 + 3 # 2+3 is evaluated at the time of assignment, p is assigned with 5.# 2 + 3评估转让时,p被指派5。

OUT: p := 5出:p:= 5

IN:在: p(x):=2+3p(x):= 2 + 3 # 2+3 is evaluated when the value of p(x) is requested,# 2 + 3评估价值时p(x)请求,

# p(x) is assigned with 2+3.# p(x)被指派2 + 3。

OUT: p(x) := 2+3出:p(x):= 2 + 3

If the left hand side of the assignment is a variable, it is the immediate assignment (i.e. expr2 is evaluated at the time of assignment); if the left hand side is a function, it is the delayed assignment (i.e. expr2 is evaluated when the value of expr1 is requested).如果左边的作业是一个变量,这是直接的任务(即expr2评估转让时);如果左边是一个函数,它是推迟任务(即expr2评估价值时的要求expr1)。

You can force all the components of a function to be evaluated when the function is defined by preceding the function with the command eval():你可以迫使所有的组件功能评估当函数被定义为之前的命令:功能():

f(x_) := eval(2+3)f(x_):=(2 + 3): # f(x_) is assigned with 5# f(x_)被指派5

Note that not only a variable but also any expression can be assigned. 注意:不是只有一个变量也是任何一个表述都可以转让。e.g. x := 2, sin(x)/cos(x) := tan(x), a>0 := 1.如x:= 2,罪(x)/因为(x):=褐色(x),一个> 0:= 1。

Clear a variable, function or expression from assignment by清理一个变量、函数或表现出让

clear(x)清晰的(x) # clear x from assignment.明确的任务。从x号

clear(f(x))清楚(f(x)) # clear f(x) from assignment.#清楚f(x)从任务。

clear(a>0)清楚(> 0) # clear a>0 from assume(a>0).从一个> 0 #清楚假设(> 0)。

17.3.4.17.3.4。 Conditional条件

There are two conditional functions:有两个条件功能:

if(test then x)如果(测试然后x)

if(test then x else y)如果(测试然后x别的y)

if(condition then x) gives x if condition evaluates to 1, or no output otherwise.如果情况。然后x)给x如果条件评估为1,或没有输出不然。

if(condition then x else y) gives x if condition evaluates to 1, y if it evaluates to 0, or no output if it evaluates to neither 1 or 0. 如果其他条件然后x y)给x如果条件对1,y如果它对0,或者没有输出如果它对没有1或0。The 2 words (then and else) can be replaced by comma ,.二字(然后和其他)可以被逗号。

It is useful in definition of the use-defined function to left the function unevaluated if the argument of the function is not number. 适用于定义的函数功能use-defined离开unevaluated如果参数的功能不号码。e.g. define f(x_) := if(isnumber(x), 1), then call f(x), f(10) gives 1, and f(a) gives f(a).例如定义f(x_):要是(isnumber(x),1),然后叫f(x)、f(10)给1,f(一个)给f(a)。

17.3.5.17.3.5。 Loop回路

You can use two kinds of loops in SymbMath, fixed length loops controlled by do() and variable-length loops controlled by repeat(). 你可以使用两种循环在SymbMath、固定长度控制回路做的()和可变长循环重复控制()。The do() loop is similar to the FOR loop in BASIC language.做的()的循环是类似于循环的基本语言。

The control variable in the do() loops is not limited to integer values. 控制变量的做的()循环并不局限于整数的价值观。You can say:你可以说:

do(f:=f+1, x from xmin to xmax step dx)(女:= f + 1,从x xmin xmax一步,dx)

It is similar to它与

FOR x := xmin TO xmax STEP dx在x:= xmin xmax一步,__

f:=f+1女:= f + 1

NEXT x下一个x

where xmin, xmax, and dx are real values.在xmin,xmax,dx是真实的价值。 If STEP dx is omitted, it defaults to 1.如果步骤dx被忽略,它默认值为1。

e.g.例句。

IN:在: x:=0谢:= 0

OUT: x := 0出:谢:= 0

IN:在: do(x:=x+1, j from 1 to 5 step 1)(= x + 1 x:[j].从1到5步1)

OUT: x := 5出:谢:= 5

The conditional loops are probably more useful than the do() loops if a number of iteration is unknown. 有可能是更有用的循环比做的()循环如果一些迭代是未知的。It is这是

repeat(y until test)重复(y,直到试验)

repeat(y, test)重复(y,测试)

The word (until) can be replaced by comma ,. 一个词(直到)可以被逗号。The repeat() repeats to evaluate f until the test is true (i.e. the result of the test is 1).重复()重复直到测试来评估f是真实的(即测验的结果是1)。

Example:例如:

IN:在: x:=1谢:= 1

OUT: x := 1出:谢:= 1

IN:在: repeat(x:=x+1 until x>5)重复(x:= x + 1直到x > 5)

OUT: x := 6出:谢:= 6

17.3.6.17.3.6。 Switch开关

The switch sets or changes the switch status. 开关设置或更改开关状态。The switch status is unchanged in memory until the switch is assigned by the new value.开关状态不变直到开关在内存中分配的新的价值。

---------------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Switch开关 Action行动

output := math输出:=数学 output form is math symbol notation, this is default.输出形式是数学的象征符号,这是默认值。

output := basic输出:=基本 output form is BASIC format.输出形式基本格式。

output := fortran输出:= fortran output form is FORTRAN format.输出形式是FORTRAN格式。

output := prolog输出:= prolog output form is PROLOG format (internal form).输出形式是PROLOG格式(内部形式)。

output := off输出:=了 not display output.不显示输出。

output := on输出:=在 the same as output := basic一样的输出:=基础

lowercase := on小写:=在 convert letters into the lower-case letters.小写字母转换成文字转化成的。

lowercase := off小写:=了 not convert letters into the lower-case letters, this is default.小写字母转换的不信,这是默认值。

numeric := on数字:=在 convert numbers to floating-point numbers.转换为浮点数数字。

numeric := off数字:=了 not convert numbers to floating-point numbers, this is default.数字不转换浮点数,这是默认值。

expand := on拓展:=在 expansion. 扩张。e.g. c*(a+b) to c*a+c*b.如c * a + b)c * + c * b。

expand := off拓展:=了 disable expansion, this is default.禁用扩张,这是默认值。

expandexp := onexpandexp:=在 expand exponent. 扩大指数的增大而减小。e.g. c^(a+b) to c^a*c^b.如c ^(a + b)c ^ ^一个度b。

expandexp := offexpandexp:=了 disable exponent expansion, this is default.伤残指数扩张,这是默认值。

-------------------------------------------------------------------------------------------------------------------