Concept:
Distance \( d \) from origin to \( Ax + By - C = 0 \) is \( |C|/\sqrt{A^2 + B^2} \).
We use the identities \( \sec\theta = 1/\cos\theta \), \( \csc\theta = 1/\sin\theta \), and \( \sin 2\theta = 2\sin\theta\cos\theta \).
Step 1: Calculate \( p \).
First line: \( \frac{x}{\cos\theta} + \frac{y}{\sin\theta} = a \Rightarrow x\sin\theta + y\cos\theta - a\sin\theta\cos\theta = 0 \).
\[ p = \frac{|a\sin\theta\cos\theta|}{\sqrt{\sin^2\theta + \cos^2\theta}} = a\sin\theta\cos\theta = \frac{a}{2}\sin 2\theta \]
\[ p^2 = \frac{a^2}{4}\sin^2 2\theta \quad \Rightarrow \quad 4p^2 = a^2\sin^2 2\theta \]
Step 2: Calculate \( q \).
Second line: \( x\cos\theta - y\sin\theta - a\cos 2\theta = 0 \).
\[ q = \frac{|a\cos 2\theta|}{\sqrt{\cos^2\theta + \sin^2\theta}} = a\cos 2\theta \]
\[ q^2 = a^2\cos^2 2\theta \]
Step 3: Sum \( 4p^2 + q^2 \).
\[ 4p^2 + q^2 = a^2\sin^2 2\theta + a^2\cos^2 2\theta \]
\[ = a^2(\sin^2 2\theta + \cos^2 2\theta) = a^2(1) = a^2 \]