Hidden WordScanner
Private scans · No account required

DuckieDai Inverse Trig Algebra

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.

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

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.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

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

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

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

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. def clr():print("\n"*11)
  2. def pg():input("[enter]");clr()
  3. def pick(p,v):
  4. while 1:
  5. c=input(p).strip()
  6. if len(c)==1 and c in v:return c
  7. clr();print("INVERSE TRIG ALGEBRA\n like cos(sin^-1(12x))\n __\n ___(o )> quack!\n \\ <_. )\n `---'\nDuckieDai (TM)\nhiddenwordscanner.com");pg()
  8. F=("sin","cos","tan","csc","sec","cot")
  9. # inverse -> (opp,adj,hyp,radical type)
  10. 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))
  11. while 1:
  12. o=pick("OUTSIDE:\n1 sin 2 cos 3 tan\n4 csc 5 sec 6 cot\n0 Exit\n> ","0123456")
  13. if o=="0":break
  14. i=int(pick("INSIDE inverse:\n1 sin^-1 2 cos^-1\n3 tan^-1 4 csc^-1\n5 sec^-1 6 cot^-1\n> ","123456"))-1
  15. s=input("Inside (12x, x/3,\n2x/5, x/sqrt5)? ").replace(" ","").replace("(","").replace(")","").lower()
  16. try:
  17. n,d=(s.split("/")+["1"])[:2];n=n.replace("x","",1)
  18. if "x" not in s or "x" in n+d:raise ValueError
  19. a=int(n) if n else 1;q=0
  20. if d[:4]=="sqrt":q=int(d[4:]);b=1
  21. else:b=int(d)
  22. if a<1 or b<1 or q<0:raise ValueError
  23. except ValueError:print("Type like 12x x/3\nor x/sqrt5");pg();continue
  24. r=int(q**.5+.5)
  25. if r*r==q:b=r or b;q=0
  26. g,h=a,b
  27. while h:g,h=h,g%h
  28. if q:g=1
  29. a//=g;b//=g;K=("" if a==1 else str(a))+"x";Q="sqrt("+str(q)+")"
  30. op,ad,hy,t=T[i];
  31. 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]
  32. E=X(1);R="sqrt("+E+")"
  33. def S(z):return K if z=="K" else ((Q if q else str(b)) if z=="B" else R)
  34. 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))
  35. o=int(o)-1;nu,de=((op,hy),(ad,hy),(op,ad),(hy,op),(hy,ad),(ad,op))[o];N=S(nu)
  36. if de=="B" and q:r=("sqrt("+X(q)+")" if N==R else N+Q)+"/"+str(q);print("Before rationalizing:\n "+N+"/"+Q)
  37. elif de=="B":r=N if b==1 else N+"/"+str(b)
  38. elif de=="K":r=N+"/"+(K if a==1 else "("+K+")")
  39. else:
  40. top=R if N=="1" else ("sqrt("+X(q)+")" if q and N==Q else N+R)
  41. r=top+"/("+E+")";print("Before rationalizing:\n "+N+"/"+R)
  42. print(F[o]+" = "+("opp/hyp","adj/hyp","opp/adj","hyp/opp","hyp/adj","adj/opp")[o]+"\nANSWER:\n "+r);pg()
  43. 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

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.