Given, secθ+tanθ=p
⇒1cosθ+sinθcosθ=p
⇒1+sinθcosθ=p ....(1)
Also given secθ−tanθ=1p
⇒1cosθ−sinθcosθ=1p
⇒1−sinθcosθ=1p .....(2)
Divide equation (2) by equation (1), we get
1+sinθ1−sinθ=1p2
Apply componendo dividendo, we get
1−sinθ+1+sinθ1−sinθ−1−sinθ=1+p21−p2
⇒2−2sinθ=1+p21−p2
⇒−sinθ=1−p21−+p2
⇒sinθ=p2−1p2+1
⇒cos2θ=1−sin2θ=1−[p2−1p2+1]2=[p2+1]2−[p2−1]2[p2+1]2
⇒cos2θ=p4+1+2p2−p4−1+2p2(p2+1)2=4p2(p2+1)2
⇒cosθ=2pp2+1