exponential functions · MIT License
Overview
Solve exponential equations of the form b^(a*x+c) = R step by step: match the exponents with a logarithm, solve for x, and check the answer.
- Owner-tested on a TI calculator
- Version 1.0.0
- 1340 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 equation has the form b^(a*x+c) = R, with one base and one exponent that is linear in x.
- Answers that are whole numbers or fractions with a bottom of 64 or less are shown exactly; others are rounded to six decimal places.
- The base b must be greater than 0 and cannot be 1, and the right side R must be greater than 0.
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 to solve exponential equations
The idea
An exponential equation has x in the exponent, as in 2^(3x - 1) = 32. To solve it, bring the exponent down: take a logarithm with the same base on both sides, and the equation becomes an ordinary linear one.
When the right side is an exact power of the base, such as 32 = 2^5, the logarithm is a whole number and you can do it in your head. When it is not, the logarithm gives a decimal answer instead.
The formula
b^(a*x+c) = R means a*x + c = log_b(R)
log_b(R) = ln(R)/ln(b)
x = (log_b(R) - c)/a
b- the base: positive and not 1
a- the number multiplying x in the exponent
c- the number added in the exponent; for 3x - 1, c is -1
R- the right side, which must be positive
Using the program
- Choose 1 to solve, then enter b, a, c, and R. Decimals and fractions such as 1/8 are accepted.
- The first screen, MATCH EXPONENTS, shows a*x+c and a*x, the steps you would write by hand.
- The SOLUTION screen shows x exactly when it is a whole number or a simple fraction, then the decimal, then a check of b^(a*x+c) using that x.
- When a is 0 there is no x in the exponent, so the program says whether every x works or none does.
Worked example
Solve 2^(3x - 1) = 32. Choose 1 and enter b = 2, a = 3, c = -1, and R = 32.
3x - 1 = log_2(32) = 5, so 3x = 6
The program shows a*x+c = 5 and a*x = 6, then x = 2 with Decimal: 2.0 and Check: 32.0.
Solve 5^(2x) = 7, where 7 is not a power of 5. Enter b = 5, a = 2, c = 0, and R = 7. The program shows a*x+c = 1.209062, then x = 0.604531 and Check: 7.0.
Tips and common mistakes
- Write the equation in the form b^(a*x+c) = R first. For 3^(x+2) = 1/9, b = 3, a = 1, c = 2, and R = 1/9, which gives x = -4.
- A positive base raised to any power is positive, so a right side of 0 or a negative number has no solution.
- Use the Check line: it should match R, apart from rounding.
Where this comes up
Exponential equations are solved in the exponential and logarithmic functions unit of algebra 2, precalculus, and college algebra, and the same steps solve growth, decay, and compound interest problems for time.
Go further: Logarithm Rules and How to Solve Exponential Equations
Exact reviewed bytes
Source code
# DuckieDai(TM) Exp Eq 3.4# Solve b^(a*x+c)=Rfrom math import logdef number(p):while 1:try:s=input(p).strip()if '/' in s:n,d=s.split('/')return float(n)/float(d)return float(s)except:print('Try 3, -2, 1/8')def fmt(v):if abs(v-round(v))<1e-8:return str(int(round(v)))for d in range(2,65):n=round(v*d)if abs(v-n/d)<1e-8:return str(n)+'/'+str(d)return str(round(v,6))def pause():input('Enter >')print('\n'*7)print('DUCKIEDAI(TM)')print('EXP EQUATION 3.4')print(' __')print(' ___(o )> quack!')print(' \\ <_. )')print(" `---'")print('by DuckieDai')print('hiddenwordscanner.com')pause()while 1:print('b^(a*x+c)=R')print('1 Solve 2 Quit')if input('Choice? ')!='1':breakprint('\n'*7)b=number('Base b? ')a=number('x coeff a? ')c=number('Constant c? ')r=number('Right side R? ')if b<=0 or b==1 or r<=0:print('Base >0, not 1')print('Right side >0')elif a==0:print('No x in exponent')print('All x work' if abs(b**c-r)<1e-8 else 'No solution')else:e=log(r)/log(b)x=(e-c)/aprint('\n'*7)print('MATCH EXPONENTS')print('a*x+c =',fmt(e))print('a*x =',fmt(e-c))pause()print('SOLUTION')print('x =',fmt(x))print('Decimal:',round(x,6))print('Check:',round(b**(a*x+c),6))pause()print('DuckieDai(TM) done!')
- Filename
EXPEQ34.py- Size
- 1340 bytes
- SHA-256
d73d13ec85d46e836a038ec7afaebe36aa3273415b24eeb111845a8253aa971a
Usage
Inputs
- Menu choice: 1 to solve or 2 to quit
- Base b
- The coefficient a of x and the constant c in the exponent
- The right side R
Outputs
- The matched exponent a*x+c and the value of a*x
- The solution x, exactly when possible, and as a decimal
- A check of b^(a*x+c) using the solution
Units: Pure numbers; no physical units.
Assumptions and limitations
Assumptions
- The equation has the form b^(a*x+c) = R, with one base and one exponent that is linear in x.
- Answers that are whole numbers or fractions with a bottom of 64 or less are shown exactly; others are rounded to six decimal places.
Constraints
- The base b must be greater than 0 and cannot be 1, and the right side R must be greater than 0.
- Numbers may be typed as decimals or as a fraction such as 1/8; anything else asks again.
Known failures
- When a is 0 there is no x in the exponent; the program reports whether every x works or none does.
- A right side or base so large or small that the logarithm is infinite stops the program with an error.
Compatibility and review
- Review status
- Owner-tested on a TI calculator
- Tested on
- Owner reports personally running 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 file is published exactly as provided; this exact file has not yet been rerun on a calculator.
- Dependencies
- math
- Suggested calculator name
EXPEQ34— 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 EXPEQ34 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.