For $f(x)=x^4+|x|,$ let $I_1=\int_0^\pi f(\cos x)\ dx,\ I_2=\int_0^\frac{\pi}{2} f(\sin x)\ dx.$

Find the value of  $\frac{I_1}{I_2}.$
1. Given the function \( f(x) = x^4 + |x| \), we need to find the value of \( \frac{I_1}{I_2} \) where:
   \[
   I_1 = \int_0^\pi f(\cos x) \, dx \quad \text{and} \quad I_2 = \int_0^\frac{\pi}{2} f(\sin x) \, dx.
   \]

2. First, we note that \( f(x) \) is an even function because \( f(-x) = (-x)^4 + |-x| = x^4 + |x| = f(x) \).

3. To evaluate \( I_1 \), we make the substitution \( u = \cos x \). Then \( du = -\sin x \, dx \), and the limits of integration change as follows:
   - When \( x = 0 \), \( u = \cos 0 = 1 \).
   - When \( x = \pi \), \( u = \cos \pi = -1 \).

   Therefore, the integral becomes:
   \[
   I_1 = \int_0^\pi f(\cos x) \, dx = \int_1^{-1} f(u) \left( -\frac{1}{\sqrt{1-u^2}} \right) du = \int_{-1}^1 \frac{f(u)}{\sqrt{1-u^2}} \, du.
   \]

4. To evaluate \( I_2 \), we make the substitution \( u = \sin x \). Then \( du = \cos x \, dx \), and the limits of integration change as follows:
   - When \( x = 0 \), \( u = \sin 0 = 0 \).
   - When \( x = \frac{\pi}{2} \), \( u = \sin \frac{\pi}{2} = 1 \).

   Therefore, the integral becomes:
   \[
   I_2 = \int_0^\frac{\pi}{2} f(\sin x) \, dx = \int_0^1 f(u) \left( \frac{1}{\sqrt{1-u^2}} \right) du = \int_0^1 \frac{f(u)}{\sqrt{1-u^2}} \, du.
   \]

5. Since \( \frac{f(u)}{\sqrt{1-u^2}} \) is an even function of \( u \), we can use the symmetry property of even functions. Specifically, for an even function \( g(u) \):
   \[
   \int_{-a}^a g(u) \, du = 2 \int_0^a g(u) \, du.
   \]

6. Applying this property to our integrals, we get:
   \[
   I_1 = \int_{-1}^1 \frac{f(u)}{\sqrt{1-u^2}} \, du = 2 \int_0^1 \frac{f(u)}{\sqrt{1-u^2}} \, du = 2 I_2.
   \]

7. Therefore, the ratio \( \frac{I_1}{I_2} \) is:
   \[
   \frac{I_1}{I_2} = \frac{2 I_2}{I_2} = 2.
   \]

The final answer is \(\boxed{2}\).