Since three lines x−3y=p, ax+2y=q and ax+y=r
form a right angled triangle ∴ product of slopes of any two lines =−1
Suppose ax+2y=q and x−3y=pare⊥ to each other. ∴2−a×31=−1⇒a=6
Now, consider option one by one a=6 satisfies only option ∴ Required answer is a2−9a+18=0