Let the roots of the quadratic x2+px+q=0 be r1 and r2.
Given: r1=tan30∘ and r2=tan15∘.
Step 1: Evaluate the numerical values of the roots.
For 30∘ we know tan30∘=31, so r1=31.
To get tan15∘, use the formula for tan(A−B):
tan(A−B)=1+tanAtanBtanA−tanB.
Choose A=45∘,B=30∘; thus
tan15∘=tan(45∘−30∘)=1+tan45∘tan30∘tan45∘−tan30∘=1+1⋅311−31
Simplify numerator and denominator by multiplying top and bottom by 3:
tan15∘=3+13−1=2−3.
Hence r2=2−3.
Step 2: Relate coefficients to the roots.
For the quadratic x2+px+q=0 with roots r1,r2:
Sum of roots: r1+r2=−p.
Product of roots: r1r2=q.
Step 3: Compute r1+r2 and r1r2.
Sum:
r1+r2=31+2−3=33+2−3=2−323.
Product:
r1r2=31(2−3)=32−3=32−1.
Thus
p=−(r1+r2)=−(2−323),
q=r1r2=32−1.
Step 4: Evaluate 2+q−p.
First rewrite p with a positive denominator: p=−2+323.
Now calculate:
2+q−p=2+(32−1)−(−2+323)=2−1+2+32−323=3+(32−323).$
Notice that 32=323, so the two radical terms cancel:
32−323=0.
Therefore
2+q−p=3.
Hence the required value is 3.
Option B which is: 3