From: daemon@rand.org Date: Fri Sep 8 13:44:38 1995 To: rusin@math.niu.edu Subject: Subject: send pavelle Here is your requested REDUCE library entry. RAND takes no responsibility for any material distributed in this manner. Please address any questions regarding it to the relevant author or reduce@rand.org. ---------------------------- cut here ---------------------------- The following problems have been sent by Richard Pavelle to the USENET sci.math.symbolic bulletin board. They represent interesting challenges for algebra systems as Dr. Pavelle explained in his introduction to the series: I shall begin, with this message, to send problems or ideas to users and implementors of CA systems. The computations will generally be those which occur in applying CA systems to problems from industry or government sponsored r&d. I am selecting those problems which can be stated without much verbiage. I hope they will prove interesting. I will try to give some background or motivation to the problems. However, this will not always be possible. I will use MACSYMA input and output since it is the system most readily available to me. I hope that users of other systems will post their methods and comments so we can have an exchange of ideas. We shall include the best REDUCE solutions along with the problems as we receive them. If there is no solution proposed for a problem, it means we don't yet have one! [those deleted - djr] ---------------------------------------------------------------------------- PROBLEM NUMBER 1 Problem1: This problem came to me from Xerox and is related to the frictional forces on a sheet of paper sliding over a metallic surface. There are two parts. Derive the integral shown and then prove the answer. Differentiating the expression below introduces some nasty terms. 'integrate(x^2/(sqrt(x^2+d^2)+c),x) = -c*sqrt(d^2-c^2)*asin((c*sqrt(x^2+d^2)+d^2)/(d*(sqrt(x^2+d^2)+c)))- (d^2-2*c^2)*log(2*(sqrt(x^2+d^2)+x))/2+x*(sqrt(x^2+d^2)-2*c)/2; / 2 2 2 2 [ x 2 2 c sqrt(x + d ) + d I ----------------- dx = - c sqrt(d - c ) asin(---------------------) ] 2 2 2 2 / sqrt(x + d ) + c d (sqrt(x + d ) + c) 2 2 2 2 2 2 (d - 2 c ) log(2 (sqrt(x + d ) + x)) x (sqrt(x + d ) - 2 c) - -------------------------------------- + ----------------------- 2 2 ---------------------------------------------------------------------------- PROBLEM NUMBER 2 The object is prove the exactness of a given solution of the 4th order PDE op1(f)+op2(f)=0 where op1(f):=diff(diff(f,x,2)+diff(f,y,2)+diff(f,z,2),x,2) op2(f):=n^2*(diff(f,x,2)+diff(f,y,2)) ... It is found that 2 2 2 n z sqrt(z + y + x ) sin(----------------------) 2 2 sqrt(z + y ) f = --------------------------- 2 2 2 sqrt(z + y + x ) is an exact solution. Proving this with MACSYMA is time consuming requiring between 1 and 5 CPU hrs on a VAX 780 depending upon the approach. I believe this example provides a rigorous test for the simplification procedures of any CA system. Would anyone care to try it on another system and comment on their approach? ---------------------------------------------------------------------------- PROBLEM NUMBER 3 Toeplitz matrices are used, among other areas, in signal processing in the sampling of stationary data. Here is an example of a 7x7 Toeplitz matrix: (c1) toeplitz(7); [ a b c d e f g ] [ ] [ b a b c d e f ] [ ] [ c b a b c d e ] [ ] (d1) [ d c b a b c d ] [ ] [ e d c b a b c ] [ ] [ f e d c b a b ] [ ] [ g f e d c b a ] Recently I found an application of these matrices which yields a nice test for factorizing. I believe it is true, although I have not found a proof, that the characteristic polynomial of a Toeplitz matrix factors, over the integers, into two parts. As an example, for a Toeplitz matrix of order 3, (c2) factor(determinant(toeplitz(3)-L*ident(3))); 2 2 2 (d2) - (L + c - a) (L - c L - 2 a L + a c - 2 b + a ) Here the characteristic polynomial of a 3x3 factors into parts containing 3 and 6 terms respectively. (MACSYMA does not, as MAPLE does, have a canned definition of a Toeplitz matrix so I wrote one for this example. I also edited the "L" above to distinguish it from the integer 1). Here is a table of the number of terms in each of the factored parts as far as I have attempted to proceed with MACSYMA on a VAX 780. order terms in 1st factor terms in 2nd factor 2 3 3 3 3 6 4 11 11 5 11 24 6 51 51 7 49 107 The characteristic polynomials become large very quickly, and I would like to know how far users can extend this list. What is the largest characteristic polynomial of a Toeplitz matrix which can be factored by a CA system? My second question is whether someone can prove or find a proof of the conjectured factorization into two parts? Richard Pavelle [REDUCE:] order 7: 2 49 107 Time: 6625 ms order 8: 2 270 270 Time: 87142 ms plus GC time: 22010 ms order 9: 2 248 549 Time: 1078558 ms plus GC time: 594765 ms They started the order 10 computation, but stopped it after they concluded that they would need an even larger memory for this. ---------------------------------------------------------------------------- PROBLEM NUMBER 4 One of the difficulties novice users (perhaps all users) encounter with CA systems is that they will often pose an innocent looking problem and receive a horrible looking answer or no answer at all. I have noticed that many researchers routinely derive integrals or ODEs in their work, but do not remember very much about the analytic techniques for solving them. I believe these users want a CA system to give an answer or tell them that it cannot solve the problem. They are not pleased when a system poses a different problem or asks a multitude of questions which may be more difficult to answer than the initial problem. While no system may ever supply all the wants or needs of a user, I feel that novice users need far more information about the true capabilities of CA systems and the ease in using them to solve routine or difficult problems. An integral I encountered in a study of optical discrimination addresses some of these issues: 'integrate(sin(x)*acos(b^2/sin(x)),x)=b^2*atan(cos(x)/sqrt(sin(x)^2-b^4))- asin(b^2*cot(x)/sqrt(1-b^4))-cos(x)*acos(b^2/sin(x)); / 2 [ b 2 cos(x) I sin(x) acos(------) dx = b atan(------------------) ] sin(x) 2 4 / sqrt(sin (x) - b ) 2 2 b b cot(x) - cos(x) acos(------) - asin(------------) sin(x) 4 sqrt(1 - b ) If you present this integral (the left hand side) to MACSYMA (versions 412.45 and 309.1), it does not return anything useful. MACSYMA gives a different looking, very messy integral. To coax MACSYMA to give an answer it is necessary to change variables. Then one encounters an expression which requires some extensive manipulation to get it into the form I have shown above. Let me add that integrands of the form trig(x)*inverse_trig(k/trig(x)) are fairly common in problems involving spherical geometry and projected surfaces. My queries are the following: 1) Can any CA system perform this integration without a change of variable or trickery? That is, can a novice use ANY system to perform this integration? 2) If not, would the implementors explain why their systems are unable to handle this class of integrals? 3) If a change of variable is needed, how little work would be necessary to get the answer into a useful form, similar to the one I wrote above? 4) Would some users care to tell us how often they find a CA system to be of limited use in their work because it cannot solve problems which you believe it should be able to solve? -- ---------------------------------------------------------------------------- PROBLEM NUMBER 5 Prove the following identity: 3 %pi 2 %pi tan(-----) + 4 sin(-----) = sqrt(11) 11 11 This identity is given by Hobson (without proof) in his 1891 "A Treatise on Plane and Advanced Trigonometry". The identity is the next to last in Chapter 7. With MACSYMA I have found many more similar identities for foo(m,n,r):=tan(m*%pi/11)+n*sin(r*%pi/11)-sqrt(11); foo(1, 4, 3)=0 foo(1, 4, 8)=0 foo(3, 4, 2)=0 /* Hobson's */ foo(3, 4, 9)=0 foo(4, 4, 1)=0 foo(4, 4, 10)=0 foo(9, 4, 5)=0 foo(9, 4, 6)=0 For 7 replacing 11 there are several: foo(m,n,r):=tan(m*%pi/7)+n*sin(r*%pi/7)-sqrt(7); foo(3, 4, 8)=0 foo(5, 4, 3)=0 foo(5, 4, 4)=0 foo(6, 4, 2)=0 foo(6, 4, 5)=0 foo(10, 4, 8)=0 For 13 replacing 11 I find none. foo(m,n,r):=tan(m*%pi/13)+n*sin(r*%pi/13)-sqrt(13)=0 In each case I let only let m,n,r run thru 10 so I have certainly missed many. There are three questions which I pose: 1) Why does the integer 4 appear to play a role in these identities? 2) Is there some general scheme for generating these integer identities? 3) Is there some simple underlying mathematics behind these identities? ---------------------------------------------------------------------------- PROBLEM NUMBER 6 Finding reasonable looking solutions to systems of non-linear equations is unusual. In the example below I had the feeling that the solution(s) must be simple owing to the physical nature of the problem. This feeling was strengthened by assigning numerical values to the constants and solving the far easier problem. The problem comes from a study in quantum chemistry where we are given six equations equations:[de3*m3-de2*m2+de1*m1, -ep3*m3+ep2*m2+ep1*m1, -r1^2+(ep1-ep2)^2+(de2+de1)^2, -r2^2+(ep3+ep2)^2+(de3+de2)^2, de1*m1*(2*m3+m2)-de2*m2*(m3-m1)-de3*(m2+2*m1)*m3, -r1*r2*sin(th)+(de2+de1)*ep3+(de1-de3)*ep2+(de3+de2)*ep1]$ to be solved for ep1,ep2,ep3,de1,de2,de3. The solution must be physical, namely real and positive. The ep(j) and de(j) are coordinates of a triatomic molecule in two different systems, m1,m2,and m3 are atomic masses, and r1 and r2 are bond lengths. Therefore, m1+m2+m3 = m (total mass) is a natural relation in the solution shown below although it does not appear with regularity. solution: [de1 = m2*m3*r1*r2*sin(th)/sqrt(-2*h1*h2*cos(th)+h2^2+h1^2), de2 = 2*m1*m3*r1*r2*sin(th)/sqrt(-2*h1*h2*cos(th)+h2^2+h1^2), de3 = m1*m2*r1*r2*sin(th)/sqrt(-2*h1*h2*cos(th)+h2^2+h1^2), ep1 = ((h1-h2)*(m3*r2-m3*r1-m2*r1)-(h2*m3*r2+h1*m3*r1+h1*m2*r1)*(cos(th)-1)) /(m*sqrt(-2*h1*h2*cos(th)+h2^2+h1^2)), ep2 = ((h1-h2)*(m3*r2+m1*r1)-(h2*m3*r2-h1*m1*r1)*(cos(th)-1)) /(m*sqrt(-2*h1*h2*cos(th)+h2^2+h1^2)), ep3 = ((h1-h2)*(m2*r2+m1*r2-m1*r1)-(h2*m2*r2+h2*m1*r2+h1*m1*r1)*(cos(th)-1)) /(m*sqrt(-2*h1*h2*cos(th)+h2^2+h1^2))]$ where [h1 = (m2+2*m1)*m3*r2,h2 = m1*(2*m3+m2)*r1]$ When I turned MACSYMA loose on the full set of equations, asking it to solve them, it ground away for hours and returned a horrendous mess of thousands of useless terms. This was not very surprising since it was using brute force. Eventually I found, over several days, the solution above by eliminating particular variables from the equations and dealing interactively with them. Most systems claim the ability to solve systems of non-linear equations, but finding a solution and finding a reasonable looking solution are not equivalent. The question I should like to pose is whether any system can get close, automatically, to the solution I have shown above. In addition perhaps others would share their experiences or tricks used in solving systems of non-linear equations. ---------------------------------------------------------------------------- PROBLEM NUMBER 7 The following is the seventh in a series of problems which I am sending to readers of sci.math.symbolic. While I was able to solve the second problem at the bottom of this message with MACSYMA (with some difficulty), its generalizations may be too hard or impossible for any CA system. Therefore I am also sending the message to sci.math to see whether the human touch can beat the computer (as it often does). Background: Multidimensional normal integrals are generally difficult to evaluate numerically, much less in closed form, over any range of integration. Closed forms are known for a very limited class of covariance matrices. However, I have recently found two closed forms for particular integrals whose covariance matrix is of a the most elementary Toeplitz form. The answers are so simple in appearance that extensions to higher dimensions may be possible. However, I have been unable to go above three dimensions. Here are the MACSYMA statements which generate the 3D and 4D integrands for 3x3 and 4x4 Toeplitz matrices: mat3:matrix([1,p,p^2],[p,1,p],[p^2,p,1])$ vec3:matrix([x,y,z])$ -factor(ratsimp(transpose(vec3).mat3^^(-1).vec3))/2; kernal3:exp(%)/((2*%pi)^(3/2)*sqrt(factor(determinant(mat3)))); mat4:matrix([1,p,p^2,p^3],[p,1,p,p^2],[p^2,p,1,p],[p^3,p^2,p,1])$ vec4:matrix([x,y,z,w])$ -factor(ratsimp(transpose(vec4).mat4^^(-1).vec4))/2; kernal4:exp(%)/((2*%pi)^(4/2)*sqrt(factor(determinant(mat4)))); The extensions to higher dimensions should be obvious. Here are the integrals and answers for the first three dimensions. The first is trivial. The second is obscure but known in the literature. The third may be new. 2 inf x / - -- [ 2 I %e dx ] / 0 1 ----------------- = - sqrt(2) sqrt(%pi) 2 2 2 inf inf y - 2 p x y + x / / ----------------- [ [ 2 (p - 1) (p + 1) I I %e dx dy ] ] / / 0 0 2 asin(p) + %pi ----------------------------------- = --------------- 2 4 %pi 2 %pi sqrt(1 - p ) 2 2 2 2 2 inf inf inf z - 2 p y z + p y + y - 2 p x y + x / / / ---------------------------------------- [ [ [ 2 (p - 1) (p + 1) I I I %e dx dy dz ] ] ] / / / 0 0 0 ------------------------------------------------------------------ = 3/2 2 sqrt(2) %pi (p - 1) (p + 1) 2 2 asin(p ) + 4 asin(p) + %pi ---------------------------- 8 %pi My queries to readers are the following: 1) Can anyone find a closed form for the 4D integral and possibly extend it to higher dimensions? 2) Can any using a Computer Algebra system verify or derive the second and third integrals above? If so, how?-- ---------------------------------------------------------------------------- PROBLEM NUMBER 8 The following is the eighth in a series of problems which I am sending to readers of this newsgroup: The problems below interest me because they came from two different, unrelated people in the same week and exhibit a weakness in CA systems. The problems are unusual owing to their simplicity. I cannot recall seeing a "reasonable problem for a CA system", which I could do by hand in seconds, for which CA systems fail as in Part1 below. For fun I shall go out on a limb by stating that I believe no Computer Algebra system can do either of these problems directly, and I challenge the community to prove me wrong subject to certain guidelines. For example, it would not be fair to insert a numerical integration routine for erf(x) as a plotting fix. Part1: Find the limit as x --> infinity of exp(x^2)*(1-erf(x)). Part2: Plot the above function from x=0 to x=12. Comments: Part1 is trivial if l'Hopital's rule is applied but calling "limit" directly fails in the CA systems I tried. Part2 seems to fail because the numerical precision of erf(x) for large values of x is not sufficiently accurate and roundoff errors occur. I was, however, able to plot the function from 0 to 12 using Fortran on an Amdahl to quadruple precision. ---------------------------------------------------------------------------- PROBLEM NUMBER 9 The following is the ninth in a series of problems which I am sending to readers of this newsgroup. In August, 1988, I posted Problem3 concerning the factorization of the determinant of symmetric Toeplitz matrices. This provided a test of factorization algorithms and placed some limits on computing power. The following problem has some similarities because the expression we seek also factors, but it is a perfect square. Therefore a different routine may be used. However, the growth in the size of the expression for increasing order is far faster than the example in Problem3. By way of historical interest, this problem was posed by Greg Fee at the University of Waterloo about 8 years ago. It was shown to be valid for the 4x4 and 5x5 cases using MACSYMA. It circulated among users of the MIT-MC machine for several weeks until someone proved it with elementary methods and a written proof was found in a book. I do not have access to those records at this time so perhaps someone will be able to come up with a reference. The problem(theorem) may be stated as follows: If M and N are antisymmetric matrices then the determinant DET(I-M.N) is a perfect square where I is the identity matrix. Here is MACSYMA output for the 3x3 case. The MACSYMA command SQRF finds polynomial factors which are perfect squares. I do not show the user function which generates the antisymmetric matrices. (c2) mat(x,3); [ 0 x12 x13 ] [ ] (d2) [ - x12 0 x23 ] [ ] [ - x13 - x23 0 ] (c3) mat(y,3); [ 0 y12 y13 ] [ ] (d3) [ - y12 0 y23 ] [ ] [ - y13 - y23 0 ] (c4) sqfr(determinant(ident(3)-mat(x,3).mat(y,3))); 2 (d4) (x23 y23 + x13 y13 + x12 y12 + 1) Below is a table of the cases which I have been able to run on a VAX 780 using MACSYMA 309.1. I have not been able to get beyond the 5x5 case on a VAX or on a Lisp Machine. In the 6x6 case the determinant, before simplification, has more than 4 million terms and the VAX runs out of space at this stage while the lispm ran for 6 hours without returning an answer. In the following LDET is the number of terms in the simplified determinant and LSQR is the number of terms in square free term. Order LDET LSQR Time (sec) 3 10 4 1 4 124 16 32 5 1506 56 700 My queries are: 1) Can anyone extend this table? 2) Can anyone provide us with a proof or reference?-- ---------------------------------------------------------------------------- From: smith@joshua.math.ucla.edu (Douglas Smythe) Here is a simple proof (which works over any field not of characteristic 2): [deletia] ---------------------------------------------------------------------------- PROBLEM NUMBER 10 The following is the tenth in a series of problems which I am sending to readers of this newsgroup (following a pause of a few months). This problem interests me because it looks simple, and yet I question whether any CA system can perform it without a fair amount of user interaction. If I am wrong then users of various systems will be able to correct me. It comes from a problem, recently solved, of obtaining a closed form for the radiation from microstrip bends with arbitrary angle. I may send a second (far more difficult) related integral later. The problem is to derive the right hand side of the following where 0 < g < 1 . %pi --- 2 / 4 2 2 [ cos (x) 3 %pi (2 sqrt(1 - g ) + g - 2) I --------------- dx = - ------------------------------- ] 2 4 / (g sin(x) + 1) 2 g %pi - --- 2 I used MACSYMA 309.1 for this. -------------------------------------------------------------------------- PROBLEM NUMBER 11 Prof. Knuth posed a problem in the June-July American Mathematical Monthly which I thought would be easy with MACSYMA. WRONG!!!"!!! Here it is as stated on Page 525: Solve the recurrence X = A, X = B, X = X + X /(N+1) for N = 0,1,2,..... 0 1 N+2 N+1 N both exactly (in terms of familiar functions of N) and asymptotically. -------------------------------------------------------------------------- PROBLEM NUMBER 12 The following is the 12th in a series of problems which I am sending to readers of this newsgroup. The following correspondence in the newsgroup rec.puzzles appeared yesterday: Newsgroups: rec.puzzles Subject: Re: 2 problems (PARTIAL SPOILER) Date: 2 Feb 90 13:11:30 GMT References: <1043@acf5.NYU.EDU> Organization: Penn State University In article <1043@acf5.NYU.EDU>, ambati@acf5.NYU.EDU (FJLevM{n[]Balamurali Ambati) says: >>1) How many squares are composed of the digits 1,4, and 9 alone. >>For example (144, 49). >My guess is that there are only 7: 1^2=1, 2^2=4, 3^2=9, 7^2=49, 12^2=144, >21^2=441, and 38^2=1444. But I can't prove it. The obvious approach is >to show that there's a bound on the number of digits at either the front >or the end which can be 1, 4, or 9. But there isn't; for any N, there >exist squares which begin with N 1's and end with N 1's or 4's. As users of Computer Algebra systems know, while the systems are not designed for numeric problems, they can often be used effectively for this purpose. The above is a good example of such usage. It took me a few minutes of coding MACSYMA and two hours of run-time on a VAX780 to produce these ten examples, thereby extending the set of seven examples mentioned above. I would be interesting to see how users of other CA systems can handle this problem with the tools provided. 1^2 = 1 2^2 = 4 3^2 = 9 7^2 = 49 12^2 = 144 21^2 = 441 38^2 = 1444 107^2 = 11449 212^2 = 44944 31488^2 = 991494144 [More provided by Heck:] [[1, 1], [2, 4], [3, 9], [7, 49], [12, 144], [21, 441], [38, 1444], [107, 11449], [212, 44944], [31488, 991494144], [70107, 4914991449]] cpu_time = 355.817 Andre Heck Expertise Centre CAN e-mail: heck@cwi.nl -------------------------------------------------------------------------- PROBLEM NUMBER 13 I posted this problem in July 88 to sci.math.symbolic, and many of the systems were able to solve it. Mathematica did not have an opportunity to respond or was not in shape to solve it. Neither was Derive. In any case the problem will now be published as part of a paper, and the referee has asked that a table of systems and timings be included. I tried to use Mathematica on a Mac, but it runs out of space. I do not have Derive. Perhaps someone would try these systems or others on different machines and post the times. If someone can improve on the timings below with their system please post it, and I will include it in the table. Here it the problem written in MACSYMA: op1(f):=diff((diff(f,x,2)+diff(f,y,2)+diff(f,z,2)),x,2)$ op2(f):=n^2*(diff(f,x,2)+diff(f,y,2))$ exp:(sin(n*sqrt(x^2+y^2+z^2)*z/sqrt(y^2+z^2)))/sqrt(x^2+y^2+z^2)$ ratsimp(op1(exp)+op2(exp)); This final expression is zero. The table from 1988 was: user system machine CPU times Todd McComb Maple 4.2 Sun-4 61 sec Kamal Abdali REDUCE 3.3 SUN 3/160 70 sec Greg Fee Maple 4.2 VAX 11/785 80 sec R. Pavelle MACSYMA 412.45 Symbolics 3650 1200 sec R. Pavelle MACSYMA 309.1 VAX 11/780 10800 sec -------------------------------------------------------------------------- PROBLEM NUMBER 14 Keywords: A difficult matrix inversion and simplification Date: 10 May 90 18:29:25 GMT I encountered a problem this week which makes a good candidate for the 14th entry in the series I am submitting to the group. The problem arises in photon scattering and involves little more than inverting a particular 4x4 matrix. But owing to the nature of the matrix the components of the inverse are huge. It therefore creates an unusually difficult matrix inversion problem for my MACSYMA. I am running Unix version 309.1 and when I try to invert it the MACSYMA runs out of space. This may be a difficulty with the underlying Franz, but it may just be that big. I had to use some special tricks to invert and factor it on this machine, and it took more than 4 CPU hrs. The final answer when factored is greatly simplified. So I am curious to know whether any system can compute the inverse in a direct manner and factor the components. Here is the matrix: s:matrix( [(er^2+ei^2)/(4*w^2+g^2+2*er^2+2*ei^2), -(er^2+ei^2)*(2*p1+g)/((p1+g)*(2*er*w+2*ei*w+2*er*p1-2*ei*p1+er*g-ei*g)), -(er^2+ei^2)*(2*p2+g)/((p2+g)*(2*er*w+2*ei*w+2*er*p2-2*ei*p2+er*g-ei*g)), -(er^2+ei^2)*(2*p3+g)/((p3+g)*(2*er*w+2*ei*w+2*er*p3-2*ei*p3+er*g-ei*g))], [-(2*er*w-ei*g)/(4*w^2+g^2+2*er^2+2*ei^2), (2*er*w-2*ei*p1-ei*g)/(2*er*w+2*ei*w+2*er*p1-2*ei*p1+er*g-ei*g), (2*er*w-2*ei*p2-ei*g)/(2*er*w+2*ei*w+2*er*p2-2*ei*p2+er*g-ei*g), (2*er*w-2*ei*p3-ei*g)/(2*er*w+2*ei*w+2*er*p3-2*ei*p3+er*g-ei*g)], [-(2*ei*w+er*g)/(4*w^2+g^2+2*er^2+2*ei^2), (2*ei*w+2*er*p1+er*g)/(2*er*w+2*ei*w+2*er*p1-2*ei*p1+er*g-ei*g), (2*ei*w+2*er*p2+er*g)/(2*er*w+2*ei*w+2*er*p2-2*ei*p2+er*g-ei*g), (2*ei*w+2*er*p3+er*g)/(2*er*w+2*ei*w+2*er*p3-2*ei*p3+er*g-ei*g)], [(4*w^2+g^2+er^2+ei^2)/(4*w^2+g^2+2*er^2+2*ei^2), -(4*p1*w^2+4*g*w^2+4*p1^3+8*g*p1^2+5*g^2*p1+2*er^2*p1+2*ei^2*p1+g^3 +er^2*g+ei^2*g) /((p1+g)*(2*er*w+2*ei*w+2*er*p1-2*ei*p1+er*g-ei*g)), -(4*p2*w^2+4*g*w^2+4*p2^3+8*g*p2^2+5*g^2*p2+2*er^2*p2+2*ei^2*p2+g^3 +er^2*g+ei^2*g) /((p2+g)*(2*er*w+2*ei*w+2*er*p2-2*ei*p2+er*g-ei*g)), -(4*p3*w^2+4*g*w^2+4*p3^3+8*g*p3^2+5*g^2*p3+2*er^2*p3+2*ei^2*p3+g^3 +er^2*g+ei^2*g) /((p3+g)*(2*er*w+2*ei*w+2*er*p3-2*ei*p3+er*g-ei*g))])$ --------------------- last line --- cut here ---------------------