See this section page 161 factorexpr x4 x3 x2

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r coefficients, so the terms in the factored form have integer coefficients. > poly := x^5 - x^4 - x^3 + x^2 - 2*x + 2; 162 • Chapter 6: Evaluation and Simplification poly := x5 − x4 − x3 + x2 − 2 x + 2 > factor( poly ); (x − 1) (x2 − 2) (x2 + 1) In this next example, the coefficients include in the result. > expand( sqrt(2)*poly ); √ 2. Note the differences √ 2 x5 − √ 2 x4 − √ 2 x3 + √ 2 x2 − 2 √ √ 2x + 2 2 > factor( % ); √ 2 (x2 + 1) (x + √ √ 2) (x − 2) (x − 1) You can explicitly extend the coefficient field by giving a second argument to factor. > poly := x^4 - 5*x^2 + 6; poly := x4 − 5 x2 + 6 > factor( poly ); (x2 − 2) (x2 − 3) > factor( poly, sqrt(2) ); (x2 − 3) (x + √ √ 2) (x − 2) > factor( poly, { sqrt(2), sqrt(3) } ); (x + √ 2) (x − √ √ √ 2) (x + 3) (x − 3) You can also specify the extension by using RootOf. Here RootOf(x^2-2) √ √ represents any solution to x2 − 2 = 0, that is either 2 or − 2. 6.1 Mathematical Manipulations > factor( poly, RootOf(x^2-2) ); • 163 (x2 − 3) (x + RootOf(_Z 2 − 2)) (x − RootOf(_Z 2 − 2)) For more information on performing calculations in an algebraic number field, refer to the ?evala help page. Factoring in Special Domains Use the Factor command to factor an expression over the integers modulo p for some prime p. The syntax is similar to that of the Expand command. > Factor( x^2+3*x+3 ) mod 7; (x + 4) (x + 6) The Factor command also allows algebraic field extensions. > Factor( x^3+1 ) mod 5; (x + 1) (x2 + 4 x + 1) > Factor( x^3+1, RootOf(x^2+x+1) ) mod 5; (x + RootOf(_Z 2 + _Z + 1)) (x + 4 RootOf(_Z 2 + _Z + 1) + 4) (x + 1) For details about the algorithm used, factoring multivariate polynomials, or factoring polynomials over an algebraic number field, refer to the ?Factor help page. Removing Rational Exponents In general, it is preferred to represent rational expressions without fractional exponents in the denominator. The rationalize command removes roots from the denominator of a rational expression by multiplying by a suitable factor. > 1 / ( 2 + root[3](2) ); 1 2 + 2(1/3) 164 • Chapter 6: Evaluation and Simplification > rationalize( % ); 1 (2/3) 2 1 (1/3) −2 + 2 55 10 > (x^2+5) / (x + x^(5/7)); x2 + 5 x + x(5/7) > rationalize( % ); (x2 + 5) (x(6/7) − x(12/7) − x(4/7) + x(10/7) + x(2/7) − x(8/7) + x2 ) (x3 + x) The result of rationalize is often larger than the original. Combining Terms The combine command applies a number of transformation rules for various mathematical functions. > combine( sin(x)^2 + cos(x)^2 ); 1 > combine( sin(x)*cos(x) ); 1 sin(2 x) 2 > combine( exp(x)^2 * exp(y) ); e(2 x+y) > combine( (x^a)^2 ); x(2 a) To see how combine arrives at the result, give infolevel[combine] a positive value. 6.1 Mathematical Manipulations > infolevel[combine] := 1; • 165 infolevel combine := 1 > expr := Int(1, x) + Int(x^2, x); expr := 1 dx + x2...
View Full Document

This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.

Ask a homework question - tutors are online