From (A): p(0)=b=5.
From (B): p(x)+q(x)=(a+c)x+(b+d)
=6x+4
⇒a+c=6 and b+d=4.
Since b=5, d=4−5=−1.
From (B): p(x)−q(x)=(a−c)x+(b−d).
At x=3, value = 0:
3(a−c)+(5−(−1))=0
⇒3(a−c)+6=0
⇒a−c=−2.
Solve a+c=6 and a−c=−2: a=2, c=4.
Therefore, p(x)=2x+5 and q(x)=4x−1.