In the trapezium ABCD, since AB∥CD and BC⊥CD, it follows that BC⊥AB. Thus, ∠BCD=90∘ and ∠ABC=90∘.
In the right-angled triangle BCD:
BD=BC2+CD2=p2+q2. Let ∠BDC=α.
sinα=BDBC=p2+q2p
cosα=BDCD=p2+q2q
Since AB∥CD, the alternate interior angles are equal. ∠ABD=∠BDC=α
In △ABD, ∠ADB=θ, ∠ABD=α
∠DAB=180∘−(θ+α)
Using the Sine Rule in △ABD:
sinθAB=sin(∠DAB)BD
sinθAB=sin(180∘−(θ+α))p2+q2
sinθAB=sinθcosα+cosθsinαp2+q2
Substitute the values of sinα and cosα:
AB=sinθ(p2+q2q)+cosθ(p2+q2p)p2+q2sinθ
AB=qsinθ+pcosθ(p2+q2)sinθ