Maximize the function $f(x) = (1-x) (1+x)^3$ Maximize the function $f(x) = (1-x)(1+x)^3.$
I took the first derivative of $f(x)$ and got $(1+x)^2 (2-4x)$
From there I got $2$ critical points of: $-1, \frac{1}{2}$
Then $I$ took the second derivative of $f(x)$ ($-12x^2 -12x$) and plugged in the critical points to get $0$ and $-6$.
I know I am doing it wrong can anybody help. The right answer is $\frac{27}{16}$.

Since $f(x) $ is non-negative only when $ |x| \leqslant 1$, then we only need to care when $|x|\leqslant 1$.
With that, we know that $ 1-x$ and $ 1 + x$ are non-negative numbers. Thus, we can apply the AM-GM inequality:
$$ AM\left(1 - x , \frac{1+x}3 , \frac{1+x}3, \frac{1+x}3 \right) \geqslant GM \left (1 - x , \frac{1+x}3 , \frac{1+x}3, \frac{1+x}3 \right) $$
Simplifying the above gives $$\frac12 \geqslant \left ( \frac{(1-x)(1+x)^3}{3^3} \right )^{1/4}  $$
Rearranging gives $ (1-x)(1+x)^3 \leqslant \boxed{\frac{27}{16}}.$
The maximum value is attained when $ 1-x = \dfrac{1+x}3 \Leftrightarrow x = \dfrac12. $
