I have been studying on cubic equations and I have actually reached the cubic formula on my own, but I couldn't really understand what a discriminant is. I obtained the discriminant of a quadratic equation by replacing x with the vertex point of equation which is $-\frac b{2a}$. However when it is done to cubic equations, replacing x with $-\frac b{3a}$, which is the average of the sum of three roots, I don't know if what I got is the discriminant of cubic equations. What I got after replacing x with $-\frac b{3a}$ for $y=x^3+\frac b{a}x^2+\frac c{a}x+\frac d{a}$ is:
$$y = \frac{2b^3-9abc+27a^2d}{27a^3} = \Delta$$
I obtained $\Delta$ after replacing $-\frac b{2a}$ in quadratic equations and this is why I equalized them even if it may not be equal.
So, what I ask is what a discriminant really is and how we obtain it for cubic equations, with explanations. I also would like to see how it changes the graph if possible.
Basically, the discriminant of a polynomial of degree $n$, $p(X)=a_nX^n+a_{n-1}X^{n-1}+\dots +a_0$, with coefficients in an integral domain $R$ of characteristic $0$, is defined by the following formula: $$\Delta(P)=\frac{(-1)^{\tfrac{n(n-1)}2}}{a_n}\,R(P,P')$$ where $R(P,P')$ denotes the resultant of $P$ and $P'$.
It is nonzero if and only if $P$ is a separable polynomial, i.e. if and only if it has no multiple roots in the algebraic closure of the fraction field of $R$.
Furthermore, if the roots of $P$ in this algebraic closure are $\alpha_1,\alpha_n,\dots,\alpha_n$, the discriminant is equal to $$\Delta(P)=\alpha_n^{2n-2}\prod_{1\le i<j\le n}(\alpha_i-\alpha_j)^2.$$