Find the value of $\lambda$ in $\frac{3-\tan^2 {\pi\over 7}}{1-\tan^2 {\pi\over 7}}=\lambda\cos{\pi\over 7}$ 
Find the value of $\lambda$ in $$\dfrac{3-\tan^2 {\pi\over 7}}{1-\tan^2 {\pi\over 7}}=\lambda\cos{\pi\over 7}$$

The numerator looks similar to expansion of $\tan 3x$, so I tried this 
$$\dfrac{3\tan {\pi\over 7}-\tan^3 {\pi\over 7}}{\tan {\pi\over 7}\left(1-\tan^2 {\pi\over 7}\right)}=\lambda\cos{\pi\over 7}$$
$$\dfrac{\left(3\tan {\pi\over 7}-\tan^3 {\pi\over 7}\right)\left(1-3\tan^2 {\pi\over 7}\right)}{\tan {\pi\over 7}\left(1-\tan^2 {\pi\over 7}\right)\left(1-3\tan^2 {\pi\over 7}\right)}=\lambda\cos{\pi\over 7}$$
$$\dfrac{\tan {3\pi\over 7}\left(1-3\tan^2 {\pi\over 7}\right)}{\sin {\pi\over 7}\left(1-\tan^2 {\pi\over 7}\right)}=\lambda$$
But I'm stuck here. Need help. Thanks in advance.

Let $7x=\pi$
$$\lambda\cos x=\dfrac{3-\tan^2x}{1-\tan^2x}=\dfrac{3\cos^2x-(1-\cos^2x)}{\cos^2x-(1-\cos^2x)}$$
$$\iff2\lambda\cos^3x-4\cos^2x-\lambda\cos x+1=0$$
From How Can One Prove $\cos(\pi/7) + \cos(3 \pi/7) + \cos(5 \pi/7) = 1/2$,
$\cos\dfrac{(2n+1)\pi}7; n=0,1,2$ are the roots of $8t^3-4t^2-4t+1=0$
Comparing with the coefficients, $$\dfrac{2\lambda}8=\dfrac44=\dfrac\lambda4=\dfrac11$$
$\implies\lambda=?$ 
So, we can replace $\dfrac\pi7$ with $\dfrac{3\pi}7,\dfrac{5\pi}7$ in the given expression
