Author Topic: math help: nth root of b  (Read 574 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
math help: nth root of b
« on: July 28, 2008, 08:41:43 pm »
I've off and on been searching for an answer for this. I am in request for an algorithm that can calculate all nth roots of b. At the least, n being real positive integer, and b being at the least of real positive; although if possible, b being complex, and not even sure if possible, but n too?
Example:
4th roots of 16 = 2, -2, 2i, -2i
For those who are curious, my reason for the request is for just a smart calculator, and possibly a relation grapher afterwords.


I can figure it out with a little bit of complex factoring by hand, but that would be pretty hard to program imo. Too scared to give it a try, lol. Ex:
4th roots of 1
x^4 = 1
x^4-1 = 0
(x-1)(x+1)(x^2+1) = 0
(x-1)(x+1)(x-i)(x+i) = 0
x = -1, 1, -i, i

4th roots of 4
x^4 = 4
x^4-4 = 0
(x^2-2)(x^2+2) = 0
(x^2-2)(x+sqrt(2)i)(x-sqrt(2)i) = 0
(x^2-2)(x+sqrt(2)i)(x-sqrt(2)i) = 0
(x+sqrt(2))(x-sqrt(2))(x+sqrt(2)i)(x-sqrt(2)i) = 0
x = sqrt(2), -sqrt(2), sqrt(2)i, -sqrt(2)i

(note that commas separate possible values for x)

I've been trying cube roots of 1, but I got stuck while factoring.. I'm not the best at that factoring :P
x^3 = 1
x^3-1 = 0
(x-1)(x^2+x+1) = 0
I guess I could just use the quadratic formula, but I'm trying to avoid that.
so x = 1, and 2 other complex #s

As you can tell, I'm giving the answers in exact form, i don't really need this for what im doing...
« Last Edit: July 28, 2008, 08:45:28 pm by DorkeyDear »

Offline a-4-year-old

  • Veteran
  • *****
  • Posts: 1918
Re: math help: nth root of b
« Reply #1 on: July 28, 2008, 10:39:27 pm »
if you have a graphing calculator program the quadratic formula into it.

its just about the easiest thing ever and it saves SO much time.
If we hit the bullseye the rest of the dominoes will fall like a house of cards. Checkmate. -Zapp Brannigan

Offline Mistercharles

  • Veteran
  • *****
  • Posts: 1371
  • +
Re: math help: nth root of b
« Reply #2 on: July 28, 2008, 11:41:41 pm »
^Err, he's looking for an algorithm. He hardly wants to do all the computations himself, my guess is that his purposes require the computations on demand.

Try the XKCD math forum, they're rather handy at this sort of thing: www.xkcd.com

However, upon registering on the forum, introduce yourself. They hate it if you don't.
shoutout to m'boyz eagles_arrows, echo_trail, wraithlike, sadistatheart, chakapoko maker, jrgp, aznblood, chakra, keron cyst, et al, miss you, let's '#gather some day

Offline frogboy

  • Soldier
  • **
  • Posts: 107
Re: math help: nth root of b
« Reply #3 on: July 29, 2008, 12:38:28 am »
no idea how you'd program it, but you can use modulus-argument form and de Moivre's theorem to find the roots