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
Test one supplied zero of a cubic, then solve the resulting quadratic quotient when that zero is confirmed.
- Owner-tested on a TI calculator
- Downloaded 36 times
- Version 1.0.0
- 3934 bytes
- Uses math
Tried it? Did this program work on your calculator?
Before you run it
- TI-84 Plus CE Python · No calculator OS or Python App version has been verified.
- TI Connect CE .py transfer to the Python App; the owner's transfer details were not recorded
- Inputs represent a non-degenerate cubic and a valid numeric or p/q zero.
- The solver only continues after the supplied candidate is confirmed as a zero.
- Remainders with magnitude below 1e-7 are treated as zero.
Try the DuckieDai calculator screen
Follow the program's prompts and result flow before downloading.
TI-84 Plus CE Python · screen preview
Learn the math
How solving a cubic from one known zero works
The idea
Once you know one zero of a cubic, dividing it out leaves a quadratic. Solving that quadratic gives the remaining two zeros, real or complex.
This program does both steps in one run.
The formula
ax^3 + bx^2 + cx + d = (x - r)(px^2 + qx + s)
x = (-q +/- sqrt(q^2 - 4*p*s))/(2*p)
r- the zero you supply
p, q, s- coefficients of the quadratic quotient
Using the program
- Enter the four coefficients and one zero. Use a decimal for a fractional zero.
- The program tests it, shows the quadratic quotient, then solves that quadratic.
Worked example
For x^3 - 6x^2 + 11x - 6 with the zero x = 1, enter 1, -6, 11, -6, then 1.
The program shows IT IS A ZERO and the quotient 1 x^2, -5 x, 6, then solves it to give the other two zeros, 3 and 2.
Tips and common mistakes
- If the value is not a zero the program says so and stops there.
- All three zeros together are the answer: the one you entered and the two it finds.
- A negative discriminant in the quadratic step means the other two zeros are complex.
Where this comes up
It fits the polynomial unit of algebra 2, precalculus, and college algebra, for problems that give you one zero and ask for the rest.
Go further: How to Find All the Zeros of a Polynomial
Exact reviewed bytes
Source code
"""DuckieDai Cubic Zero Solver for TI-84 Plus CE Python."""from math import sqrtdef 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" * 8)def clear_screen():print("\n" * 8)def clean_num(n):if abs(n - round(n)) < 0.0000001:return int(round(n))return round(n, 6)def quadratic_solver(a, b, c):disc = b * b - 4 * a * c# SCREEN 3clear_screen()print("QUADRATIC")print("---------")print(clean_num(a), "x^2")print(clean_num(b), "x")print(clean_num(c))print("")print("Discriminant:")print(clean_num(disc))input("\nPress enter ")# SCREEN 4clear_screen()print("OTHER ROOTS")print("-----------")if abs(disc) < 0.0000001:x = -b / (2 * a)print("One repeated root:")print(clean_num(x))elif disc > 0:x1 = (-b + sqrt(disc)) / (2 * a)x2 = (-b - sqrt(disc)) / (2 * a)print("x1 =", clean_num(x1))print("x2 =", clean_num(x2))print("")print("Exact form:")print(clean_num(-b), "+/-")print("sqrt(", clean_num(disc), ")")print("over", clean_num(2 * a))else:real = -b / (2 * a)imag = sqrt(-disc) / abs(2 * a)print("Complex roots:")print(clean_num(real), "+")print(clean_num(imag), "i")print("")print(clean_num(real), "-")print(clean_num(imag), "i")input("\nPress enter ")def number(prompt):text = input(prompt)if "/" in text:parts = text.split("/")return float(parts[0]) / float(parts[1])return float(text)def run_test():clear_screen()print("ENTER CUBIC")print("ax^3+bx^2+cx+d")print("")a = float(input("x^3: "))b = float(input("x^2: "))c = float(input("x: "))d = float(input("Const: "))print("")print("Test zero")print("Use decimal if frac")zero = number("Zero: ")first = asecond = b + first * zerothird = c + second * zeroremainder = d + third * zero# Fix tiny floating errorsif abs(remainder) < 0.0000001:remainder = 0# SCREEN 1clear_screen()print("ZERO TEST")print("---------")print("Test:", clean_num(zero))print("R:", clean_num(remainder))print("")if remainder == 0:print("TRUE!")print("IT IS A ZERO")else:print("FALSE")print("NOT A ZERO")input("\nPress enter ")# If false, stop hereif remainder != 0:return# SCREEN 2clear_screen()print("QUOTIENT")print("--------")print(clean_num(first), "x^2")print(clean_num(second), "x")print(clean_num(third))print("")print("Next:")print("Quadratic formula")input("\nPress enter ")# AUTOMATICALLY SOLVE QUADRATICquadratic_solver(first, second, third)# FINAL SCREENclear_screen()print("ALL ROOTS")print("---------")print("First root:")print(clean_num(zero))print("")print("Other 2 shown")print("on last screen")duckiedai_intro("Cubic Solver")while True:run_test()print("")again = input("Again? y/n: ")if again.lower() != "y":breakclear_screen()print("DuckieDai says: done!")
- Filename
synthD.py- Size
- 3934 bytes
- SHA-256
f4c36ab4cc6940021758957bcd5cb9c3e2beefa62bd56aac0fa11b74e9eb73c6
Usage
Inputs
- Numeric coefficients a, b, c, and d for ax^3 + bx^2 + cx + d
- One decimal or p/q-form proposed zero
Outputs
- True or false zero result
- Quadratic quotient
- Remaining real, repeated, or complex roots when the tested zero is true
Units: Polynomial coefficients; no physical units.
Assumptions and limitations
Assumptions
- Inputs represent a non-degenerate cubic and a valid numeric or p/q zero.
Constraints
- The solver only continues after the supplied candidate is confirmed as a zero.
- Remainders with magnitude below 1e-7 are treated as zero.
Known failures
- Malformed fractions and zero denominators use the calculator Python input error path.
- A zero leading coefficient can create invalid quadratic-formula arithmetic.
Compatibility and review
- Review status
- Owner-tested on a TI calculator
- Tested on
- Owner reports personally testing this program on a TI-84 Plus CE Python calculator; the test date, OS version, and Python App version were not recorded
- What happened
- Owner reported pass on the calculator. The published file is the owner's tested source.
- Dependencies
- math
- Suggested calculator name
SYNTHD— 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 SYNTHD or another name, then open the Python App and try the worked example on this page first. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.
Full installation and troubleshooting guide. Check your teacher's or exam's rules before using any program.
Version history
- 1.0.0 — current version, 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.