How to solve cubic equation with one variable? For example?

How to solve cubic equation with one variable? For example?

In an equation, there is only one unknown number, and the highest degree of the unknown number is cubic integral equation
The univariate cubic equation is the standard form of type ax ^ 3 + BX ^ 2 + CX + D = 0
The solution is as follows
Change the above equation to x ^ 3 + BX ^ 2 + CX + D = 0,
Let x = y-b / 3, then the equation becomes y ^ 3 + (C-B ^ 2 / 3) y + (2B ^ 3 / 27 BC / 3 + D) = 0
Let P = C-B ^ 2 / 3, q = 2B ^ 3 / 27 BC / 3 + D, and the equation is y ^ 3 + py + q = 0
Let y = u + V {P = - 3UV
Then (u ^ 3 + V ^ 3) + 3UV (U + V) + P (U + V) + q = 0 = u ^ 3 + V ^ 3 + q = 0
So Q + u ^ 3 - (P / (3U)) ^ 3 = 0, that is, (u ^ 3) ^ 2 + Qu ^ 3 - (P / 3) ^ 3 = 0
Let u ^ 3 = t, then T ^ 2 + QT - (P / 3) ^ 3 = 0
The solution is t = (- Q ± (Q ^ 2 + 4 (P / 3) ^ 3) ^ 0.5) / 2
So u = (- Q ± (Q ^ 2 + 4 (P / 3) ^ 3) ^ 0.5) / 2) ^ (1 / 3),
So v = - P / (3U) = (- P / 3) / (- Q ± (Q ^ 2 + 4 (P / 3) ^ 3) ^ 0.5) / 2) ^ (1 / 3)
So Y1 = u + V
  =((-q±(q^2+4(p/3)^3)^0.5)/2)^(1/3)+(-p/3)/((-q±(q^2+4(p/3)^3)^0.5)/2)^(1/3)
This is one root. Now, let's find the other two
By substituting Y1 into the equation, we get
  y^3+py+q=(y-y1)*f(x)
Let f (x) be determined by undetermined coefficient method
  y^3+py+q
  =(y-y1)(y^2+k1y+k2)
  =y^3+(k1-y1)y^2+(k2-k1y1)y-k2y1
So K1 = Y1, K2 = P + K1 ^ 2
Then the other two Y2 and Y3 are solved by the root formula