rational functions · MIT License
Overview
Find a rational function's horizontal asymptote from numerator and denominator degrees and, when needed, leading coefficients.
- Tested on a TI calculator
- Downloaded 48 times
- Version 1.0.0
- 1244 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 function is rational and degrees are entered correctly.
- A zero denominator leading coefficient is invalid.
- The tool does not find slant asymptotes.
Try the DuckieDai calculator screen
Follow the reviewed program prompts and calculation flow before downloading.
TI-84 Plus CE Python · screen preview
Learn the math
How horizontal asymptotes work
The idea
A horizontal asymptote is the height a rational function levels off to as x gets very large in either direction. You find it by comparing the degree of the top with the degree of the bottom.
The formula
top degree < bottom degree: y = 0
top degree = bottom degree: y = (leading coefficient of top)/(leading coefficient of bottom)
top degree > bottom degree: no horizontal asymptote
degree- the highest power of x in a polynomial
leading coefficient- the number in front of that highest power
Using the program
- Enter the degree of the top, then the degree of the bottom.
- If they match, the program asks for both leading coefficients.
Worked example
For (3x^2 + 1)/(4x^2 - 5) both degrees are 2. Enter 2 and 2, then leading coefficients 3 and 4.
The program shows y = 0.75.
Tips and common mistakes
- Only the highest powers matter; every other term fades away for large x.
- A graph can cross its horizontal asymptote. It only has to approach it far out.
- When the top degree is exactly one more than the bottom, there is a slant asymptote instead.
Where this comes up
Horizontal asymptotes are part of the rational functions unit of algebra 2, precalculus, and college algebra, and they come back in calculus as limits at infinity.
Exact reviewed bytes
Source code
"""DuckieDai Horizontal Asymptote Solver for TI-84 Plus CE Python."""def duckiedai_intro(program_name,wait=True):title=program_name[:16];e=16-len(title);l=e//2;r=e-lprint("+----------------------+\n| "+" "*l+title+" "*r+" |\n| |\n| __ |\n| ___(o )> quack! |\n| \\ <_. ) |\n| `---' |\n| by DuckieDai |\n+----------------------+\nLoading...")if wait: input("Press enter to start ");print("\n"*8)def clear_screen(): print("\n"*8)def number(prompt):while True:try:return float(input(prompt))except ValueError:print("Enter a number")def run_solver():clear_screen();print("HORIZ ASYMPTOTE\n--------------\n")top_deg=int(number("Top degree: "));bot_deg=int(number("Bottom degree: "))clear_screen();print("HORIZONTAL\n----------")if top_deg<bot_deg:print("y = 0")elif top_deg>bot_deg:print("NONE")else:print("Same degree\nNeed lead coeffs\n");top=number("Top lead: ");bot=number("Bottom lead: ")if bot==0:print("INVALID\nBottom lead\ncannot be 0")else:print("y =",top/bot)duckiedai_intro("Horiz Asym")while True:run_solver();print("")if input("Again? y/n: ").lower()!="y":breakclear_screen();print("DuckieDai says: done!")
- Filename
HASYMS.py- Size
- 1244 bytes
- SHA-256
1836ea131cf1e48109d1a2d8fa0c3ca2305a93ce4f7b6ea3982278381b39f8ed
Usage
Inputs
- Numerator degree
- Denominator degree
- Leading coefficients when degrees match
Outputs
- y = 0, no horizontal asymptote, or the leading-coefficient ratio
Units: Polynomial degrees and coefficients; no physical units.
Assumptions and limitations
Assumptions
- The function is rational and degrees are entered correctly.
Constraints
- A zero denominator leading coefficient is invalid.
Known failures
- The tool does not find slant asymptotes.
Compatibility and review
- Review status
- Tested on a TI calculator
- Tested on
- Creator-owned TI-84 Plus CE Python calculator; exact .py transferred and launched individually
- What happened
- Passed: creator personally tested the exact Horizontal Asymptote Solver program on a TI 84 Plus CE Python calculator.
- Dependencies
- No imports
- Suggested calculator name
HASYMS— 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 HASYMS 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.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.