Large degree polynomial function

60 Views Asked by At

How does one solve for $x$ in a polynomial of the form $ax^{n} + bx^{\left(n - 1\right)} + c = 0$, given that $n$ is a larger number ?. For example:

$\displaystyle x^{100} - 3x^{99} + 1 = 0$

1

There are 1 best solutions below

0
On BEST ANSWER

I'm still not sure I understand the question, but this is easy with a computer, assuming you want numerical values. I wrote a python script to do this. (Annoyingly, numpy expects the leading coefficient $x^k$ of a polynomial of degre $n$ to be at index $n-k.$)

import numpy as np

p = np.zeros((101))
p[0]=1
p[1]=-3
p[100]=1
roots = np.roots(p)
for idx, root in enumerate(roots):
    print(idx, root)

produces this output instantaneously:

0 (3.000000000000001+0j)
1 (-0.7364491456451218+0.6565561896636651j)
2 (-0.7364491456451218-0.6565561896636651j)
3 (-0.7764559201902995+0.6085861156452325j)
4 (-0.7764559201902995-0.6085861156452325j)
5 (-0.8133485650308432+0.5581912452828626j)
6 (-0.8133485650308432-0.5581912452828626j)
7 (-0.6934865839515425+0.701909773950447j)
8 (-0.6934865839515425-0.701909773950447j)
9 (-0.8469810844038753+0.5055727935082724j)
10 (-0.8469810844038753-0.5055727935082724j)
11 (-0.8772204006792861+0.4509407077743689j)
12 (-0.8772204006792861-0.4509407077743689j)
13 (-0.647738305184038+0.7444654479736014j)
14 (-0.647738305184038-0.7444654479736014j)
15 (-0.9039468754197537+0.39451284443370066j)
16 (-0.9039468754197537-0.39451284443370066j)
17 (-0.5993854422724829+0.7840527747018899j)
18 (-0.5993854422724829-0.7840527747018899j)
19 (-0.9270547780297581+0.3365141137728261j)
20 (-0.9270547780297581-0.3365141137728261j)
21 (-0.548619483695713+0.8205129677981756j)
22 (-0.548619483695713-0.8205129677981756j)
23 (-0.9464527000806124+0.2771755970853744j)
24 (-0.9464527000806124-0.2771755970853744j)
25 (-0.4956415264634955+0.8536995127614468j)
26 (-0.4956415264634955-0.8536995127614468j)
27 (-0.4406614924968664+0.8834787396172576j)
28 (-0.4406614924968664-0.8834787396172576j)
29 (-0.9620639136235793+0.21673363928004163j)
30 (-0.9620639136235793-0.21673363928004163j)
31 (-0.38389731168552527+0.909730344970996j)
32 (-0.38389731168552527-0.909730344970996j)
33 (-0.3255740750583158+0.9323478614682946j)
34 (-0.3255740750583158-0.9323478614682946j)
35 (0.7577303192949743+0.6394431221673114j)
36 (0.7577303192949743-0.6394431221673114j)
37 (0.7970347431023204+0.590099961131214j)
38 (0.7970347431023204-0.590099961131214j)
39 (0.7153872255455767+0.6861568685320916j)
40 (0.7153872255455767-0.6861568685320916j)
41 (0.8331341618753201+0.5383229631320452j)
42 (0.8331341618753201-0.5383229631320452j)
43 (0.6701830619131026+0.7300572029385581j)
44 (0.6701830619131026-0.7300572029385581j)
45 (0.8658742980131764+0.48431875063231544j)
46 (0.8658742980131764-0.48431875063231544j)
47 (0.6223059154766839+0.7709722084480215j)
48 (0.6223059154766839-0.7709722084480215j)
49 (0.5719535879849889+0.8087425205066434j)
50 (0.5719535879849889-0.8087425205066434j)
51 (0.8951137460294047+0.4283044061929457j)
52 (0.8951137460294047-0.4283044061929457j)
53 (0.5193328204049903+0.8432217744454027j)
54 (0.5193328204049903-0.8432217744454027j)
55 (0.9207248128533412+0.3705068199042141j)
56 (0.9207248128533412-0.3705068199042141j)
57 (0.46465850700695943+0.8742770284347632j)
58 (0.46465850700695943-0.8742770284347632j)
59 (0.9425943804458727+0.31116194515065604j)
60 (0.9425943804458727-0.31116194515065604j)
61 (-0.2659231616491491+0.9512390729535296j)
62 (-0.2659231616491491-0.9512390729535296j)
63 (0.4081528934442288+0.9017891596220862j)
64 (0.4081528934442288-0.9017891596220862j)
65 (0.9606247774115534+0.2505139365561644j)
66 (0.9606247774115534-0.2505139365561644j)
67 (0.9747346342048573+0.1888141457593689j)
68 (0.9747346342048573-0.1888141457593689j)
69 (0.35004475520869627+0.9256532298451866j)
70 (0.35004475520869627-0.9256532298451866j)
71 (-0.20518134277364738+0.966326373881672j)
72 (-0.20518134277364738-0.966326373881672j)
73 (0.2905685546336416+0.9457788166930109j)
74 (0.2905685546336416-0.9457788166930109j)
75 (0.9848596842823707+0.1263199581194814j)
76 (0.9848596842823707-0.1263199581194814j)
77 (-0.9738266720335937+0.15542892061869676j)
78 (-0.9738266720335937-0.15542892061869676j)
79 (0.2299635761582389+0.9620903055655939j)
80 (0.2299635761582389-0.9620903055655939j)
81 (-0.14358986755051278+0.977547071822796j)
82 (-0.14358986755051278-0.977547071822796j)
83 (0.1684730408262214+0.9745271385958778j)
84 (0.1684730408262214-0.9745271385958778j)
85 (0.9909534640600726+0.06329346693748208j)
86 (0.9909534640600726-0.06329346693748208j)
87 (0.9929878610066416+0j)
88 (-0.9816944521616785+0.09350551126383294j)
89 (-0.9816944521616785-0.09350551126383294j)
90 (0.10634320197349573+0.9830440167028471j)
91 (0.10634320197349573-0.9830440167028471j)
92 (-0.08139353360287407+0.9848536322040496j)
93 (-0.08139353360287407-0.9848536322040496j)
94 (0.043822424798379056+0.987611051554128j)
95 (0.043822424798379056-0.987611051554128j)
96 (-0.01883974695583218+0.9882138647642805j)
97 (-0.01883974695583218-0.9882138647642805j)
98 (-0.9856361368133812+0.031209912383584327j)
99 (-0.9856361368133812-0.031209912383584327j)  

Is there some reason that this isn't good enough?