# I How to find if a quadratic expression is a perfect square

1. Jul 27, 2016

### rajeshmarndi

How to find if a quadratic expression of the form
4x2 + 4.n.x - P ..........................(x,n and P are natural number)
is a perfect square.

For example,
4x2 + 64x - 31

Thanks.

2. Jul 27, 2016

### Staff: Mentor

If it is a perfect square it can be written as a(x+d)2 = a x2 + 2 a d x + ad2. You can compare the individual summands to determine "a" and "d" and see if all three components fit. For example, take the x2 term to determine a.

Edit: Moved to variables a and d to avoid confusion with other uses of b.

Last edited: Jul 27, 2016
3. Jul 27, 2016

### micromass

Or you can compute the discriminant $D = b^2 - 4ac$.

4. Jul 27, 2016

### rajeshmarndi

Thanks. I mean
4x2 + 64x - 31

will generate
37
113
197
289 (perfect square, for x=4)
.. and so on.

I want to know is there anyway if a quadratic expression will ever generate a perfect square for some 'x' value.

5. Jul 27, 2016

### micromass

Then you'll need to find $n$ and $m$ such that
$$4n^2 + 64n - 31 = m^2$$

I have solved very similar questions already in your previous threads. So I'm sure you can handle it from here.

6. Sep 10, 2016

### rajeshmarndi

I have made a slight change, say now the quadratic expression is ( I have only removed the coefficient of x^2)

x^2 + 648x + 247 = m^2, ( x, m both are integer). Also for some purpose I will be considering quadratic expression where the 'x' term and the constant(here 247) are either odd-even or viceversa.

I can break the above quadratic expression into,

x^2 + ( 2*323*x + 2x ) + ( 323^2 - 2y ) ....(1)
x^2 + ( 2*322*x + 4x ) + ( 322^2 - 4y ) ....(2)
x^2 + ( 2*321*x + 6x ) + ( 321^2 - 6y ) ....(3)

and so on ... untill
x^2 + ( 2*1*x + 2*323*x ) + ( 1^2 - 2*323*y ) ...(323)

Lets take equ(1)
it can be rearrange into
( x^2 + 2*323*x + 323^2 ) + 2(x-y)
(x + 323 )^2 + 2(x-y)

So if x=y, then the above quadratic expression has a perfect square. But since we are only taking x and m as integer, here too y has to be an integer.

Also,
323^2 - 2y = 247
2y = ( 323^2 - 247 )
y = ( 323^2 - 247 ) / 2

which is divisible by 2
i.e y = 52041 ( an integer)

For every such quadratic expression (in the general form, where the x term and the constant are either odd-even or viceversa)
dividing with 2(i.e first equation equ(1) ) is always a perfect square. Which I do not need in my problem.

Similarly for equ(2,3,...), it is
y = ( 322^2 - 247 ) / 4
y = ( 321^2 - 247 ) / 6
y = ( 320^2 - 247 ) / 8 and so on...

If any on the above y value is an integer then the above quadratic expression will have as many perfect square.

But I cannot do them all these manually, I failed to get other any way that can tell me if the quadratic can generate perfect square(ignoring dividing by 2).

Thank you.