I would use coordinate geometry, and put A initially at \((12,0)\) and B at the origin. Without loss of generality we can let their speeds be 1 unit of distance per 1 unit of time.
For the first leg of B's path, let's let that path be described parametrically by the line:
[MATH]\left\langle \frac{1}{\sqrt{a^2+1}}t,\frac{a}{\sqrt{a^2+1}}t \right\rangle[/MATH]
A's location is on the line:
[MATH]\langle 12-t,0\rangle[/MATH]
The square of distance \(D\) between A and B is then:
[MATH]D^2=\left(\frac{1}{\sqrt{a^2+1}}t-(12-t)\right)^2+\left(\frac{a}{\sqrt{a^2+1}}t\right)^2[/MATH]
Use of differential calculus reveals that the minimum distance is
[MATH]D_{\min}=72\left(1-\frac{1}{\sqrt{a^2+1}}\right)[/MATH]
We want this to be 36 units, hence:
[MATH]72\left(1-\frac{1}{\sqrt{a^2+1}}\right)=36[/MATH]
And taking the positive root, we obtain:
[MATH]a=\sqrt{3}[/MATH]
This minimum occurs then for:
[MATH]6^2=\left(\frac{3}{2}t-12\right)^2+\left(\frac{\sqrt{3}}{2}t\right)^2[/MATH]
[MATH]48=3(t-8)^2+t^2[/MATH]
[MATH]t=6[/MATH]
And so B has traveled 6 units of distance. Here's a live graph of this first leg of the journey:
www.desmos.com
Beyond this point, I am thinking B should cannot walk along the moving circumference of A's position without simply being pushed back along a horizontal line. It seems to me B should continue the linear trajectory until reaching the line \(y=6\), or for:
[MATH]0\le t\le\frac{12}{\sqrt{3}}[/MATH]
Then B should travel some distance long this horizontal line until the moment it can begin a linear trajectory towards the final destination being tangent to the moving circle as it was during the first leg of the journey.
I will leave you to work with that for now, and revisit this topic later.