We have to minimise 10∑n=12n+1(1+n2|cosθ|)(1+(n+1)2|cosθ|)
Here, n is varying. So, to minimise the expression, |cosθ| should be maximum as it is in the denominator.
∴|cosθ|=1
Now, the expression becomes
10∑n=12n+1(1+n2)(1+(n+1)2)
=10∑n=1(1+(n+1)2)−(1+n2)(1+n2)(1+(n+1)2)
=10∑n=1(11+n2−11+(n+1)2)
=11+12−11+112
=60122=3061=pq
Thus, p+q=91