A, b are the roots of x² + p x + 1 = 0

let a = [ -p + √(p² - 4) ]/2 and b = [-p -√(p²-4)]/2

* So, a + b = -p and a b = 1*

* => a² + b² = (a+b)² - 2ab = p² - 2*

c and d are the roots of x² + q x + 1 = 0

let c = [-q + √(q²-4) ]/2 and d = [-q - √(q²-4) ]/2

* also, c d = 1 and c + d = - q*

* => c² + d² = (c+d)² - 2cd = q² - 2*

Now, (a - c) (b -c) (a+d) (b+d) : *expand and substitute the above :*

= [ ab + c² -c (a+b) ] [ ab + d² + d(a+b) ]

= [ 1 + c² + c p ] [ 1 + d² - p d ]

= [ 1 + d² - p d + c² + c² d² - c² p d + cp + c p d² - c p² d ]

= [ 1 + c² + d² - p d + (cd)² - cp *cd + cp + pd *cd - p² cd ]

= [ 1 + q² - 2 - p d + 1 - p c + c p + pd - p² ]

= q² - p²

==================

well, you could multiply the other terms also: as follows:

(a-c) (b -c) (a +d ) (b+d) = (a-c)(b+d) (b-c)(a+d)

= [ab + ad - bc- cd ] [ab + bd - ca - cd ]

= [ 1 + ad - bc - 1 ] [ 1 + bd - ca - 1]

= (ad - bc) (bd - ac)

= abd² - a²cd - b²cd + abc²

= d² - a² - b² + c²

= (d² + c²) - (a² + b²)

= q² - 2 - (p² - 2)

= q² - p²