Section 5. Functions: Defining, Evaluating and Graphing

Раздел 05. Функции: Определение, Вычисление, Графики 

In this section you will learn how to define a function f(x) in Maple. The remainder of the section covers evaluating functions, solving equations with functions, and graphing functions.

В этом разделе Вы научитесь определять функции в Maple, находить их значения. Кроме того, Вы сможете развить навыки решения уравнений и построения графиков.

> restart;

05. 01. Defining and Clearing a Function in Maple

05.01. Определение и удаление функций в Maple 

To distinguish a function from an expression, Maple requires special notation when defining a function. 

В Maple для определения функции и её выделения на фоне обычных выражений используется специальная форма записи.

For example, the function f(x) = cos(Pi*x)+3  

Например, функция f(x) = cos(Pi*x)+3  

is defined as:

определяется так:

 

 

 

 
 

 

> f:=x->cos(Pi*x)+3;

f := proc (x) options operator, arrow; cos(Pi*x)+3 ...

 

Take note of the syntax here. It is absolutely necessary to type the "arrow" - > made by typing a "minus sign" and a "greater than" symbol. Maple will not define a function if you type f(x):=cos(Pi*x)+3 ;

"Прочитаем": величина х "переводится" в выражение cos(Pi*x)+3 , которому присваивается имя f ( это соответствует духу определения функции f(x) ). Кроме известного Вам оператора присваивания := , в этой конструкции используются символы " минус " и " больше ", образующие " стрелку " -> .

Традиционная форма записи такой функции: f(x) = cos(Pi*x)+3 .

Below is a comparison of an expression and a function. Note the difference in syntax and how Maple returns the output for each.

Сравним формы, которые используются в Maple для определения функции и аналогичного выражения :

 
   

> y:=(x + 2)/(x^3 + 5*x + 2);

y := (x+2)/(x^3+5*x+2)

> f:=x->(x + 2)/(x^3 + 5*x + 2);

f := proc (x) options operator, arrow; (x+2)/(x^3+5...

 

Functions always require an arrow when typing in; Maple should also have an arrow in its output. Always check the output for the arrow to confirm that you have in fact defined a function.

Конечно, и формы вывода на дисплей также разнятся. Наличие стрелки - важнейший отличительный знак функции в Maple .

С официального разрешения                    © 2002 Waterloo Maple, Inc

 

Hosted by uCoz