# Math/Calculator programming question

**URL:** <https://boards.straightdope.com/t/math-calculator-programming-question/271765>\
**Category:** Factual Questions\
**Created:** [October 29, 2004, 12:57am UTC](https://boards.straightdope.com/t/math-calculator-programming-question/271765 "2004-10-29T00:57:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![quelquechose](https://avatars.discourse-cdn.com/v4/letter/q/6f9a4e/32.png) [@quelquechose](https://boards.straightdope.com/u/quelquechose)\
**Post date:** [October 29, 2004, 12:57am UTC](https://boards.straightdope.com/t/math-calculator-programming-question/271765/1 "2004-10-29T00:57:34Z")

</div>

I’m trying to make a program for my TI-89 that finds the exact values of the roots of a cubic polynomial when all three are real and not equal. Is this even possible, and if so, how do I do it?

---

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [October 29, 2004, 1:01am UTC](https://boards.straightdope.com/t/math-calculator-programming-question/271765/2 "2004-10-29T01:01:06Z")

</div>

Hi.

Here is a page on my website that tells you how to find the roots of a cubic equation:  
[www.1728.com/cubic2.htm](http://www.1728.com/cubic2.htm)

and here’s a calculator that does it:  
[www.1728.com/cubic.htm](http://www.1728.com/cubic.htm)

---

<div class="post-metadata">

**Author:** ![chaoticbear](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@chaoticbear](https://boards.straightdope.com/u/chaoticbear)\
**Post date:** [October 29, 2004, 1:02am UTC](https://boards.straightdope.com/t/math-calculator-programming-question/271765/3 "2004-10-29T01:02:02Z")

</div>

Umm… not necessary. Hit F2, and choose solve. Syntax for sample equation “x^3+x^2+x+1” would be:  
“solve(x^3+x^2+x+1=0,x)”, without the quotes.

---

<div class="post-metadata">

**Author:** ![quelquechose](https://avatars.discourse-cdn.com/v4/letter/q/6f9a4e/32.png) [@quelquechose](https://boards.straightdope.com/u/quelquechose)\
**Post date:** [October 29, 2004, 1:23am UTC](https://boards.straightdope.com/t/math-calculator-programming-question/271765/4 "2004-10-29T01:23:01Z")

</div>

> [@chaoticdonkey](#):
>
> Umm… not necessary. Hit F2, and choose solve. Syntax for sample equation “x^3+x^2+x+1” would be:  
> “solve(x^3+x^2+x+1=0,x)”, without the quotes.

Yes, but that only gives approximate roots when they’re irrational.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [October 29, 2004, 3:22am UTC](https://boards.straightdope.com/t/math-calculator-programming-question/271765/5 "2004-10-29T03:22:07Z")

</div>

What you want to do is possible, but not easy.

---

<div class="post-metadata">

**Author:** ![emarkp](https://avatars.discourse-cdn.com/v4/letter/e/3be4f8/32.png) [@emarkp](https://boards.straightdope.com/u/emarkp)\
**Post date:** [October 29, 2004, 4:27am UTC](https://boards.straightdope.com/t/math-calculator-programming-question/271765/6 "2004-10-29T04:27:33Z")

</div>

> [@quelquechose](#):
>
> Yes, but that only gives approximate roots when they’re irrational.

Um, **all** finite representations of irrationals are approximate. 😉

---

<div class="post-metadata">

**Author:** ![MikeS](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@MikeS](https://boards.straightdope.com/u/MikeS)\
**Post date:** [October 29, 2004, 5:08am UTC](https://boards.straightdope.com/t/math-calculator-programming-question/271765/7 "2004-10-29T05:08:43Z")

</div>

You could always use the [Inverse Symbolic Calculator](http://www.cecm.sfu.ca/projects/ISC/ISCmain.html) on your approximate numerical results.
