Given f(x) = x + x^2 − x^3
Differentiating w r to x we get
f'(x) = d/dx(x + x^2 − x^3)=1+2x-3x^2
taking f'(x) = 0 we have
1+2x-3x^2=0
=> 1+3x-x-3x^2=0
=> (1+3x)-x(1+3x)=0
=> (1+3x)(1-x)=0
we are to take x>=0, So x = 1 is acceptable
Now f"(x) = x-6x
So for x=1 , f"(1) = 1-6=-5<0
Hence f(x) is maximum at x =1
Hence maximum value of f(x) = f(1)=1+1^2-1^3=1