The Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

Diophantine Equation to Find Perfect Square Values

Date: 03/19/2008 at 20:58:19
From: Peter
Subject: try to find integers to a polynomial

I would like to know how to prove whether there are positive integers
for long polynomials that would form a perfect square, such as 4x^4 +
x^3 + 2x^2 + x + 1, and x^4 + x^3 + x^2 + x + 1.  I don't want an
answer but I just need help on how I would approach this kind of

I thought that I would set the polynomial equal to a variable that is
squared and try to solve the equation in terms of that variable to get
the answer, but I later realized that if this was the case then there
could be an infinite amount of answers but I know that there aren't an
infinite amount of answers.  I was unable to factor out the long
polynomial.  Thanks in advance.

Date: 03/21/2008 at 20:00:23
From: Doctor Vogler
Subject: Re: try to find integers to a polynomial

Hi Peter,

Thanks for writing to Dr. Math.  When you're looking for solutions 
that are integers (or positive integers), then you call that a 
Diophantine equation.  Diophantine equations are not easy to solve.  
Certain kinds (like linear ones) we can solve without too much work.  
Others (like two-variable quadratic ones) we can solve but they take a 
lot of work.  Still others we can't solve at all.

But you can learn a lot of math by learning to solve Diophantine
equations, and I personally think they're a lot of fun.

You mentioned two particular Diophantine equations, and described a
whole group of them.  That group is teetering right there on the edge
of what today's mathematicians can solve.

But the two you described are special in two ways:  First of all, the
polynomial has even degree.  Second, the leading coefficient is a 
square (namely, 1 or 4).  Because of this, we can solve those two
equations.  Here's how it goes.

First notice that if n and m are integers, then either n^2 = m^2, or
n^2 and m^2 differ by at least 2n - 1.  Why is that?  Because the
closest perfect square to n^2 is (n-1)^2.

Now let's complete the square on your polynomial.  Suppose that x and
y are both integers, and

  y^2 = 4x^4 + x^3 + 2x^2 + x + 1.

Then the right side is close to the polynomial

  (2x^2 + 1/4*x + 31/64)^2.

In order to keep things integers, we'll multiply both sides of the
equation by 64^2.  Then your equation is equivalent to

  (64y)^2 = (128x^2 + 16x + 31)^2 + 3104x + 3135.

Now we apply the statement I made earlier using m = 64y and

  n = 128x^2 + 16x + 31.

That is, either n^2 = m^2, which means that 3104x + 3135 = 0 (and I'll
let you explain why no integer satisfies this equation), or n^2 and
m^2 differ by at least 2n - 1.  That means that

  abs(3104x + 3135) >= 256x^2 + 32x + 61.

(That's "the absolute value of.")  But this is impossible if x > 13 or
x < -12.  And you can just check the x values in between.  You get a
square only for x=0 and x=1.  So all integer solutions are

  (x, y) = (0, 1), (0, -1), (1, 3), and (1, -3).

You can do something similar for the other polynomial you gave.  I'll
leave it up to you.

Unfortunately, when the leading coefficient is not a square, or if the
degree of the polynomial is odd, then this method won't work.

But sometimes if there are *no* solutions, then you can prove this
using modular arithmetic.

  Mod, Modulus, Modular Arithmetic 

On the other hand, if the degree is 2, then even if the leading
coefficient is not a square, there are ways to find all integer 
solutions.  And if the degree is 3, then you have an elliptic curve,
and there are methods (some of which are rather complicated) to find
all integer solutions.  But in other cases (odd degree higher than 3,
or non-square leading coefficients with any degree higher than 3), the
problem is *much* harder.

If you have any questions about this or need more help, please write
back and show me what you have been able to do, and I will try to
offer further suggestions.

- Doctor Vogler, The Math Forum 

Date: 03/22/2008 at 15:25:53
From: Peter
Subject: try to find integers to a polynomial

Thank you for your response.  It was very helpful, and I learned a lot
more about these types of problems.

Associated Topics:
High School Number Theory

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.