Let $f(x)$ be a continuous function satisfying $f(x)=1+k\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(t)\sin (x-t)dt\ (k:constant\ number)$

Find the value of $k$ for which $\int_0^{\pi} f(x)dx$ is maximized.
1. Given the function \( f(x) \) satisfying the integral equation:
   \[
   f(x) = 1 + k \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(t) \sin(x - t) \, dt
   \]
   we start by using the trigonometric identity for \(\sin(x - t)\):
   \[
   \sin(x - t) = \sin(x)\cos(t) - \cos(x)\sin(t)
   \]
   Substituting this into the integral equation, we get:
   \[
   f(x) = 1 + k \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(t) (\sin(x)\cos(t) - \cos(x)\sin(t)) \, dt
   \]

2. Define:
   \[
   a = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(t) \cos(t) \, dt \quad \text{and} \quad b = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(t) \sin(t) \, dt
   \]
   Then the equation becomes:
   \[
   f(x) = 1 + k (a \sin(x) - b \cos(x))
   \]

3. To find \(a\) and \(b\), multiply both sides of the equation by \(\cos(x)\) and integrate over \([- \frac{\pi}{2}, \frac{\pi}{2}]\):
   \[
   \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(x) \cos(x) \, dx = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \left(1 + k (a \sin(x) - b \cos(x))\right) \cos(x) \, dx
   \]
   Simplifying, we get:
   \[
   a = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos(x) \, dx + k \left( a \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sin(x) \cos(x) \, dx - b \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos^2(x) \, dx \right)
   \]
   Using the fact that \(\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos(x) \, dx = 2\) and \(\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sin(x) \cos(x) \, dx = 0\), we get:
   \[
   a = 2 - k b \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos^2(x) \, dx
   \]
   Since \(\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos^2(x) \, dx = \frac{\pi}{2}\), we have:
   \[
   a = 2 - \frac{\pi k b}{2}
   \]

4. Similarly, multiply both sides of the equation by \(\sin(x)\) and integrate over \([- \frac{\pi}{2}, \frac{\pi}{2}]\):
   \[
   \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} f(x) \sin(x) \, dx = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \left(1 + k (a \sin(x) - b \cos(x))\right) \sin(x) \, dx
   \]
   Simplifying, we get:
   \[
   b = k a \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sin^2(x) \, dx
   \]
   Using the fact that \(\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sin^2(x) \, dx = \frac{\pi}{2}\), we have:
   \[
   b = \frac{\pi k a}{2}
   \]

5. Solving the system of equations:
   \[
   a = 2 - \frac{\pi k b}{2}
   \]
   \[
   b = \frac{\pi k a}{2}
   \]
   Substituting \( b = \frac{\pi k a}{2} \) into the first equation:
   \[
   a = 2 - \frac{\pi k \left(\frac{\pi k a}{2}\right)}{2}
   \]
   Simplifying, we get:
   \[
   a = 2 - \frac{\pi^2 k^2 a}{4}
   \]
   \[
   a \left(1 + \frac{\pi^2 k^2}{4}\right) = 2
   \]
   \[
   a = \frac{2}{1 + \frac{\pi^2 k^2}{4}}
   \]

6. Substituting \( a \) back into the equation for \( b \):
   \[
   b = \frac{\pi k a}{2} = \frac{\pi k \left(\frac{2}{1 + \frac{\pi^2 k^2}{4}}\right)}{2} = \frac{2 \pi k}{2 \left(1 + \frac{\pi^2 k^2}{4}\right)} = \frac{\pi k}{1 + \frac{\pi^2 k^2}{4}}
   \]

7. Substituting \( a \) and \( b \) back into the expression for \( f(x) \):
   \[
   f(x) = 1 + k \left(a \sin(x) - b \cos(x)\right) = 1 + k \left(\frac{2 \sin(x)}{1 + \frac{\pi^2 k^2}{4}} - \frac{\pi k \cos(x)}{1 + \frac{\pi^2 k^2}{4}}\right)
   \]
   \[
   f(x) = 1 + \frac{2k \sin(x) - \pi k^2 \cos(x)}{1 + \frac{\pi^2 k^2}{4}}
   \]

8. To maximize \(\int_0^{\pi} f(x) \, dx\), we differentiate with respect to \( k \) and set the derivative to zero:
   \[
   \int_0^{\pi} \frac{\partial}{\partial k} \left(1 + \frac{2k \sin(x) - \pi k^2 \cos(x)}{1 + \frac{\pi^2 k^2}{4}}\right) \, dx = 0
   \]
   Simplifying, we get:
   \[
   \frac{64 - 16 \pi^2 k^2}{\pi^4 k^4 + 8 \pi^2 k^2 + 16} = 0
   \]
   Solving for \( k \), we get:
   \[
   64 - 16 \pi^2 k^2 = 0
   \]
   \[
   k^2 = \frac{64}{16 \pi^2} = \frac{4}{\pi^2}
   \]
   \[
   k = \pm \frac{2}{\pi}
   \]

9. Since we are looking for the value of \( k \) that maximizes the integral, we choose the positive value:
   \[
   k = \frac{2}{\pi}
   \]

The final answer is \( \boxed{ k = \frac{2}{\pi} } \)