Maxima function, limit, number of layers and sets

Source: Internet
Author: User
Keywords function NBSP; LOG10 example
Tags aliyun example function functions http layers note use

Defining functions

Note the symbols used by the function are: =

unary function

F (x): =expr;
Example:

(%I1) F (x): = 1+x;
(%O1) F (x): = 1 + x
(%I2) F (2);
(%O2) 3

Multivariate functions

F (x,y): =expr;
Example:

(%I3) F (x,y): =y^2+x^2;
&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp;2 2
(%O3) f (x, y): = y + x
(%I4) f (2,3);
(%O4) 13

Elementary function

Power function: x^2, x^ ( -1/2),...; exponential function: 2^x, (prev) ^X, exp (x),%e^x ...
In Maxima, the constant e=2.718281828459045 is recorded as:%e. So the exponential function e^x is represented in Maxima:%e^x
Because of the importance of this function, it has a special notation: exp (x).

(%I2) F (x): =%e^x;
X
(%O2) F (x): =%e
(%I3) g (x): = exp (x);
(%O3) g (x): = exp (x)
(%I4) expand (f (X)-G (x));
(%O4) 0
Logarithmic function: Log (x)
In Maxima, log (x) is the natural logarithm, which is the logarithm of the base of E, which is often recorded as ln (x) mathematically. Maxima There is no other form of logarithm, to use a 10-or 2-based logarithm, you can only use a replacement formula. If you put the following code in ~/.MAXIMA/MAXIMA-INIT.MAC, Maxima will load the custom function log10, log2, and define ln as log at run time. This allows you to use LOG10, log2, and Ln.
LOG10 (x): =log (x)/log (10);
LOG2 (x): =log (x)/log (2);
Ln:log;
Trigonometric functions: sin, cos, tan, cot, sec, CSC
In Maxima, pi=3.141592653589793 is recorded as%pi.
Inverse: Asin, ACOS, Atan, Acot, ASEC, ACSC

piecewise function

f (x) = X-1, x<0
0, X=0
throttled, x>0
(%I2) F (x): = if x < 0 then x-1 else (if x = 0 Then 0 else 1 + x);
(%O2) F (x): = if x < 0 then x-1 else (if x = 0 Then 0 else 1 + x)
(%I3) F (-1);
(%O3)-2
(%I4) F (0)
(%O4) 0
(%I5) F (1)
(%O5) 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.