#### Answer

The function in need to find is $y=\frac{3}{16}x^3-\frac{9}{4}x+3$

#### Work Step by Step

$$y=ax^3+bx^2+cx+d$$
1) Find $y'$ $$y'=3ax^2+2bx+c$$
2) The slope of the tangent line $(l)$ to the curve $f$ at point $A(a,b)$ equals $y'(a)$.
Horizontal tangents have slope 0. That means $y'(a)=0$.
To have horizontal tangent at $(-2,6)$ means $$y'(-2)=0$$ $$3a\times(-2)^2+2b\times(-2)+c=0$$ $$12a-4b+c=0\hspace{0.5cm}(1)$$
Similarly, to have horizontal tangent at $(2,0)$ means $$y'(2)=0$$ $$3a\times2^2+2b\times2+c=0$$ $$12a+4b+c=0\hspace{0.5cm}(2)$$
We subtract (2) from (1) and have $$-8b=0$$ $$b=0$$
So, function $y$ now becomes $$y=ax^3+cx+d$$
3) Since there are tangent lines at $(-2, 6)$ and $(2,0)$, these 2 points also lie in the graph of function $y$.
That means $(-2)^3a+(-2)c+d=6$. Or $-8a-2c+d=6\hspace{0.5cm}(3)$
And also $2^3a+2c+d=0$. Or $8a+2c+d=0\hspace{0.5cm}(4)$.
Combing $(1), (3), (4)$, we have 3 equations to find 3 constant $a, c, d$. Solving them, we find that $a=\frac{3}{16}$, $c=-\frac{9}{4}$, $d=3$.
Therefore, the function in need to find is $y=\frac{3}{16}x^3-\frac{9}{4}x+3$