RE: Re: Re: Factoring question

*To*: mathgroup at smc.vnet.net*Subject*: [mg35521] RE: [mg35485] Re: Re: Factoring question*From*: "DrBob" <majort at cox-internet.com>*Date*: Wed, 17 Jul 2002 02:09:16 -0400 (EDT)*Reply-to*: <drbob at bigfoot.com>*Sender*: owner-wri-mathgroup at wolfram.com

I have lots of ideas. First of all, Mathematica 4.2 does factor the polynomial: expr = y^4 - (p + q)*y^3 + (p^2*q + p*q^2)*y - p^2*q^2; Factor[expr] (-(p - y))*(q - y)*(p*q - y^2) Secondly, you can do this manually by following steps like these: qList = CoefficientList[expr, q] {(-p)*y^3 + y^4, p^2*y - y^3, -p^2 + p*y} cList = CoefficientList[(a q + b)(c q + d), q] {b d, b c + a d, a c} At this point, you see that a c == -p^2 + p*y, so it's natural to try a=p and c=y-p (the other option would involve a=1) as follows: rList = cList /. {a -> p, c -> y - p} // Expand {b*d, (-b)*p + d*p + b*y, -p^2 + p*y} Typically (in college algebra) we'd solve this by trial and error, but here's a solution in Mathematica: soln = Solve[{rList[[1]] == qList[[1]], rList[[2]] == qList[[2]]}, {b, d}] {{d -> p*y - y^2, b -> -y^2}, {d -> (p*y^2 - y^3)/p, b -> (-p)*y}} (a q + b)(c q + d) /. {a -> p, c -> y - p} /. soln[[1]] // Simplify (p - y)*(-q + y)*(p*q - y^2) (a q + b)(c q + d) /. {a -> p, c -> y - p} /. soln[[2]] // Simplify (p - y)*(-q + y)*(p*q - y^2) Both solutions give the same factorization. Here's a manual solution for b and d. The possible values for d are the factors of: Factor[qList[[1]]] (-(p - y))*y^3 and those factors are tbl=Flatten@Table[(p - y)^j y^k, {k, 0, 1}, {j, 0, 3}] so here's the trial-and-error method: TableForm[ Simplify[{b, d, rList[[2]], qList[[2]]} /. {d -> #, b -> qList[[1]]/#} & /@ tbl], TableHeadings -> {None, {b, d, rList[[2]], qList[[2]]}}] Row 6 shows a solution, where the third and fourth columns are equal. I could write code to pick out that row automatically (if it exists), but you get the idea. You could do the same thing starting with a quadratic in p instead of q. Starting with a fourth-degree polynomial in y wouldn't work so well. Doing all this by hand is tedious but not really difficult. Bobby Treat -----Original Message----- From: Steven Hodgen [mailto:shodgen at mindspring.com] To: mathgroup at smc.vnet.net Subject: [mg35521] [mg35485] Re: Re: Factoring question Actually, I never posted the actual problem, but here it is: y^4 - (p + q)*y^3 + (p^2*q + p*q^2)*y - p^2*q^2 This factors to: (y^2 - p*q)*(y - p)*(y - q) Which I cannot get. I've tried over an over again, and I'm the best factorer in my class, my instructor can't seem to get this either, hence my hope that Mathematica could do it, and it certainly can no problem, but it just doesn't show how. So, any ideas? --Steven "Ken Levasseur" <Kenneth_Levasseur at uml.edu> wrote in message news:agrjfj$g9n$1 at smc.vnet.net... > Steve: > > I assume that the problem was to solve x^7 + x^5 + x^4 + -x^3 + x + 1=0. If > so, one of the basic factoring theorems is that if a polynomial over the > integers like this one has a rational root r/s, then r must divide the > constant term and s must divide the leading coefficient. So in this problem, > +/-1 are the only possible rational roots and so the (x+1) factor would be > found this way. I'm sure that Mathematica checks this almost immediately. > As for the remaining 6th degree factor, I'm not certain how Mathematica > proceeds, but if you plot it, it clearly has no linear factors. > > Ken Levasseur > > > Steven Hodgen wrote: > > > "DrBob" <majort at cox-internet.com> wrote in message > > news:agbfhl$je9$1 at smc.vnet.net... > > > Factor[x^7 + x^5 + x^4 + -x^3 + x + 1] // Trace > > > > This doesn't do it. It only traces the initial evaluation, and then simply > > displays the factored result with no intermediate factoring steps. > > > > Thanks for the suggestion though. > > > > > > > > Bobby > > > > > > -----Original Message----- > > > From: Steven Hodgen [mailto:shodgen at mindspring.com] To: mathgroup at smc.vnet.net > > > Subject: [mg35521] [mg35485] Factoring question > > > > > > Hello, > > > > > > I just purchased Mathematica 4.1. I'm taking precalculus and wanted to > > try > > > a tough factoring problem, since the teacher couldn't do it either. > > > Mathematica get's the correct answer, but I'm interrested in seeing how it > > > got there. Is there a way to turn on some sort of trace feature where it > > > shows each step it used to get the the final result? > > > > > > Thanks! > > > > > > --Steven > > > > > > > > > > > > > > > > > > > > > > >