Now the domain of sin−1(x) is [−1,1]
Hence the domain of the above function is [−1,1] since the domain of tan(x) is (−∞,∞) and the rest is a linear function.
Hence
Domain is [−1,1]
Now
f(1)=π2+2π4+1+4+1
=π+6.
f(−1)=−π2−2π4+1−4+1
=−π−2
Hence
p+q
=π+6+(−π−2)
=6−2
=4