Simplification of Radical Expressions
Total Page:16
File Type:pdf, Size:1020Kb
Simplification of Radical Expressions by B. F. Caviness (I) Computer Science Department lllinois Institute of Technology Chicago, lllinois and R. J. Fateman Computer Science Division Department of Electrical Engineering and Computer Sciences University of California at Berkeley Berkeley, California Abstract As is the case with all simplification problems there are three desirable attributes for In this paper we discuss the problem of any solution. First it is desirable to have a simplifying unnested radical expressions. We clean theoretical solution to the problem. Second describe an algorithm implemented in ~CSYMA that the algorithms to carry out the simplifications simplifies radical expressions and then follow should be as efficient as possible, and finally the this description with a formal treatment of the solution should have good human engineering features, problem. Theoretical computing times for some of i.e., the use and actions of the simplification the algorithms are briefly discussed as is related procedures should be as natural and transparent as work of other authors. possible. Unfortunately these three aspects of a solution are not usually compatible with each other I. Introduction and compromises and choices must be made. This is certainly the case for the simplification of radical In this paper we discuss the problem of expressions. Standard techniques from the theory simplifying unnested radical expressions. By of algebraic field extensions can be used to get a radical expressions we mean, roughly speaking, nice theoretical solution to the problem. However sums, differences, products, and quotients of the nice theoretical solution neither leads to fast rational functions raised to rational powers. algorithms nor possesses nice human engineering Thus we will be discussing algorithms for carrying features. out transformations such as The theoretical solution involves finding an _x_z_J{ ÷ algebraic extension field of Q(x I ..... Xn), the field /x+/y /x - /y (1) of rational functions in x I ..... x n with coefficients (x-I)~ (x-I)3/4 in Q the field of rational numbers, to which the • - ¢2 ÷ o (2) (l-x) ~ (l-x) 3/4 given radical expressions belong. In the algebraic extension field each element can be represented and 1/(x+/2+32/3) ÷ uniquely and this unique representation can be considered to be the simplified form for the given [((2x3-4x-g)/2 -x 4 -9x + 4)32/3 expression. Thus for example +((-9x2-6)¢2 + 3x3+ 18x + 27)31/3 2~+3½[-(x2+I)]I/3 (4) +(-x4+4x2+18x-4)/2 + x 5 -4x 3 + 9x 2 + 4x + 18] (x2+l) ½ /[xS-6x4+18x 3 + 12x 2 + 108x + 73]. (3) is a member of the field Q(x)[m6,2~,3½,(x2+l)I/6 ]. We will primarily consider only expressions in Each element of this field may be uniquely repre- which the rational exponentiation is unnested, sented in the form that is, like those expressions in (I), (2) and ~o+~I(X2+I)I/6+...+ ~5(x2+I) 5/6 (5) (3) above as opposed to expressions like [(x+l)~+(x-l)½] ½ in which the square root is where ai is in Q(x)[w 6, 2~, 3½]. In particular nested. (4) may be written in the form (5) and is thus (I) Present address: Department of Mathematical Sciences, Rensselaer Polytechnic Institute, Troy, (61 N.Y. 12181 Proceedings of the 1976 ACM Symposium 329 on Symbolic and Algebraic Computation However from a human engineering point of view (4) description of the algorithm that is used in would usually be more desirable than (6). Further- MACSYMA for the simplification of expressions more, to find the extension field of Q(x) to which containing radicals. The algorithm which is called (4) belongs requires that one verify that the RADCAN, an acronym for RADical CANonical simplifier, polynomials Y14-2 and Y22-3 are irreducible over was implemented by Fateman [Mat 75] and was initially available in 1970. In our discussion we will con- Q(x)[~6] and Q(x)[~ 6, 2~] respectively. In general centrate on RADCAN's handling of radicals although such polynomials have to be factored over algebraic the program has the capability to handle a larger extension fields. Currently no efficient class of functions. More information about RADCAN algorithms are known for factoring polynomials over can be found in [Fat 72]. algebraic extension fields although recently Wang [Wan 75] and Weinberger [Wei 76] have reported Programs with purposes similar to those of some progress on finding such algorithms. RADCAN have been written by Fitch [Fit 71 and Fit 73] for CAMAL, by Shtokhamer [Sht 75a and Sht 75b] In section 2 the MACSYMA algorithm for for REDUCE, and by Jenks [GJY 75] for SCRATCHPAD. simplifying radical expressions will be presented. In particular the compromises that were made to RADCAN attempts to convert an arbitrary try to balance the clean theoretical solution with expression containing radicals, exponentials and the efficiency and human engineering problems will logarithms into a simpler form. The result pro- be discussed. duced by RADCAN can be in various forms depending on which options are chosen. There are three In simplifying radical expressions there are options: (i) an option to produce the result in other problems which must be confronted. For form 1 or form 2, (ii) an option to rationalize example what does the symbol ~x mean? The square denominators, and (iii) an option to combine pro- root function is multi-valued. Which branch, if ducts of expressions raised to the same fractional any, does the s~mbol /x represent? Also, what do power. symbols like /x z mean? Is this to be taken as -x, x or Ixl? To answer these questions precisely With the form 1 option, all polynomials requires a careful discussion as is given in appearing under radicals are factored into irreduc- section 3. Roughly speaking the answers are that ibles, i.e., prime integers or polynomials irreduc- ~x can stand for either of the single-valued ible over the integers. With the form 2 opti.on, branches of the "square root function without the polynomials appearing under radicals are affecting the way the arithmetic and simplifica- factored into square-free, pair-wise relative prime tion is carried out. The ambiguity in the symbol factors. /x 2 is inherent and an arbitrary choice must be made to resolve it. The choice of Ixl for this For examRle with the form 1 option RADCAN symbol would lead to certain difficulties that we do not consider herein. In section 3 one precise way is given that changes ~x 2 into x. With suitable modifications the same ideas could be used to change it into -x. Basically what is done in section 3 is to give a set of rules that ii!ii!zii!ii!i!ii!iiiii! iiii!ileiii !'iiii e iil transform ambiguous expressions into non- transformed into (x+3)(x+l)2(x+2) + (x+2) ambiguous ones. The rules given there are not under either the form 1 or form 2 option. The the only ones that can be given but the important dinstinction between form 1 and form 2 is discussed point is that the ambiguities must be resolved further in section 3. and the rules for resolving them should be clearly stated. Section 3 also contains a description With the rationalization of denominator option of the algorithm for finding a common algebraic the expression (x-y)/(/x-/y) will be transformed extension field to which a given set of radical into /x+/y. Otherwise it is not transformed. This expressions belongs. option will also produce the transformation (3) above. In section 5 a brief discussion of theoreti- cal computing times for some of the algorithms Option (iii) is used in the final step of of section 2 and 3 is presented. Section 5 RADCAN to determine whether or not expressions like follows section 4 in which some theorems that show /2 /3 should be rewritten as /6. a priori the irreducibility of polynomials like Except for expressions involving roots of y14-2 and y22-3 over certain algebraic extension unity, RADCAN with the form 1 and rationalization fields. This knowledge simplifies and speeds- of denominators option is a canonical form [Cav 70] up the algorithms for finding the extension fields. for the unnested radical expressions. In section 6 an alternative approach to With the form 2 option any unnested radical finding field extensions, based on the so-called expression equivalent to zero which does not theorem on the primitive element ~dW49], is involve roots of unity will be transformed to zero. discussed. This section also contains a review The form 2 option requires less computation than of other related research. the form 1 option since finding square-free, pair- wise relatively prime factors for non-constant 2. The MACSYMA Algorithm RADCAN polynomials is much easier than finding irreducible factors. In this section we present an informal 330 Experience with MACSYMA has indicated that it If appropriate, phase 3 also carries out op- is not generally desirable to automatically invoke tions (ii) and (iii), in this order. the rationalization of denominators option because simple expressions like the left-hand side of (3) The three phases of simplifying an expression are frequently transformed into complicated expres- S may be further subdivided as follows. sions like the right-hand side of (3), I. First Phase As will be explained later to reduce zero- equivalent expressions involving roots of unity to I. Make a list R of all distinct radicals in zero, requires in general the factorization of the expression S. Collect the distinct radicands, polynomials over algebraic number fields, a task i.e., polynomials appearing under radicals, on a for which no efficient algorithms are known.