If you expand (x^2+5x-1)^2 => then the expression will have terms with x^4, X^3, X^2 , X and only one non-x term.. which will be 1^2=1
so, the left hand of the expression has some terms with x^4, X^3, X^2 , X and one constant 1-25=-24
similarly the right hand of the expression will have one non-x term abcd..
considering that each constant terms will be equal , adcd=-24
you might argue that what if the right and left side of the expression are not exactly similar.. for eg x^2-1x+k=X^2+5x-j
which is possible, but in that case we can solve this problem..