Work out the values of a and b from the identity $x^2 - ax + 144 = (x-b)^2$ How do I solve the following question?

You are given the identity    $x^2-ax+144 = (x-b)^2$
Work out the values of $a$ and $b$.

Question appears in AQA 43005/1H.

Find the Value of $b$
$x^2-ax+144\equiv(x-b)^2$
Expand the right-hand side:
$x^2-ax+144\equiv{x^2-2bx+b^2}$
Find the coefficient $(x=0)$:
$b^2=144$
$\Longrightarrow b=\pm{\sqrt{144}}=\pm12$
Find the Value of $a$
Substitute $b=\pm12$ back into original equation:
$x^2-ax+144\equiv{x^2\pm{24x}+144}$
$\Longrightarrow -ax\equiv\pm{24x}$
Find the coefficient $(x=1)$:
$a=\pm{24}$
Answer
$a=24, b=12$ and $a=-24, b=-12$
Thanks to @J. M. and @Djaian.
