P(x) contains only terms of odd degree.
So, P(x) is an odd function.
⇒P(−3)=−P(3)=−6
Let P(x)=Q(x)(x2−9)+ax+b
where Q(x) is the quotient and ax+b=g(x) is the remainder.
Now, P(3)=3a+b=6 ⋯(1)
P(−3)=−3a+b=−6 ⋯(2)
Solving (1) and (2), we get
a=2,b=0
∴g(x)=2x
⇒g(2)=4