How to get the value of a function dependant on $\tan A = \frac{2+\cot \left(\frac{B}{2}\right)}{4+\cot \left(\frac{A}{2}\right)}$? The problem is as follows:

Find the value of:
$$R=\frac{\sec^2B-\cot A}{4+\csc^2 A}$$
Where $A$ is given by:
$\tan A = \frac{2+\cot \left(\frac{B}{2}\right)}{4+\cot
> \left(\frac{A}{2}\right)}$
Also assume this follows the relationship seen in the figure from
below:


The alternatives given in my book are as follows:
$\begin{array}{ll}
1.&\frac{1}{2}\\
2.&1\\
3.&\frac{1}{4}\\
4.&\frac{1}{3}\\
\end{array}$
My main issue with this problem is the half angle which is presented in the right side of this equation:
$\tan A = \frac{2+\cot \left(\frac{B}{2}\right)}{4+\cot \left(\frac{A}{2}\right)}$
I was able to spot that the figure might intend to say that $A$ and $B$ are complementary thus:
$A+B=90^{\circ}$
Therefore this makes the previous expression into:
$\tan A = \frac{2+\tan \left(\frac{A}{2}\right)}{4+\cot \left(\frac{A}{2}\right)}$
This helps a bit but again the half angle would produce a square root. I tried to follow such path. But it didn't ended very well.
After squaring and using other identities I ended up having a 8th degree equation. And certainly this wasn't intended.
So what's the trick here?. So far I'm still stuck and all sorts of manipulations don't give me results. Can someone guide me in the right path?. I'm also confused on how to better use the figure. Those other letters don't seem to help much.
It would really help me alot a method explained step by step so I can understand.

Alternative approach
Using the diagram and half-angle formulas:
$$\cot(A/2) = \frac{1 + \cos(A)}{\sin(A)}
~~\text{and}~~ \cot(B/2) = \frac{1 + \cos(B)}{\sin(B)} = \frac{1 + \sin(A)}{\cos(A)} \implies $$
$$\frac{\sin(A)}{\cos(A)} = \frac{2 + \frac{1 + \sin(A)}{\cos(A)}}{4 + \frac{1 + \cos(A)}{\sin(A)}} =
\frac{2\cos(A) + 1 + \sin(A)}{4\sin(A) + 1 + \cos(A)} \times 
\frac{\sin(A)}{\cos(A)} \implies$$
$$2\cos(A) + 1 + \sin(A) = 4\sin(A) + 1 + \cos(A) \implies$$
$$\cos(A) = 3\sin(A)\implies$$

*

*$\displaystyle \cot(A) = 3$

*$\displaystyle 10\sin^2(A) = 1.$
Therefore,
$$R = \frac{\frac{1}{\cos^2(B)} - 3}{4 + \frac{1}{\sin^2(A)}}
= \frac{\frac{1}{\sin^2(A)} - 3}{4 + \frac{1}{\sin^2(A)}}
= \frac{10-3}{4 + 10} = \frac{1}{2}.$$
