i guess you have copied the wrong question.. it should be somewhat like if tan theta + sec theta = p then find tge value of sin theta...
secθ+tanθ=P
⇒(secθ+tanθ)² = P²
⇒sec² θ+tan² θ+2tanθsecθ=P²
⇒2tan²θ + 1 + 2 sinθ/cos θ = P²
⇒2 sin²θ+ cos²θ+ 2 sinθ total by cos²θ = P²
Applying componendo and dividendo
=> 2sin²θ+ cos²θ+ 2sinθ- cos²θ/ 2sin²θ+ cos²θ+ 2sinθ- cos²θ = p²-1 / p²+1
⇒2sinθ(sinθ+1)/ 2(sinθ+1) = p²-1 / p²+1
=> sinθ = p²-1/ p²+1