# Number Of Solutions For Equations Involving Difference/Sum 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

Case 1 :

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

Case 2 :

(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 ( number which is multiple of 4)
Find the number of positive integer solutions of equation x^2 – y^2 = 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 a 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:
x^2 - y^2 = 16
Divide 16 by 4 = 4
Number of factors of 4 ( 2^2 ) = 2 + 1 = 3
NOW ( 3 - 1) / 2 = 1
Total positive solutions = 1
Total Integral solutions = 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

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

Case 2 :
(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

Practice Questions - Set 1

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)

Number of ways in which a natural number can be expressed as Sum of two perfect squares

Case 1 - when N is not a perfect square and prime factors in the form 4k + 1

Example : x^2 + y^2 = 5^2 × 13^3
Here 5 and 13 are both are both of form 4k + 1
Number of positive integral solutions = Number of Factors of 5^2 × 13^3 = 12
Total integral solutions = 4 × 12 = 48

Case 2 : when N is a perfect square

Example : x^2+y^2= 5^2 ×13^2
Here number is perfect square and 5 and 13 both are in 4n + 1 form so
Positive integral solutions = Number of Factors - 1= 9 - 1 = 8
Total integral solutions= 4 × 8 + 4 = 36 (we will consider only 4k + 1 form of prime factors)

Extra addition of 4 is for x = +/- 5 * 13 and y = +/- 5 * 13

Case 3- when x^2 + y^2 = 3^2 × 7^3
here 3 and 7 are 4k + 3 form and no 4k + 1 form
So number of integral solutions = zero

Case 4 - x^2 + y^2 = 5^2 × 3^4
here 3 is 4k + 3 form and 5 is 4k+1 form
now 2 cases arise

1. when 4k + 3 form has odd power then number of integral solutions =0
2. when 4k + 3 form has even power then ignore that and find number of factors of 4k + 1 form

Example x^2 + y^2= 5^3 ×7^2
Here 7 is 4k + 3 form but power is even so ignore that now find factors of 5^3 which is 4.
Number of positive integral solutions = 4
and total = 4 × 4 = 16

Case 5 : When number is of perfect square form and no 4k + 1 form also then
Number of integral solutions will be 4 only

Example= x^2 + y^2 = 81 = 3^4
Here number of integral solutions is 4

Practice Questions - Set 2

1. x^2 + y^2 = 80
2. x^2 + y^2 = 80
3. x^2 + y^2 = 121
4. x^2 + y^2 = 126
5. x^2 + y^2 = 120

• Set 1

1. 4
2. 12
3. 2
4. 0

• @vishwa2017 for question no. 2, 256 is a perfect square, so i think answer should be 14

1

1

60

2

1

1

1

1