Thanks Frank!
My function is
g[c_,s_]=-118093./((3.33333 (2 - 0.3 c)^0.3 (1 - s) +
3.33333 (1 + 0.7 c)^0.3 s)^3.33333)^3.2
and I have defined
f[c_?NumericQ] =
NExpectation[g[c,s], s \ TriangularDistribution[{0, 0.5}]]
But my optimization still gives errors:
NMaximize[{f, 0 <= c <=2}, {c}]