Cubic Equation Related How do I solve the following cubic equation?
$(x+1)^2(x-2)-2nx-6n=0,n \in \mathbb{N}$
$ \therefore (x+1)^2(x-2)-2n(x+3)=0$
I don't know how to solve further.
 A: We have
$$(x+1)^2(x-2)-2nx-6n=0,$$
i.e.
$$x^3+(-3-2n)x-2-6n=0\tag1$$
Let $f(x)=x^3+(-3-2n)x-2-6n$. Then,
$$f'(x)=3x^2-3-2n=0\iff x=\pm\sqrt{\frac{3+2n}{3}}.$$
We have
$$\begin{align}f\left(-\sqrt{\frac{3+2n}{3}}\right)\lt 0&\iff (2n+3)\sqrt{\frac{2n+3}{3}}\lt 9n+3\\&\iff (2n+3)^2\cdot\frac{2n+3}{3}\lt (9n+3)^2\\&\iff 8n^2-207n-108\lt 0\\&\iff 1\le n\le 26\end{align}$$
So, we know that $(1)$ has only one real root for $1\le n\le 26$, and that $(1)$ has three distinct real roots for $n\ge 27$.
Here, let 
$$x=y+\frac{A}{y}\quad \text{where $\quad A=\frac{2n+3}{3}$}\tag2$$
Then, 
$$\begin{align}(1)&\iff \left(y+\frac{A}{y}\right)^3+(-3-2n)\left(y+\frac{A}{y}\right)-2-6n=0\\&\iff y^3+3y^2\cdot\frac Ay+3y\cdot\frac{A^2}{y^2}+\frac{A^3}{y^3}+(-3-2n)y+\frac{A(-3-2n)}{y}-2-6n=0\\&\iff y^3+\frac{A^3}{y^3}-6n-2=0\end{align}$$
Here, let $$y^3=z\tag3$$ to have
$$\begin{align}z+\frac{A^3}{z}-6n-2=0&\iff z^2-(6n+2)z+A^3=0\\&\iff z=3n+1\pm\sqrt{(3n+1)^2-A^3}\end{align}$$
Therefore, from $(2)(3)$, we have
$$x=y+\frac Ay=z^{1/3}+\frac{A}{z^{1/3}}$$
$$\color{red}{x=\sqrt[3]{3n+1\pm\sqrt{(3n+1)^2-((2n+3)/3)^3}}+\frac{1+(2n/3)}{\sqrt[3]{3n+1\pm\sqrt{(3n+1)^2-((2n+3)/3)^3}}}}$$
A: If you look a little bit on internet, there is an analytic solution for cubic equations:
https://en.wikipedia.org/wiki/Cubic_function
