Docsity
Docsity

Prepare-se para as provas
Prepare-se para as provas

Estude fácil! Tem muito documento disponível na Docsity


Ganhe pontos para baixar
Ganhe pontos para baixar

Ganhe pontos ajudando outros esrudantes ou compre um plano Premium


Guias e Dicas
Guias e Dicas


Maxima Book Chapter3, Manuais, Projetos, Pesquisas de Física

chapter 3 book maxima

Tipologia: Manuais, Projetos, Pesquisas

2013

Compartilhado em 21/04/2013

edney-granhen-8
edney-granhen-8 🇧🇷

4.8

(4)

18 documentos

1 / 35

Toggle sidebar

Esta página não é visível na pré-visualização

Não perca as partes importantes!

bg1
Expressions, complex numbers,
polynomials, and fractions in Maxima
In this Chapter we introduce Maxima functions that allow the
manipulation of algebraic, logarithmic, exponential, and
trigonometric expressions, among others. The chapter also presents manipulation of
factorials and related functions, as well as operations with complex numbers.
The Simplify menu
The Simplify menu in the wxMaxima includes all the options shown in Figure 3.1. In this
Chapter we will use these menu options in the simplification of algebraic, trigonometric,
factorials, and complex expressions.
Figure 3.1. Simplify menu and sub-menus
Manipulating algebraic expressions
The following items in the Simplify menu can be used to simplify algebraic expressions such
as polynomials and fractions:
Simplify expression - equivalent to ratsimp()
Simplify radicals - equivalent to radcan()
Factor expression - equivalent to factor()
Factor complex - equivalent to gfactor()
Expand expression - equivalent to expand()
Expand logarithms - equivalent to %,logexpan=super
Contract logarithms - equivalent to logcontract()
3-1 © Gilberto E. Urroz, 2008
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23

Pré-visualização parcial do texto

Baixe Maxima Book Chapter3 e outras Manuais, Projetos, Pesquisas em PDF para Física, somente na Docsity!

Expressions, complex numbers,

polynomials, and fractions in Maxima

In this Chapter we introduce Maxima functions that allow the manipulation of algebraic, logarithmic, exponential, and trigonometric expressions, among others. The chapter also presents manipulation of factorials and related functions, as well as operations with complex numbers. The Simplify menu The Simplify menu in the wxMaxima includes all the options shown in Figure 3.1. In this Chapter we will use these menu options in the simplification of algebraic, trigonometric, factorials, and complex expressions. Figure 3.1. Simplify menu and sub-menus Manipulating algebraic expressions The following items in the Simplify menu can be used to simplify algebraic expressions such as polynomials and fractions: ● Simplify expression - equivalent to ratsimp() ● Simplify radicals - equivalent to radcan() ● Factor expression - equivalent to factor() ● Factor complex - equivalent to gfactor() ● Expand expression - equivalent to expand() ● Expand logarithms - equivalent to %,logexpan=super ● Contract logarithms - equivalent to logcontract()

To use these, and other menu items, you should have the expression to be manipulated ready in the INPUT line, and then invoke the menu item. The following examples illustrates the use of the Simplify menu items listed above. Simplify expression Enter the following expression in the INPUT line: and select the menu item Simplify > Simplify expression to get the following output: The result of the Simplify expression menu item is the command ratsimp ( rat ional simp lification), which, in this case, produced a factoring of the expression into two quadratic expressions in x , each accompanied by other terms, such as y^2 z and y^2 , respectively. In the following example, we apply the Simplify expression menu item to a sum of fractions, to produce a single fraction: The two results above suggest that any simplification in an algebraic expression involving x and other variables will expand or collect terms around the x variable. In the following two examples x is the only variable involved: Simplify radicals Simplifies expressions involving logarithms, exponentials, and radicals into a canonical form. The following examples illustrates applications of the menu item Simplify > Simplify radicals :

The following example shows the factoring of a fraction: Factor can also be applied to integers to produce their factors: Factor complex This menu item is used to force polynomial factoring involving complex numbers. For example, applying Factor to the following polynomial produces no factoring: However, with Factor complex ( gfactor ) produces the following factors: Notice the difference results for the following two factorings; Expand expression The menu item Expand expression can be applied to algebraic expressions and fractions:

To recover the simple fractional form use ratsimp: NOTE: To separate numerator and denominator of a fraction use functions num and denom , e.g., Expand logarithm The Expand logarithm menu item is a post-fix operator of the form %, logexpan=super. This command is used to expand a logarithm into sums or differences of logarithms, e.g., Contract logarithm The Contract logarithm menu item performs the inverse of the Expand logarithm function, e.g.,

The number of combinations of n elements taken r at a time is calculated using^1 : C(n,r) = (^) nCr = (^)  n r

n!nr! r!

Also, C(n,r) = (^) nCr =  n r

n ⋅ n1 ⋅ n2...nr1 ⋅ nr!nr! r!

n ⋅ n1 ⋅ n2...nr1r! Thus, if n = 5 and r = 3 , as in the case presented above, we find that C(5,3) is equal to: Alternatively, Maxima includes function combination ( n,r ) to calculate the number of combinations of n elements taken r at a time. Using the online help command ( ?? ) we find the following information about function combination : Proceeding according to the information above, we first load the functs package and then show some calculations of the number of combinations of 5 elements taken 1, 2, 3, and 4 at a time, respectively: 1 The notation (^)  n r ^ is also referred to as the binomial coefficient, since it represents the r-th coefficient in the expansion of the binomial (x+y)n.

Since the order of selection is not important when forming a combination of objects, then the number of combinations of n elements taken n at a time is 1. Also, the expression for C(n,n) is given by Cn , n =  n n

