Answer: \((x-2)^2+(y-1)^2=4\), and \(a=-3\pm2\sqrt5\).
(a) The circle is tangent to the vertical lines \(x=0\) and \(x=4\). Therefore its centre is midway between these lines, so the \(x\)-coordinate of the centre is
\(2.\)
The circle is also tangent to the horizontal lines \(y=3\) and \(y=-1\). Therefore the \(y\)-coordinate of the centre is midway between them:
\(1.\)
The distance from the centre \((2,1)\) to each tangent line is \(2\), so the radius is \(2\). Hence the equation of the circle is
\((x-2)^2+(y-1)^2=4.\)
(b) Substitute \(y=2x+a\) into the circle equation:
\((x-2)^2+(2x+a-1)^2=4.\)
Expand:
\(x^2-4x+4+4x^2+4x(a-1)+(a-1)^2=4.\)
Subtract \(4\) from both sides and collect terms:
\(5x^2+4(a-2)x+(a-1)^2=0,\)
as required.
For the line to be tangent to the circle, this quadratic in \(x\) must have exactly one root. Therefore its discriminant is zero:
\([4(a-2)]^2-4(5)(a-1)^2=0.\)
So
\(16(a-2)^2-20(a-1)^2=0.\)
Divide by \(4\):
\(4(a-2)^2-5(a-1)^2=0.\)
Expanding,
\(4(a^2-4a+4)-5(a^2-2a+1)=0.\)
This gives
\(4a^2-16a+16-5a^2+10a-5=0,\)
so
\(-a^2-6a+11=0.\)
Therefore
\(a^2+6a-11=0.\)
Using the quadratic formula,
\(a=\dfrac{-6\pm\sqrt{36+44}}{2}=\dfrac{-6\pm\sqrt{80}}{2}.\)
Hence
\(a=-3\pm2\sqrt5.\)