Help finding a centre of a circle I have been trying to work out this problem for hours but I cannot get it. A circle has its centre on the positive $x$-axis at $(a,0)$. The radius of this circle is $4$. Lines $y=2x$ and $y=-2x$ are tangent to the circle. I have to find the $x$-coordinate $a$.
So I get that the equation for this circle should be $(x-a)^2+y^2=16$, and then I figure that I have to substitute $2x$ in this equation for the $y$, so I would get $(x-a)^2 + 4x^2=16$.  After this, I don't know what to do to get $a$. Any help? Thanks
 A: Hint:
The distance of the center of the circle from the lines $y=\pm2x$ is $4$. Use the fact that the distance between the point $(x_0,y_0)$ and the line $ax+by+c=0$ is $$\left | \frac{ax_0+by_0+c}{\sqrt{a^2+b^2}} \right|$$
A: The approach given by Tavish is the easier method. But this Alternate method is going along the steps you have already taken.
since $y=2x$ is a tangent to the circle $(x-a)^2+y^2=16$ on solving both the equations simultaneously we should get repeated roots.
i.e., the quadratic(in $x$) $(x-a)^2+(2x)^2=16$ has $D=0$ (Discriminant of the quadratic)
A: Since the center of the circle lies on the $x$-axis, the circle touches the lines $y=2x, y=-2x$, which are equally inclined from the $x$-axis, at the same $x$ and therefore, $\text{Discriminant}\left((x-a)^2+4x^2=16\right)=0\Rightarrow4a^2=4\cdot5(a^2-16)\Rightarrow a=2\sqrt5$.
A: Guide:
The angle between $y=2x$ and the $x$-axis is $\theta$ where $\tan \theta = 2$.
Let the intersection between $y=2x$ and the radius be $P$. Let the center be $A$. Consider $\triangle OAP$,
We have $$\sin \theta = \frac{4}{a}$$
I will leave the task of finding $\sin \theta$ to you.

A: Why not just solve the quadratic?  Collect like terms in $x$ as follows.  Move everything to one side to get $$(x-a)^2 + 4x^2 - 16 = 0.$$  Then expand the square:
$$\begin{align}
0 &= x^2 - 2ax + a^2 + 4x^2 - 16 \\
&= 5x^2 - 2ax + a^2 - 16.
\end{align}$$
Then using the quadratic formula gives you $$x = \frac{2a \pm \sqrt{(-2a)^2 - 4(5)(a^2-16)}}{2(5)} = \frac{a \pm 2\sqrt{20-a^2}}{5}.$$  This means the intersection of the line and the circle will have two solutions if $a^2 - 20 > 0$, no solutions if $a^2 - 20 < 0$, and exactly one solution if $a^2 - 20 = 0$.  Since the line is supposed to be tangent, $a$ must satisfy the last case, hence $a = 2\sqrt{5}$.  We take the positive value for $a$ since we know the circle's center is on the positive $x$-axis.

Alternatively, we can exploit the geometry of similar right triangles.  Let $P = (x_0, 2x_0)$ be the point of tangency of the line $y = 2x$ with the circle, and let the origin be $O = (0,0)$ and the center of the circle $A = (a,0)$.  Let $Q = (x_0, 0)$ be the foot of the perpendicular from $P$ to the $x$-axis.  Then we have $$\triangle PQO \sim \triangle APO,$$ hence $$\frac{AP}{PO} = \frac{PQ}{QO} = \frac{2x_0}{x_0} = 2.$$  Since $AP = 4$, the radius of the circle, it follows that $PO = 2$, and by the Pythagorean theorem, $$a = AO = \sqrt{AP^2 + PO^2} = \sqrt{4^2 + 2^2} = \sqrt{20} = 2 \sqrt{5}.$$