n!nn! n!

n! 0! n!

which leds to the interesting conclusion that 0! = 1. Permutations A permutation is a selection of objects such that the order in which they are selected is important. Thus, if you have 5 objects, say, [A,B,C,D,E], and you randomly select three of them, say, [A,C,E], then [A,C,E], [A,E,C], [C,A,E], [E,C,A], etc., are all permutations of those three elements. You can actually produce the permutations of [A,C,E] using the function permutations in Maxima : The number of permutations of n elements taken r at a time is calculated using^2 : P(n,r) = (^) n Pr = n!nr!

Also, P(n,r) = (^) n Pr = n ⋅ n1 ⋅ n2...nr1 ⋅ nr!nr! = n ⋅ n1 ⋅ n2...nr1  Thus, if n = 5 and r = 3 , as in the case presented above, we find that P(5,3) is equal to: Alternatively, Maxima includes functions permutation ( n,r ) to calculate the number of permutations of n elements taken r at a time. Using the online help command ( ?? ) we find the following information about function permutation. Notice that Maxima provides three different online help entries related to the word permutation , so we have to choose, by entering the proper number, which one of the three definitions we want to explore further. Choose 0 to obtain: 2 The notation (^)  n r ^ is also referred to as the binomial coefficient, since it represents the r-th coefficient in the expansion of the binomial (x+y)n.

The beta ( β ) function The beta function is defined in terms of the Gamma function:  x , y =   x ⋅  y    xy

The beta function can also be related to factorials as:  x , y =  x1! ⋅ y1!xy1! Using Maxima the beta function is evaluated as in the following examples: Manipulating factorials, Gamma, and beta functions The Symplify menu in the wxMaxima interface includes the following items for manipulating factorials and relating them to the Gamma and beta functions: Convert to factorials This menu item can be used to convert expressions involving the Gamma and beta functions into factorial expressions, e.g.,

Convert to gamma This menu item is used to convert factorial expressions into Gamma function expressions, e.g., Simplify factorials This menu item can be used to simplify selected factorial expressions such as: Combine factorials This menu item is used to combine factorial expressions such as: Manipulation of trigonometric expression s The sub-menu Simplify > Trigonometric simplification offers the following items:

The following example shows that function trigreduce acts term by term: At this point, we can use the menu item Simplify > Simplify expression (ratsimp) to simplify the fractional sum to: Other types of reductions achievable with trigreduce are illustrated below: Expand trigonometric This menu item allows expanding expressions such as sin(x+y) , sin(2*x) , etc. For example: One type of expansion that requires redefining an option in Maxima is the expansion of half-angle expressions. By default, Maxima does not expand trigonometric functions of half angles, e.g., This is so because, by default, the halfangles option is set to false :

Try setting the option halfangles to true and repeating the expansion: Canonical form This menu item is used to produce a simplification of trigonometric expressions into a quasi-linear form, i.e., avoiding powers of trigonometric functions as much as possible. Some examples are shown below. A second example: Manipulating complex numbers and expressions The Simplify menu offers the following sub-menu for the manipulation of complex numbers and expressions:

The polar form representation uses the De Moivre formula for complex numbers, namely, e i  = cos  i sin . As a curious note, if one replaces θ = π into this expression, the result is a combination of some of the most famous numbers in mathematics: e i  =− 1 This expression involves the numbers: ● e the base of the natural logarithms ● i the unit imaginary number ● π the ratio of the length of the circumference to its diameter ● -1 the unit negative number Using the Euler formula, the equivalence of the rectangular and the polar representations of a complex number becomes obvious: z = r ei^ = rcos  i sin = r cos  i r sin = xi y. Next, we present some of the complex variable operations available in Maxima using the items in the Symplify >Complex simplification sub-menu. Convert to rectform This menu item converts a complex expression into its rectangular form. This command can be used to show the results of complex number operations, as illustrated in these examples. First we define two complex numbers z1 and z2 and attempt an addition: Using the Convert to rectform ( rectform ) command we get: The following examples show the command rectform applied to subtraction, multiplication, division, and powers of complex numbers:

Using actual numbers: Convert to polarform This menu item converts a complex expression into its rectangular form. This command can be used to show the results of complex number operations, as illustrated in these examples. First we define two complex numbers z1 and z2 as follows: In this case we use sub-indices to define the variables theta[1] and theta[2]. The sum of the two complex numbers is a long expression in its polar form:

Get real part This menu item extracts the real part of a complex variable or expression: Get imaginary part This menu item extracts the imaginary part of a complex variable or expression Demoivre The simplest application of this menu item ( demoivre ) is to implement De Moivre's formula, ei^ = cos  i sin  , i.e., Other examples are shown below:

Exponentialize This menu item is the inverse of the Demoivre menu item, producing the exponential form of complex expressions involving trigonometric and hyperbolic functions, e.g., These two expressions, for example, show the definitions of the functions sin(z) and cosh(z) in term of the real and imaginary parts, x and y. More functions for complex numbers Maxima includes the following functions for manipulation of complex variables or expressions: ● cabs - complex absolute value (modulus) ● carg - complex argument ● conjugate - complex conjugate ● residue - residue in complex plane While the modulus (cabs) and argument (carg) have been defined before, in this section we include definitions related to the functions conjugate and residue shown above. The complex conjugate of the complex number z = x + iy = rei^ θ^ is the reflection of z about the x- axis, i.e.,  z = x – iy = rei^ θ. The product of a complex numbers and its conjugate is the square of its modulus: z ⋅z = x2 + y2 = |z|^2 = r^2.