$ABCD$ is a trapezium such that $AB$ and $CD$ are parallel and $BC \perp CD$. If $\angle ADB = \theta$, $BC = p$ and $CD = q$, then $AB$ is equal to\\
(1) $\frac{p^2 + q^2}{p^2 \cos\theta + q^2 \sin\theta}$\\
(2) $\frac{\left(p^2 + q^2\right)\sin\theta}{(p\cos\theta + q\sin\theta)^2}$\\
(3) $\frac{\left(p^2 + q^2\right)\sin\theta}{p\cos\theta + q\sin\theta}$\\
(4) $\frac{p^2 + q^2\cos\theta}{p\cos\theta + q\sin\theta}$