Proving a trigonometric expression is identical to $2(\operatorname{cosec}^{2}{B}-1).$ I came across this trigonometric identity:
$$\frac{\operatorname{cosec}{B} - \cot{B}}{\operatorname{cosec}{B} + \cot{B}} + \frac{\operatorname{cosec}{B} + \cot{B}}{\operatorname{cosec}{B} - \cot{B}} = 2(\operatorname{cosec}^{2}{B} - 1) = 2(\frac{1+\cos^{2}{B}}{1 - \cos^{2}{B}})$$
And as I solved it, the equation came down to:
$2\operatorname{cosec}^{2}{B}+2\cot^{2}{B}.$
This can be written as $2(\operatorname{cosec}^{2}{B} + \cot^{2}{B}),$ which can further be written as $2\frac{1+\cos^{2}{B}}{1 - \cos^{2}{B}}.$
But I can't seem to get my mind around the middle part of the question, that is, $2(\operatorname{cosec}^{2}{B} - 1)$
Is it possible to write it like this, or is this an error in the question paper itself?

Get rid of cosecants and cotangent:
$$
\frac{\csc B-\cot B}{\csc B+\cot B}=
\frac{\dfrac{1}{\sin B}-\dfrac{\cos B}{\sin B}}
     {\dfrac{1}{\sin B}+\dfrac{\cos B}{\sin B}}=
\frac{1-\cos B}{1+\cos B}
$$
Thus your left-hand side is
$$
\frac{1-\cos B}{1+\cos B}+\frac{1+\cos B}{1-\cos B}=
\frac{(1-\cos B)^2+(1+\cos B)^2}{(1+\cos B)(1-\cos B)}=
\frac{2(1+\cos^2B)}{1-\cos^2B}
$$
and hence it equals the right-hand side.
On the other hand, the middle term is
$$
2(\csc^2B-1)=2\left(\frac{1}{\sin^2B}-1\right)=
2\frac{1-\sin^2B}{\sin^2B}=2\frac{\cos^2B}{1-\cos^2B}
$$
which is definitely not equal to the right-hand side.
Just apply it with $B=\pi/2$: the left-hand side and the right-hand side are both $2$, whereas the middle term is $0$.
The identity would be true if the middle term is
$$
2\csc^2B-1
$$
because
$$
2\csc^2B-1=\frac{2}{\sin^2B}-1=\frac{2-\sin^2B}{\sin^2B}
=\frac{2-1+\cos^2B}{1-\cos^2B}
$$
