trigonometry · MIT License
Overview
Write an expression such as cos(sin^-1(12x)) or tan(sec^-1(x/3)) as an algebraic expression in x, with the reference triangle and the answer rationalized.
- Owner-tested on a TI calculator
- Version 1.0.0
- 2172 bytes
- No imports
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 inside of the inverse is a positive multiple of x over a whole number or a square root, such as 12x, x/3, 2x/5, or x/sqrt5.
- The triangle is drawn for positive x, so the sides are the usual textbook ones.
- The inside must contain x once, with positive whole numbers: 12x, x/3, 2x/5, or x/sqrt5.
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 write cos(sin^-1(12x)) and similar expressions in terms of x
The idea
An expression such as cos(sin^-1(12x)) asks for the cosine of the angle whose sine is 12x. You do not need the angle. Treat 12x as a ratio, opposite over hypotenuse, draw a right triangle with those sides, and find the third side with the Pythagorean theorem.
Then read the outside function off the triangle as a ratio of two sides. When the answer has a square root in the denominator, multiply the top and bottom by that square root to rationalize it.
The formula
sin^-1(a/b): opp = a, hyp = b, adj = sqrt(b^2 - a^2)
tan^-1(a/b): opp = a, adj = b, hyp = sqrt(a^2 + b^2)
x/sqrt(x^2+9) = x*sqrt(x^2+9)/(x^2+9)
reference triangle- the right triangle built from the inside ratio
rationalize- rewrite a fraction so no square root is left in the denominator
x/sqrt5- how to type x over the square root of 5
Using the program
- Choose the outside function, 1 sin to 6 cot, then the inside inverse, 1 sin^-1 to 6 cot^-1.
- Type the inside as a multiple of x over a whole number or a square root, such as 12x, x/3, 2x/5, or x/sqrt5. Fractions are reduced first, so 4x/6 becomes 2x/3.
- The program shows the inside, the triangle's opp, adj, and hyp, and the ratio the outside function uses.
- The ANSWER comes last. When a square root was in the denominator, the program first shows the form before rationalizing.
Worked example
Write cos(sin^-1(12x)) in terms of x. Choose 2 for cos, 1 for sin^-1, and type 12x.
opp = 12x, hyp = 1, adj = sqrt(1 - 144x^2), cos = adj/hyp
The program shows Triangle: opp 12x, adj sqrt(1-144x^2), hyp 1, then cos = adj/hyp and ANSWER: sqrt(1-144x^2).
For sin(tan^-1(x/3)), choose 1, 3, and type x/3. The triangle has opp x, adj 3, and hyp sqrt(x^2+9). The program shows Before rationalizing: x/sqrt(x^2+9), then the answer xsqrt(x^2+9)/(x^2+9).
For sec(cos^-1(2x/5)), choose 5, 2, and type 2x/5. The adjacent side is 2x and the hypotenuse 5, so the program shows sec = hyp/adj and the answer 5/(2x).
Tips and common mistakes
- Decide which two sides the inside gives you: sin^-1 and csc^-1 use the opposite and hypotenuse, cos^-1 and sec^-1 the adjacent and hypotenuse, tan^-1 and cot^-1 the two legs.
- The hypotenuse is always the longest side, so for sin^-1 and cos^-1 the missing side has a minus sign under the root: b^2 - a^2.
- Read the program's xsqrt(x^2+9) as x times sqrt(x^2+9).
- These answers assume x is positive, as textbooks usually do; for negative x, check the quadrant the angle lands in.
Where this comes up
Rewriting a trig function of an inverse trig function in terms of x is part of the inverse trig unit of precalculus, and calculus uses it with trig substitution in integrals.
Exact reviewed bytes
Source code
def clr():print("\n"*11)def pg():input("[enter]");clr()def pick(p,v):while 1:c=input(p).strip()if len(c)==1 and c in v:return cclr();print("INVERSE TRIG ALGEBRA\n like cos(sin^-1(12x))\n __\n ___(o )> quack!\n \\ <_. )\n `---'\nDuckieDai (TM)\nhiddenwordscanner.com");pg()F=("sin","cos","tan","csc","sec","cot")# inverse -> (opp,adj,hyp,radical type)T=(("K","R","B",1),("R","K","B",1),("K","B","R",2),("B","R","K",3),("R","B","K",3),("B","K","R",2))while 1:o=pick("OUTSIDE:\n1 sin 2 cos 3 tan\n4 csc 5 sec 6 cot\n0 Exit\n> ","0123456")if o=="0":breaki=int(pick("INSIDE inverse:\n1 sin^-1 2 cos^-1\n3 tan^-1 4 csc^-1\n5 sec^-1 6 cot^-1\n> ","123456"))-1s=input("Inside (12x, x/3,\n2x/5, x/sqrt5)? ").replace(" ","").replace("(","").replace(")","").lower()try:n,d=(s.split("/")+["1"])[:2];n=n.replace("x","",1)if "x" not in s or "x" in n+d:raise ValueErrora=int(n) if n else 1;q=0if d[:4]=="sqrt":q=int(d[4:]);b=1else:b=int(d)if a<1 or b<1 or q<0:raise ValueErrorexcept ValueError:print("Type like 12x x/3\nor x/sqrt5");pg();continuer=int(q**.5+.5)if r*r==q:b=r or b;q=0g,h=a,bwhile h:g,h=h,g%hif q:g=1a//=g;b//=g;K=("" if a==1 else str(a))+"x";Q="sqrt("+str(q)+")"op,ad,hy,t=T[i];def X(m):A=a*a*m;A="" if A==1 else str(A);B=str((q or b*b)*m);return (B+"-"+A+"x^2",A+"x^2+"+B,A+"x^2-"+B)[t-1]E=X(1);R="sqrt("+E+")"def S(z):return K if z=="K" else ((Q if q else str(b)) if z=="B" else R)clr();print(F[i]+"^-1("+K+("/"+Q if q else "/"+str(b) if b>1 else "")+")\nTriangle: opp "+S(op)+"\n adj "+S(ad)+"\n hyp "+S(hy))o=int(o)-1;nu,de=((op,hy),(ad,hy),(op,ad),(hy,op),(hy,ad),(ad,op))[o];N=S(nu)if de=="B" and q:r=("sqrt("+X(q)+")" if N==R else N+Q)+"/"+str(q);print("Before rationalizing:\n "+N+"/"+Q)elif de=="B":r=N if b==1 else N+"/"+str(b)elif de=="K":r=N+"/"+(K if a==1 else "("+K+")")else:top=R if N=="1" else ("sqrt("+X(q)+")" if q and N==Q else N+R)r=top+"/("+E+")";print("Before rationalizing:\n "+N+"/"+R)print(F[o]+" = "+("opp/hyp","adj/hyp","opp/adj","hyp/opp","hyp/adj","adj/opp")[o]+"\nANSWER:\n "+r);pg()print("Quack! DuckieDai (TM)\nhiddenwordscanner.com")
- Filename
INVALG.py- Size
- 2172 bytes
- SHA-256
21b3eafc0c54514c64e16e72f79baff7a909da40a3ebc42b4a4394723ae706ee
Usage
Inputs
- The outside function: 1 sin, 2 cos, 3 tan, 4 csc, 5 sec, 6 cot, or 0 to exit
- The inside inverse: 1 sin^-1 to 6 cot^-1
- The inside, such as 12x, x/3, 2x/5, or x/sqrt5
Outputs
- The reference triangle's opposite, adjacent, and hypotenuse in terms of x
- The ratio the outside function uses, such as cos = adj/hyp
- The answer, rationalized, with the form before rationalizing when there was a square root in the denominator
Units: Algebraic expressions in x; no units.
Assumptions and limitations
Assumptions
- The inside of the inverse is a positive multiple of x over a whole number or a square root, such as 12x, x/3, 2x/5, or x/sqrt5.
- The triangle is drawn for positive x, so the sides are the usual textbook ones.
Constraints
- The inside must contain x once, with positive whole numbers: 12x, x/3, 2x/5, or x/sqrt5.
- Fractions are reduced, so 4x/6 becomes 2x/3, and x/sqrt9 becomes x/3.
Known failures
- Negative coefficients, decimals, and expressions such as x+1 are not accepted.
- A square root typed with more than 300 digits 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 published file is the owner's tested source.
- Dependencies
- No imports
- Suggested calculator name
INVALG— 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 INVALG 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.