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
Solve a quadratic inequality using its real roots, leading sign, and endpoint inclusion.
- Owner-tested on a TI calculator
- Downloaded 36 times
- Version 1.0.0
- 3796 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
- The leading coefficient a is nonzero.
- The program solves quadratics only; a zero leading coefficient is outside its supported input domain.
- An a value of zero stops with a division-by-zero error because the quadratic formula divides by 2a.
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 quadratic inequality works
The idea
A quadratic inequality asks where a parabola is above or below the x-axis. The answer is one or two intervals, and the parabola's roots are where the intervals begin and end.
Whether the parabola opens up or down decides which side of the roots you want.
The formula
ax^2 + bx + c > 0 (or >=, <, <=)
a, b, c- whole-number coefficients, with a not 0
roots- where ax^2 + bx + c equals 0
Using the program
- Enter a, b, and c, then choose the inequality: 1 for > 0, 2 for >= 0, 3 for < 0, 4 for <= 0.
- The program shows the roots and the solution in interval notation.
Worked example
Solve x^2 - 5x + 6 < 0. Enter 1, -5, and 6, then choose 3.
The program shows roots 2 and 3 and the solution (2,3): the parabola opens upward, so it is below the axis only between its roots.
Tips and common mistakes
- Round brackets mean the endpoint is not included; square brackets mean it is.
- With no real roots the answer is either all real numbers or the empty set.
- Get 0 on one side before reading off a, b, and c.
Where this comes up
Quadratic inequalities are taught in algebra 2 and college algebra, usually right after solving quadratic equations, and they are needed for domain questions in precalculus.
Go further: Solving Quadratic Equations: Factoring, Completing the Square, or the Formula
Exact reviewed bytes
Source code
"""DuckieDai Quadratic Inequality 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 gcd(a,b):a=abs(a)b=abs(b)while b:a,b=b,a%breturn adef rat(n,d):if d<0:n=-nd=-dg=gcd(n,d)n//=gd//=gif d==1:return str(n)return str(n)+"/"+str(d)def radroot(a,b,d,sgn):# simplify sqrt(d)k=1i=int(sqrt(d))while i>1:if d%(i*i)==0:k=ibreaki-=1r=d//(k*k)A=-bB=sgn*kC=2*ag=gcd(gcd(A,B),C)if g!=0:A//=gB//=gC//=gif C<0:A=-AB=-BC=-Cif abs(B)==1:term="sqrt("+str(r)+")"else:term=str(abs(B))+"*sqrt("+str(r)+")"if A==0:if B<0:top="-"+termelse:top=termelse:if B<0:top=str(A)+"-"+termelse:top=str(A)+"+"+termif C==1:return topreturn "("+top+")/"+str(C)duckiedai_intro("Quad Inequality")a=int(input("a: "))b=int(input("b: "))c=int(input("c: "))print("1 >0")print("2 >=0")print("3 <0")print("4 <=0")op=input("Choice: ")d=b*b-4*a*cif d>0:q=int(sqrt(d))if q*q==d:n1=-b-qn2=-b+qden=2*av1=n1/denv2=n2/dens1=rat(n1,den)s2=rat(n2,den)else:v1=(-b-sqrt(d))/(2*a)v2=(-b+sqrt(d))/(2*a)s1=radroot(a,b,d,-1)s2=radroot(a,b,d,1)if v1>v2:v1,v2=v2,v1s1,s2=s2,s1print("Roots:")print(s1)print(s2)print("Solution:")if a>0:if op=="1":print("(-inf,"+s1+")")print("U ("+s2+",inf)")elif op=="2":print("(-inf,"+s1+"]")print("U ["+s2+",inf)")elif op=="3":print("("+s1+","+s2+")")else:print("["+s1+","+s2+"]")else:if op=="1":print("("+s1+","+s2+")")elif op=="2":print("["+s1+","+s2+"]")elif op=="3":print("(-inf,"+s1+")")print("U ("+s2+",inf)")else:print("(-inf,"+s1+"]")print("U ["+s2+",inf)")elif d==0:s=rat(-b,2*a)print("Root:",s)print("Solution:")if a>0:if op=="1":print("(-inf,"+s+")")print("U ("+s+",inf)")elif op=="2":print("ALL REAL")elif op=="3":print("EMPTY SET")else:print("{"+s+"}")else:if op=="1":print("EMPTY SET")elif op=="2":print("{"+s+"}")elif op=="3":print("(-inf,"+s+")")print("U ("+s+",inf)")else:print("ALL REAL")else:print("No real roots")print("Solution:")if a>0:if op=="1" or op=="2":print("ALL REAL")else:print("EMPTY SET")else:if op=="3" or op=="4":print("ALL REAL")else:print("EMPTY SET")
- Filename
QINQS.py- Size
- 3796 bytes
- SHA-256
90ff0c75184db4cc236faffc540e33191781c872370bbb558d78377f8051218b
Usage
Inputs
- Integer coefficients a, b, and c for ax^2 + bx + c
- One menu choice for strict or inclusive positive or negative results
Outputs
- Roots in simplified rational or radical form
- Interval, singleton, all-real, or empty-set solution
Units: Polynomial coefficients; no physical units.
Assumptions and limitations
Assumptions
- The leading coefficient a is nonzero.
Constraints
- The program solves quadratics only; a zero leading coefficient is outside its supported input domain.
Known failures
- An a value of zero stops with a division-by-zero error because the quadratic formula divides by 2a.
- A menu choice other than 1 to 4 is treated as choice 4.
- Non-integer input uses the calculator Python input error path.
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 before the DuckieDai opening screen and website line were added. The steps after the opening screen are unchanged and were compared with the owner's file on desktop; this exact file has not yet been rerun on a calculator.
- Dependencies
- math
- Suggested calculator name
QINQS— 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 QINQS 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.