HP Forums
Partial factorization? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Partial factorization? (/thread-10012.html)



Partial factorization? - DrD - 01-25-2018 10:26 AM

Example: sqrt(16*x^8+8*x^4+1);

One factorization of the underlying expression works out nicely, namely: (4*x^4 +1)^2

The factor() command returns the fully factorized expression: factor(16*x^8+8*x^4+1) ==> (2*x^2-2*x+1)*(2*x^2+2*x+1)

How can the partial factorization, (4*x^4 +1)^2, be obtained using prime commands?

-Dale-


RE: Partial factorization? - Joe Horn - 01-25-2018 01:15 PM

I don't know how Prime can know which "partial factor" you want. Same problem as noting that sqrt(144) = 12, but ifactor(144) factors all the way down. But 12 is in the idivis(144) list. So one approach you can try for your example is to use divis() instead of factor().


RE: Partial factorization? - Arno K - 01-25-2018 01:35 PM

Hm, I had tried some commands on that and left out divis(), this is what my VC calculates:[1,2*x^2-2*x+1,(2*x^2-2*x+1)^2,2*x^2+2*x+1,(2*x^2+2*x+1)*(2*x^2-2*x+1),(2*x^2+2*x+1)*(2*x^2-2*x+1)^2,(2*x^2+2*x+1)^2,(2*x^2+2*x+1)^2*(2*x^2-2*x+1),(2*x^2+2*x+1)^2*(2*x^2-2*x+1)^2],
4x^4+1 is not in the list. Simplify set to maximum provides the wished result, the fifth entry, but how to find out...
Arno


RE: Partial factorization? - DrD - 01-25-2018 02:42 PM

(01-25-2018 01:15 PM)Joe Horn Wrote:  I don't know how Prime can know which "partial factor" you want. Same problem as noting that sqrt(144) = 12, but ifactor(144) factors all the way down. But 12 is in the idivis(144) list. So one approach you can try for your example is to use divis() instead of factor().

I don't know if it is fair play, or not, but one way to know which partial factor is wanted, would be if a command existed that presented a list of all factors.

Since my example was begging for a perfect square to rid itself of the radical, just eyeballing a list of factors would be useful. A command similar to the divis(), but (4*x^4 +1)^2 doesn't directly show up in the resulting vector:

divis(16*x^8+8*x^4+1);

[ 1,
2*x^2-2*x+1,
(2*x^2-2*x+1)^2,
2*x^2+2*x+1,
(2*x^2+2*x+1)*(2*x^2-2*x+1),
(2*x^2+2*x+1)*(2*x^2-2*x+1)^2,
(2*x^2+2*x+1)^2,
(2*x^2+2*x+1)^2*(2*x^2-2*x+1),
(2*x^2+2*x+1)^2*(2*x^2-2*x+1)^2
]

So far anyway, I haven't found a way to do this, directly, on the prime.


RE: Partial factorization? - Arno K - 01-25-2018 05:27 PM

As I don't know what exactly want to do, here is a way to get your desired result:
(4*simplify(ΠLIST(x-cZeros(16*x^8+8*x^4+1))))^2, works, as the root can be taken.
Arno


RE: Partial factorization? - DrD - 01-25-2018 06:19 PM

No. That's much too cumbersome! The idea is a simple root solution, so I need this particular factorization, in that particular example, so:

\[\sqrt{16 {{x}^{8}}+8 {{x}^{4}}+1} = \sqrt{(4 {{x}^{4}}+1)^{2}} = {4*{x}^{4}+1}\]

I hope the latex works! (Square root of the expression squared is the idea).

-Dale-


RE: Partial factorization? - Didier Lachieze - 01-25-2018 07:33 PM

(01-25-2018 06:19 PM)DrD Wrote:  No. That's much too cumbersome! The idea is a simple root solution

What about: simplify(sqrt(16*x^8+8*x^4+1)) ?


RE: Partial factorization? - DrD - 01-25-2018 10:46 PM

That certainly does the trick! It's not exactly in line with the idea of factoring, at least as far as factoring by hand is concerned, but it gets the job done, and that was the whole point.

Thank you for that very helpful suggestion, Didier. You always seem to come up with the neatest ideas for things like these. I'm not sure how you do it, but I sure am glad you do!

-Dale-


RE: Partial factorization? - parisse - 01-26-2018 06:32 AM

factors returns a list with factors and multiplicities.


RE: Partial factorization? - DrD - 01-26-2018 11:30 AM

factors(16*x^8+8*x^4+1); ==> [2*x^2-2*x+1,2,2*x^2+2*x+1,2]; Unfortunately, (4*x^4+1)^2, is not included in the results vector.

This is an important factorization. A problem solving process I was validating, led to finding the square root of 16*x^8+8*x^4+1. By hand, finding the square root of an expression squared, is easy. I was using the prime to confirm, step by step, a lengthy problem, where understanding the problem solving method is just as important as the solution to the problem.

Can you think of a way to factor 16*x^8+8*x^4+1, (using the prime), that does include (4*x^4+1)^2?
I needed it to find a square root, and Didier's approach gets there, but more in general, I haven't found a command that includes a full factorization chain.

Thanks,

-Dale-


RE: Partial factorization? - parisse - 01-26-2018 04:43 PM

(4x+1)^2 is not a factor of (16*x^8+8*x^4+1).


RE: Partial factorization? - DrD - 01-26-2018 05:07 PM

Smile Who said it was?

Sad Damn that copy/paste! ....

I meant: (4*x^4 +1)^2


RE: Partial factorization? - Rudi - 01-26-2018 07:13 PM

Dear All.
Is this that, what you want?

[attachment=5595]

Best regards

Rudi


RE: Partial factorization? - parisse - 01-26-2018 07:32 PM

You could regroup factors yourself.
Or call sqrfree here.


RE: Partial factorization? - DrD - 01-26-2018 08:03 PM

(01-26-2018 07:32 PM)parisse Wrote:  You could regroup factors yourself.
Or call sqrfree here.

That worked very well! Thank you kind sir! That's a new command for me, never tried it before.

-Dale-