The answer is K=(xh+x+h-7)/x
First you multiply the (X+1)(X+H) and get x^2+XH+X+H
Then you set it equal to X^2+KX+7=X^2+XH+X+H
Both X^2 CANCELS then move the 7 over by subtracting it giving you
KX=XH+X+H-7
Then divide by x giving you K by itself the answer bein K=(XH+X-H-7)/X