The line \(\frac{x}{a} + \frac{y}{b} = 1\) intersects the x-axis at \(P(a, 0)\) and the y-axis at \(Q(0, b)\).
The distance \(PQ\) is given by:
\(PQ = \sqrt{a^2 + b^2} = \sqrt{45}\)
Squaring both sides, we get:
\(a^2 + b^2 = 45 \quad (1)\)
The gradient of the line \(PQ\) is:
\(\text{Gradient} = \frac{0 - b}{a - 0} = -\frac{b}{a} = -\frac{1}{2}\)
Solving for \(b\), we have:
\(\frac{b}{a} = \frac{1}{2}\)
\(b = \frac{a}{2} \quad (2)\)
Substitute equation (2) into equation (1):
\(a^2 + \left(\frac{a}{2}\right)^2 = 45\)
\(a^2 + \frac{a^2}{4} = 45\)
\(\frac{4a^2 + a^2}{4} = 45\)
\(5a^2 = 180\)
\(a^2 = 36\)
\(a = 6\)
Substitute \(a = 6\) back into equation (2):
\(b = \frac{6}{2} = 3\)
Thus, \(a = 6\) and \(b = 3\).