HP Forums

Full Version: Partial factorization?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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-
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().
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
(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.
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
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-
(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)) ?
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-
factors returns a list with factors and multiplicities.
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-
(4x+1)^2 is not a factor of (16*x^8+8*x^4+1).
Smile Who said it was?

Sad Damn that copy/paste! ....

I meant: (4*x^4 +1)^2
Dear All.
Is this that, what you want?

[attachment=5595]

Best regards

Rudi
You could regroup factors yourself.
Or call sqrfree here.
(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-
Reference URL's