6 The continuous random variable \(X\) has probability density function given by
$$\mathrm { f } ( x ) = \left\{ \begin{array} { c l }
k \sin x & 0 \leqslant x \leqslant \frac { 1 } { 2 } \pi ,
k \left( 2 - \frac { 2 x } { \pi } \right) & \frac { 1 } { 2 } \pi \leqslant x \leqslant \pi ,
0 & \text { otherwise, }
\end{array} \right.$$
where \(k\) is a constant.
- Show that \(k = \frac { 4 } { 4 + \pi }\).
- Find \(\mathrm { E } ( X )\), correct to 3 significant figures, showing all necessary working.