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 yCase 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 valueso 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 = 4Case 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 = 4Why 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 = 4Type 2 : Number which is a perfect square
x^2  y^2 = 16
(x  y) (x + y) = 16 = 1 * 16 = 2 * 8 = 4 * 4Case 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 + 2Direct 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 solutionsPractice 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 thisNOTE  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 yType 4 : When number is Odd
x^2  y^2 = 85
so (x  y)(x + y) = 1 * 85 = 5 * 17
so odd * oddCase 1 :
(x  y)(x + y) = 1 * 85
x  y = 1
x + y = 85
so x = 43
y = 42Case 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 solutionsDirect 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 = 8Practice Questions  Set 1
 x^2  y^2 = 124 ( find total number of integral solutions)
 Find number of ways in which 256 could be expressed as difference of two perfect square numbers .
 x^2  y^2 = 21 ( find number of positive integral solutions)
 x^2  y^2 = 122 ( find number of integral solutions)
 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 = 48Case 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 = zeroCase 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 when 4k + 3 form has odd power then number of integral solutions =0
 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 = 16Case 5 : When number is of perfect square form and no 4k + 1 form also then
Number of integral solutions will be 4 onlyExample= x^2 + y^2 = 81 = 3^4
Here number of integral solutions is 4Practice Questions  Set 2
 x^2 + y^2 = 80
 x^2 + y^2 = 80
 x^2 + y^2 = 121
 x^2 + y^2 = 126
 x^2 + y^2 = 120

Set 1
 4
 12
 2
 0

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