To solve the integral \( I = \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{x}{1 + \sin x} \, dx \) and find the value of \( k \) such that \( I = k(\sqrt{2} - 1) \), we can follow these steps:
### Step 1: Define the integral
Let
\[
I = \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{x}{1 + \sin x} \, dx
\]
### Step 2: Use the property of integrals
We can use the property of integrals that states:
\[
\int_a^b f(x) \, dx = \int_a^b f(a + b - x) \, dx
\]
Here, \( a = \frac{\pi}{4} \) and \( b = \frac{3\pi}{4} \). Thus, \( a + b = \pi \).
Applying this property, we have:
\[
I = \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{\pi - x}{1 + \sin(\pi - x)} \, dx
\]
Since \( \sin(\pi - x) = \sin x \), we can rewrite the integral as:
\[
I = \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{\pi - x}{1 + \sin x} \, dx
\]
### Step 3: Combine the two expressions for \( I \)
Now we have two expressions for \( I \):
1. \( I = \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{x}{1 + \sin x} \, dx \)
2. \( I = \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{\pi - x}{1 + \sin x} \, dx \)
Adding these two equations:
\[
2I = \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \left( \frac{x + (\pi - x)}{1 + \sin x} \right) \, dx = \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{\pi}{1 + \sin x} \, dx
\]
### Step 4: Solve for \( I \)
Thus, we have:
\[
I = \frac{1}{2} \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{\pi}{1 + \sin x} \, dx
\]
Now we can factor out \( \frac{\pi}{2} \):
\[
I = \frac{\pi}{2} \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{1}{1 + \sin x} \, dx
\]
### Step 5: Rationalize the integrand
To integrate \( \frac{1}{1 + \sin x} \), we can multiply the numerator and denominator by \( 1 - \sin x \):
\[
\frac{1 - \sin x}{(1 + \sin x)(1 - \sin x)} = \frac{1 - \sin x}{\cos^2 x}
\]
Thus,
\[
\int \frac{1}{1 + \sin x} \, dx = \int \left( \sec^2 x - \tan x \sec^2 x \right) \, dx
\]
### Step 6: Integrate
The integral becomes:
\[
\int \sec^2 x \, dx - \int \tan x \sec^2 x \, dx
\]
Integrating gives:
\[
\tan x - \sec x
\]
### Step 7: Evaluate the limits
Now we evaluate:
\[
\left[ \tan x - \sec x \right]_{\frac{\pi}{4}}^{\frac{3\pi}{4}}
\]
Calculating at the limits:
- At \( x = \frac{3\pi}{4} \):
\[
\tan\left(\frac{3\pi}{4}\right) = -1, \quad \sec\left(\frac{3\pi}{4}\right) = -\sqrt{2}
\]
So, \( -1 - (-\sqrt{2}) = -1 + \sqrt{2} \).
- At \( x = \frac{\pi}{4} \):
\[
\tan\left(\frac{\pi}{4}\right) = 1, \quad \sec\left(\frac{\pi}{4}\right) = \sqrt{2}
\]
So, \( 1 - \sqrt{2} \).
Combining these:
\[
\left[ -1 + \sqrt{2} - (1 - \sqrt{2}) \right] = -1 + \sqrt{2} - 1 + \sqrt{2} = 2\sqrt{2} - 2
\]
### Step 8: Final expression for \( I \)
Thus,
\[
I = \frac{\pi}{2} \cdot \frac{2(\sqrt{2} - 1)}{2} = \frac{\pi}{2}(\sqrt{2} - 1)
\]
### Step 9: Find \( k \)
From the equation \( I = k(\sqrt{2} - 1) \), we have:
\[
\frac{\pi}{2}(\sqrt{2} - 1) = k(\sqrt{2} - 1)
\]
Thus, \( k = \frac{\pi}{2} \).
### Conclusion
The value of \( k \) is:
\[
\boxed{\frac{\pi}{2}}
\]