There are solutions on the Internet, but they are all randomly scattered without structuring by methods. It is important for me to understand one method myself and start using it to solve it.
- oneThere is only one analytical method - Cardano method. All other methods are either numerical (looking for roots with a given accuracy), or they solve particular cases. - Akina
3 answers
Formula Cardano , for example :) Here is another link .
Or are you interested in a numerical solution? Since one root always exists, find it numerically — at least by simple half division, then bring the third degree equation to the second equation, and there everything is simple.
Does that answer suit you? If not, then reformulate your question ...
- oneAs one root always exists - in the general case the statement is erroneous. A degenerate cubic equation (the coefficient for a cube is zero) may not have real roots. - Akina
- 3@Akina such an equation of mathematics is not called cubic - Pavel Mayorov
The best option is to guess one of the roots, and then get a quadratic equation for the remaining roots. If the equation is with integer coefficients, then you can divide the lower coefficient by the higher one and search for the roots among the positive and negative divisors of this ratio. For example, the return equation ax 3 + bx 2 + bx + a = 0 has a root x = -1 .
If the naive attempt failed, then one should move from the general equation ax 3 + bx 2 + сx + d = 0 to the reduced y 3 + py + q = 0 , and the substitution x = yb / (3a) will help in this.
For a reduced cubic equation, the Cardano formula is usually proposed. And you can directly use the substitution of Tartaglia:
y = u + v , u 3 + v 3 + (3uv + p) (u + v) + q = 0 , 3uv + p = 0 ,
which leads to a system of equations for the sum and product of cubes:
u 3 + v 3 = - q, u 3 v 3 = - p 3/27 .
The inverse Vieta theorem gives for these cubes a quadratic equation of the form w 2 + qw - p 3/27 = 0 and, ultimately, the well-known Cardano formula. But sometimes the values of u 3 and v 3 can be simply picked up.
Note that for negative values of p, the discriminant q 2/4 + p 3/27 may turn out to be negative. For this case, there are triple argument formulas for trigonometric and hyperbolic functions.
cos 3t = 4cos 3 t - 3cos t; ch 3t = 4ch 3 t - 3ch t , where ch t = (e t + e -t ) / 2 .
Therefore, for the equation 4z 3 - 3r 2 z = s with s <= r 3 you can get:
t k = 1 / 3arccos (s / r 3 ) + (2k / 3) pi, z k = r cost k , k = 0, 1, 2 .
If s> r 3 , then the solution is unique, and it can be expressed in a similar way through hyperbolic functions. Here the formula arch q = ln (q + sqrt (q 2 -1)) comes in handy.
Thus, solutions of a cubic equation can always be expressed in terms of the elementary functions of a real argument.
Numerically solved by Newton's method , the convergence of the method is quadratic, in contrast to the dichotomy method proposed by @Harry, which has linear convergence.
- Only even in Wikipedia, the solution of a cubic equation by Newton's method with bad initial conditions is shown as a counterexample ... The dichotomy method has the valuable property that for a continuous function always gives a solution with a predetermined accuracy
epsinlog_2((ba)/eps)steps. When something is known about the root in advance is another matter ... - Harry