To find the value of \(\cos \theta\) when \(\sin \theta = \frac{a}{b}\), we can utilize the Pythagorean identity:
\(\sin^2 \theta + \cos^2 \theta = 1\).
Given that \(\sin \theta = \frac{a}{b}\), we can substitute this into the identity:
\(\left(\frac{a}{b}\right)^2 + \cos^2 \theta = 1\).
Expanding the square gives us:
\(\frac{a^2}{b^2} + \cos^2 \theta = 1\).
We solve for \(\cos^2 \theta\) by rearranging the equation:
\(\cos^2 \theta = 1 - \frac{a^2}{b^2}\).
Simplifying the right-hand side:
\(\cos^2 \theta = \frac{b^2 - a^2}{b^2}\).
To find \(\cos \theta\), take the square root of both sides:
\(\cos \theta = \frac{\sqrt{b^2 - a^2}}{b}\).
This confirms that the correct answer is indeed:
\(\boxed{\frac{\sqrt{b^2 - a^2}}{b}}\).
Let's briefly analyze why other options are incorrect:
This solution uses the fundamental trigonometric identities and retains consistency with the question's requirements and options.