-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -

Create an account on the HP Community to personalize your profile and ask a question
05-27-2018 10:52 AM
How can I find all the roots of a polynomial in a hp prime? For example, 3x^5+5x^4+2x^3+8x^2+3x-10=0
Thank you beforehand!
Solved! Go to Solution.
Accepted Solutions
05-31-2018 01:00 AM
Here is some "pseudo-code" to help with your high-school homework:
do x = -10 to +10
y = x* ( x* ( x* ( x* (x*3 +5) +2)+8)+3) -10
say x y
end
that gives the output:
-10 -251240
-9 -145189
-8 -78370
-7 -38741
-6 -17020
-5 -6325
-4 -1814
-3 -325
-2 -16
-1 -5
0 -10
1 11
2 220
3 1259
4 4610
5 12955
6 30536
7 63515
8 120334
9 212075
10 352820
Second try:
do xx = -20 to +20
x = xx / 10
y = x* ( x* ( x* ( x* (3*x +5) +2)+8)+3) -10
say x y
end
gives the output:
-2 -16
-1.9 -9.66047
-1.8 -5.34304
-1.7 -2.64121
-1.6 -1.20128
-1.5 -0.71875
-1.4 -0.93472
-1.3 -1.63229
-1.2 -2.63296
-1.1 -3.79303
-1 -5
-0.9 -6.16897
-0.8 -7.23904
-0.7 -8.16971
-0.6 -8.93728
-0.5 -9.53125
-0.4 -9.95072
-0.3 -10.20079
-0.2 -10.28896
-0.1 -10.22153
0 -10
0.1 -9.61747
0.2 -9.05504
0.3 -8.27821
0.4 -7.23328
0.5 -5.84375
0.6 -4.00672
0.7 -1.58929
0.8 1.57504
0.9 5.68997
1.0 11
1.1 17.79403
1.2 26.40896
1.3 37.23329
1.4 50.71072
1.5 67.34375
1.6 87.69728
1.7 112.40221
1.8 142.15904
1.9 177.74147
2 220
Looking closely:
-1.6 -1.20128
-1.5 -0.71875
-1.4 -0.93472
-1.3 -1.63229
there might possibly be a root in the [-1.6,-1.3] range.
Closer examination disproves this conjecture.
And:
0.7 -1.58929
0.8 1.57504
showing at least one root in the [0.7,0.8] range.
Stepping by 1/100 in the same range gives:
0.71 -1.3095252
0.72 -1.0221359
0.73 -0.7269325
0.74 -0.4237212
0.75 -0.1123047
0.76 0.2075184
0.77 0.5359533
0.78 0.8732091
0.79 1.2194989
showing at least one root in the [0.75,0.76] range.
I hope this helps.
05-31-2018 01:00 AM
Here is some "pseudo-code" to help with your high-school homework:
do x = -10 to +10
y = x* ( x* ( x* ( x* (x*3 +5) +2)+8)+3) -10
say x y
end
that gives the output:
-10 -251240
-9 -145189
-8 -78370
-7 -38741
-6 -17020
-5 -6325
-4 -1814
-3 -325
-2 -16
-1 -5
0 -10
1 11
2 220
3 1259
4 4610
5 12955
6 30536
7 63515
8 120334
9 212075
10 352820
Second try:
do xx = -20 to +20
x = xx / 10
y = x* ( x* ( x* ( x* (3*x +5) +2)+8)+3) -10
say x y
end
gives the output:
-2 -16
-1.9 -9.66047
-1.8 -5.34304
-1.7 -2.64121
-1.6 -1.20128
-1.5 -0.71875
-1.4 -0.93472
-1.3 -1.63229
-1.2 -2.63296
-1.1 -3.79303
-1 -5
-0.9 -6.16897
-0.8 -7.23904
-0.7 -8.16971
-0.6 -8.93728
-0.5 -9.53125
-0.4 -9.95072
-0.3 -10.20079
-0.2 -10.28896
-0.1 -10.22153
0 -10
0.1 -9.61747
0.2 -9.05504
0.3 -8.27821
0.4 -7.23328
0.5 -5.84375
0.6 -4.00672
0.7 -1.58929
0.8 1.57504
0.9 5.68997
1.0 11
1.1 17.79403
1.2 26.40896
1.3 37.23329
1.4 50.71072
1.5 67.34375
1.6 87.69728
1.7 112.40221
1.8 142.15904
1.9 177.74147
2 220
Looking closely:
-1.6 -1.20128
-1.5 -0.71875
-1.4 -0.93472
-1.3 -1.63229
there might possibly be a root in the [-1.6,-1.3] range.
Closer examination disproves this conjecture.
And:
0.7 -1.58929
0.8 1.57504
showing at least one root in the [0.7,0.8] range.
Stepping by 1/100 in the same range gives:
0.71 -1.3095252
0.72 -1.0221359
0.73 -0.7269325
0.74 -0.4237212
0.75 -0.1123047
0.76 0.2075184
0.77 0.5359533
0.78 0.8732091
0.79 1.2194989
showing at least one root in the [0.75,0.76] range.
I hope this helps.