/
cubic (a, b, c, d)

cubic (a, b, c, d)

The function calculates the value of x (root) in a cubic equation of the form ax^3 + bx^2 + cx + d = 0, where a, b, c, and d are the coefficients specified as input to the function.

The result of the calculation will be the values of x (root) that satisfies the equation.

 

Example:

... <!-- example1 --> <P N="x1" V="cubic(5,10,1,3)" /> <P N="x2" V="cubic(1,3,3,1)" /> <P N="x3" V="cubic(1,3,3,1)[0]" /> ...
Debug Trace

The function solves a system of 3 linear equations with 3 unknowns and returns one of the solutions in the x3 parameter. The solution is selected by specifying which root you want to retrieve using square brackets, with the first root being represented by [0], the second by [1], and the third by [2]. The function will return the requested root as the result.

... <!-- example2: 24x^3 + 34x^2 -5x -3 = 0 --> <O N="C1" T="Group"> <P N="a1" V="24" /> <P N="b1" V="34" /> <P N="c1" V="-5" /> <P N="d1" V="-3" /> <P N="root_ex1" V="cubic(a1,b1,c1,d1)" D="Solution for a cubic equation with real roots" /> </O> ...
Debug Trace
... <!-- example3: x^3 - 3x^2 + 7x + 75 = 0 --> <O N="C2" T="Group"> <P N="a2" V="1" /> <P N="b2" V="-3" /> <P N="c2" V="7" /> <P N="d2" V="75" /> <P N="root_ex2" V="cubic(a2,b2,c2,d2)" D="Solution for a cubic equation with complex roots" /> </O> ...

To view this example in the library, see (OpenBrIM Platform)

 

Related content

cubic(a,b,c,d)
cubic(a,b,c,d)
More like this
quar (a, b, c, d, e)
quar (a, b, c, d, e)
More like this
quar(a,b,c,d,e)
quar(a,b,c,d,e)
More like this
Mathematical Functions
Mathematical Functions
More like this
map(Loop,x.parameter) or map(List,x.parameter)
map(Loop,x.parameter) or map(List,x.parameter)
More like this
minl(Liste,x_index_)
minl(Liste,x_index_)
More like this