# Finding number of solutions for equations involving difference of perfect squares - Hemant Malhotra

• Number of ways in which a natural number can be expressed as difference of two perfect square

let number = N = x^2 - y^2
N = (x - y) (x + y)

Case 1 -
let N = even number * even number ( product of 2 even number let 4 = 2 * 2)
so (x - y) (x + y) = even * even
so x - y = even, x + y = even
2x = even + even
so 2x = even (because sum of even + even = even))
so x = even/2 (which will be an integer)
so in this case we will get a integral value of x and y

Case 2 -
N = even * odd
x^2 - y^2 = even * odd
(x - y) (x + y) = even * odd
x - y = even
x + y = odd
2x = even + odd
2x = odd (because even + odd = odd)
so x = odd/2 ( odd number /2 will not be an integer so in this case we will not an integer value of x and y)

Case 3 -
N = odd * odd
(x - y)(x + y) = odd * odd
x - y = odd
x + y = odd
2x = odd + odd
2x = even (because odd + odd = even as 3 + 3 = 6)
so x=even/2
which will give integral value

so This is just basic thing that when number is expressed as even * even or odd * odd then only we could find integral solutions and number could be expressed as difference of two perfect square number

Type 1 : number which is a multiple of 4

find number of ways in which 20 could be expressed as difference of two perfect square numbers

case1
x^2 - y^2 = 20
(x - y)(x + y) = 20 = 1 * 20 = 2 * 10 = 4 * 5
case1 - (x - y) (x + y) = 2 * 10 (even * even) so we will find integral value here
x - y = 2
x + y = 10
so x = 6
y = 4

case2
(x - y) (x + y) = 4 * 5 ( even * odd not useful for us ))
so total number of positive values of x and y is 1 (6,4)
total solution = 4 * positive integral solutions = 4 * 1 = 4
so total number of solutions = 4

Why we multiplied by 4 here ???
x = 6 and y = 4
so x^2 = 36 and y^2 = 16
so 36 - 16 = 20
but if x=-6 and y=4 then also x^2=36 and y^2=16
if x = 6 and y = -4 (same case)
if x = -6 and y = -4 (same case)
so there will be 4 possible integral values.

DIRECT FORMULA FOR THIS ( number which is multiple of 4)
Find the number of positive integer solutions of equation x2 – y2 = 20
solution: (No of factors after dividing by 4) /2.
Here number=20 and N/4 = 20/4 = 5 and number of factors of 5 = (1+1) = 2
so ans = 2/2 = 1 ( so positive integer values=1 ) and TOTAL = 4 * 1 = 4

Type 2 : NUMBER WHICH IS PERFECT SQUARE

x^2 - y^2 = 16
( x - y ) ( x + y ) = 16 = 1 * 16 = 2 * 8 = 4 * 4

case-1
(x - y) (x + y) = 1 * 16 ( odd * even case rejected)

case-2
(x - y)(x + y) = 2 * 8 (even * even case)
x - y = 2
x + y = 8
so x = 5 and y = 3
(5,3)

case-3
(x - y) (x + y) = 4 * 4
x - y = 4
x + y = 4
so x = 4 and y = 0
(4,0)
so total positive solutions here = 1 only because (4,0) is not a positive solution

Now the other values (5,3) (5,-3)(-5,3)(-5,-3) (4,0)(-4,0)
so total solutions = 6 look here total number of solutions are not 4 * positive numbers but 4 * positive + 2

Direct approach
(No of factors on the right hand side of given after dividing by 4) – 1 }/2.
example:
X2 - Y2=16
DIVIDE 16 BY 4 = 4
NOW NUMBER OF FACTORS OF 4 ( 22 ) = 2 + 1 = 3
NOW ( 3 - 1) / 2 = 1 TOTAL POSITIVE SOLUTIONS = 1
AND TOTAL INTEGRAL = 4 * positive + 2 (in case of perfect square)
so 4 * 1 + 2 = 6 total integral solutions

Practice question : x^2 - y^2 = 36 find number of total integral solution [ Answer is 6 ]

Type 3 : N = 4k+2 form

let number =18 = 4 * 4 + 2 form
x^2 - y^2 = 18
(x - y)(x + y) = 1 * 18 = 2 * 9 = 3 * 6
so all cases are even * odd so there will be no solution for this

NOTE- ANY NUMBER OF 4k+2 form can't be expressed as difference of two perfect square

So x^2 - y^2 = 26 can't be expressed in this form for any integral values of x and y

Type 4 : When number is Odd

x^2 - y^2 = 85
so (x - y)(x + y) = 1 * 85 = 5 * 17
so odd * odd

case1
(x - y)(x + y) = 1 * 85
x - y = 1
x + y = 85
so x = 43
y = 42

case2
(x - y)(x + y) = 5 * 17
x - y = 5
x + y = 17
x=11 ,y=6
so two positive solutions
and 2 * 4 = 8 total integral solutions

DIRECT FORMULA
(No of factors) /2
x^2 - y^2 = 85
85 = 5 * 17 so factors = 2*2 = 4
so 4/2=2 (number of positive integral values =2)
and total = 2 * 4 =8

Some More...

1) x^2-y^2=124 ( find total number of integral solutions)
2) find number of ways in which 256 could be expressed as difference of two perfect square numbers .
3) x^2-y^2=21 ( find number of positive integral solutions)
4) x^2-y^2=122 ( find number of integral solutions)
5) x^2-y^2=100 ( find the no of non negative integral solution? )

Looks like your connection to MBAtious was lost, please wait while we try to reconnect.