Solve A = a+b*sqrt(d) = (x+y*sqrt(d))^2 with a,b,x,y rational. First of all, the norm aa-dbb must be square, say NN, or else A is not a square. We get xx+dyy = a, 2xy = b. Substitute y=b/(2x) into the first equation, and solve the resulting quadratic. xx = (a +- sqrt(aa-dbb))/2 = (a +- N)/2. If either (a+N)/2 or (a-N)/2 is square, we get a rational x, and also a rational y. --- Marc LeBrun <mlb@fxpt.com> wrote:
=Bill & Rosemary Cordwell Is there an easy way to tell when a + b*sqrt(k) is a perfect square in the extension field Q(sqrt(k))? [...] I'm particularly interested in when a, b, k are integers...
For some value of "easy":
With JHC's x=sqrt k, if a+bx = (c+dx)^2 then b=2cd, so first off b must be even, and then you could run through factorizations to see if any give you the right value of a=cc+kdd.
Or maybe you could do something by implementing Newton's method in Q(x)?
BTW I've shared RCS's interesting experience of the surprising messiness of such algorithms, such as determining whether p+qx < r+sx for signed p,q,r,s using only integer operations. Heck, I'd even pay $50 for an easy way to generate a+bx in increasing order for a,b >=0 (if you think you have one contact me to negotiate the definition of "easy"<;-).
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail