Step 1: Given Equation
The provided equation is:
\[
\tan \theta + \sec \theta = m
\]
The objective is to prove:
\[
\sec \theta = \frac{m^2 + 1}{2m}
\]
Step 2: Express $\tan \theta$ in terms of $\sec \theta$
Using the identity $\tan^2 \theta + 1 = \sec^2 \theta$, we get:
\[
\tan \theta = \sqrt{\sec^2 \theta - 1}
\]
Substituting this into the given equation:
\[
\sqrt{\sec^2 \theta - 1} + \sec \theta = m
\]
Step 3: Solve for $\sec \theta$
Isolate the square root term:
\[
\sqrt{\sec^2 \theta - 1} = m - \sec \theta
\]
Square both sides:
\[
\sec^2 \theta - 1 = (m - \sec \theta)^2
\]
Expand and simplify:
\[
\sec^2 \theta - 1 = m^2 - 2m \sec \theta + \sec^2 \theta
\]
\[
-1 = m^2 - 2m \sec \theta
\]
Rearrange to isolate $\sec \theta$:
\[
2m \sec \theta = m^2 + 1
\]
Divide by $2m$:
\[
\sec \theta = \frac{m^2 + 1}{2m}
\]
Conclusion:
The proof is complete, showing that:
\[
\sec \theta = \frac{m^2 + 1}{2m}
\]