Using the full toolkit? Read the step-by-step Polynomial Toolkit guide for quartic, cubic, and quadratic workflows, worked examples, and a reminder to keep every root you find.
algebra · MIT License
Overview
List possible rational zeros from a polynomial's constant and leading coefficients using the Rational Root Theorem.
- Tested on a TI calculator
- Downloaded 73 times
- Version 1.0.1
- 1757 bytes
- No imports
Tried it? Did this program work on your calculator?
Before you run it
- TI-84 Plus CE Python · tested on OS 5.8.3, Python App 5.8.3.0048
- TI Connect CE .py conversion to a Python AppVar in RAM; physically tested one program at a time
- The program lists candidates, not confirmed roots.
- The leading coefficient cannot be zero.
- A zero constant produces no plus/minus factor list; treat zero as a root separately.
Try the DuckieDai calculator screen
A browser implementation of the documented calculation flow. It does not execute the downloaded Python.
TI-84 Plus CE Python · screen preview
Learn the math
How the Rational Zero Theorem works
The idea
The Rational Zero Theorem narrows down where to look for a polynomial's fraction or whole-number zeros. Every such zero must be a factor of the constant term divided by a factor of the leading coefficient.
It gives a list of candidates, not answers. You still test each one.
The formula
possible zeros = +/- (factors of constant)/(factors of leading coefficient)
constant- the term with no x
leading coefficient- the number in front of the highest power of x
Using the program
- Enter the constant term, then the leading coefficient.
- The program lists every candidate. Each one can be positive or negative.
Worked example
For 2x^3 + x^2 - 7x - 6, enter a constant of 6 and a leading coefficient of 2.
The program lists +/- 1, +/- 1/2, +/- 2, +/- 3, +/- 3/2, and +/- 6. Test them with the Cubic Zero Tester.
Tips and common mistakes
- The polynomial needs whole-number coefficients.
- A polynomial can have zeros that are not on the list: those are irrational or complex.
- Try the simplest candidates, 1 and -1, first.
Where this comes up
The Rational Zero Theorem is part of the polynomial functions unit of algebra 2, precalculus, and college algebra, as the first step in finding the zeros of a cubic or quartic.
Go further: How to Find All the Zeros of a Polynomial
Exact reviewed bytes
Source code
"""DuckieDai Rational Zero Finder for TI-84 Plus CE Python."""def duckiedai_intro(program_name, wait=True):title = program_name[:16]empty = 16 - len(title)left = empty // 2right = empty - leftprint("+----------------------+")print("| " + " " * left + title + " " * right + " |")print("| |")print("| __ |")print("| ___(o )> quack! |")print("| \\ <_. ) |")print("| `---' |")print("| by DuckieDai |")print("| hiddenwordscanner.com|")print("+----------------------+")print("Loading...")if wait:input("Press enter to start ")print("\n" * 6)def gcd(a, b):while b != 0:a, b = b, a % breturn aduckiedai_intro("Rational Zeros")constant = int(input("Constant: "))lead = int(input("Leading coeff: "))if constant < 0:constant = -constantif lead < 0:lead = -leadp_factors = []q_factors = []for i in range(1, constant + 1):if constant % i == 0:p_factors.append(i)for i in range(1, lead + 1):if lead % i == 0:q_factors.append(i)zeros = []for p in p_factors:for q in q_factors:g = gcd(p, q)num = p // gden = q // gpair = (num, den)if pair not in zeros:zeros.append(pair)print()print("Possible zeros:")print("Use +/-")count = 0for pair in zeros:num = pair[0]den = pair[1]if den == 1:print("+/-", num)else:print("+/-", str(num) + "/" + str(den))count += 1if count % 5 == 0:if count < len(zeros):input("Enter for more ")print()print("DuckieDai says: done!")
- Filename
P1RZERO.py- Size
- 1757 bytes
- SHA-256
14bbbefbcb953e9287539001278b99f5b6e97c3efc8c2551d346757052cb5b07
Usage
Inputs
- Constant coefficient
- Leading coefficient
Outputs
- Unique positive rational-factor pairs; use plus or minus for each candidate
Units: Coefficients are integers.
Assumptions and limitations
Assumptions
- The program lists candidates, not confirmed roots.
Constraints
- The leading coefficient cannot be zero.
Known failures
- A zero constant produces no plus/minus factor list; treat zero as a root separately.
Compatibility and review
- Review status
- Tested on a TI calculator
- Tested on
- Owner-tested TI-84 Plus CE Python calculator; exact branded .py transferred and launched individually
- What happened
- Passed: owner tested the exact 1.0.1 branded source bytes on a TI 84 Plus CE Python calculator.
- Dependencies
- No imports
- Suggested calculator name
P1RZERO— you can give it another valid, unique name when you transfer it- Desktop test cases
- Not available for this interactive-only source
This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.
Transfer and launch
Download the .py file, send it to your calculator with TI Connect CE as P1RZERO or another name, then open the Python App and try the worked example on this page first.
Full installation and troubleshooting guide. Check your teacher's or exam's rules before using any program.
Version history
- 1.0.1 — current version, published . Download this reviewed version
- 1.0.0 — superseded by 1.0.1, published . Download this reviewed version
Related learning
Did a DuckieDai program help with your homework? Every program here is free. If you would like to say thanks, you can leave a tip on Cash App ($duckiedai214) or read what tips pay for.
Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.
Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters, and so does a Yes or No answer about whether the program worked. Your browser notes that you answered; that note is never sent to the site. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.