It is not the purpose of this page to repeat good information available elsewhere. However, it seems to the author that other descriptions of the cubic function are more complicated than they need to be. This page attempts to demystify elementary but essential information concerning the cubic function.

Objective

edit
 
  • Present cubic function and cubic equation.
  • Introduce the concept of roots of equal absolute value.
  • Show how to predict and calculate equal roots, techniques that will be useful when applied to higher order functions.
  • Simplify the depressed cubic.
  • Simplify Vieta's substitution.
  • Review complex numbers as they apply to a complex cube root.
  • Present cubic formula simplified.
  • Show that the cubic equation is effectively solved when at least one real root is known.
  • Use Newton's Method to calculate one real root.
  • Show that the cubic equation can be solved with high-school math.

Lesson

edit

Introduction

edit

The cubic function is the sum of powers of   from   through  :

 

usually written as:

 

If   the function becomes  

Within this page we'll say that:

  • both coefficients   must be non-zero,
  • coefficient   must be positive (simply for our convenience),
  • all coefficients must be real numbers, accepting that the function may contain complex roots.

The cubic equation is the cubic function equated to zero:

 .

Roots of the function are values of   that satisfy the cubic equation.

Because all coefficients must be real numbers, the cubic function must have 3 real roots or exactly 1 real root.

Other combinations of real and complex roots are possible, but they produce complex coefficients.

Characteristics of cubic functions

edit

Coefficient c missing

edit
 

If coefficient   is missing, the cubic function becomes   and

 

For a stationary point  

When coefficient   is missing, there is always a stationary point at  

x = f(y)

edit
 

The cubic function may be expressed as  

Unless otherwise noted, references to "cubic function" on this page refer to function of form  

Coefficient a negative

edit
 
Graph of cubic function with coefficient a negative.
There is no absolute maximum or absolute minimum.

Coefficient   may be negative as shown in diagram.


As   increases, the value of   is dominated by the term  

When   has a very large negative value,   is always positive.

When   has a very large positive value,   is always negative.


Unless stated otherwise, any reference to "cubic function" on this page will assume coefficient   positive.

Sum of roots 0

edit
 
Graph of cubic function with coefficient b missing.
Sum of roots is  
 axis compressed for clarity.

When sum of roots is   coefficient  


In the diagram, roots of   are  

Sum of roots  

Therefore coefficient  

Ratio of stationary points to roots

edit
 
Graph of cubic function with 2 stationary points.
Ratio of   to  
Ratio of   to  

Stationary points relative to roots:


Consider cubic function:  

Roots of function are:  

Derivative of function:  

Stationary points of function are roots of   or  

Ratio of   to    

Ratio of   to    

s = 2r

edit
 
Graph of cubic function with 2 stationary points.
  are stationary points.
 
Therefore,  

Equation of red curve in diagram:   where  

Aim of this section is to calculate   so that  

Associated quadratic when  

 

 

 

  is a root of this function. Divide   by  

Quotient is  

Remainder is   which equals  

  Therefore:

 

  Therefore  

Function as product of 3 linear functions

edit

The function may be expressed as:

  where   are roots of the function, in which case

  where:  

Solving the cubic equation means that, given  , at least one of   must be calculated.

Given  , I found that   can be calculated as:

 

This approach was not helpful.

Function as product of linear function and quadratic

edit

When   is a root of the function, the function may be expressed as:

  where

 

When one real root   is known, the other two roots may be calculated as roots of the quadratic function  .

   

When   is a root of the function,   or  

Therefore the expansion of      

Generally, if point   is any point on the curve and it is desired to calculate the other values of   that produce   then:

  or   and

     

When     and  

Let  

where  

If point   is any point on the curve of   then the solution of   provides the other values of   that produce  

 
Graph of cubic function and associated quadratic function.
All values of   that produce  

An example:

Let  

It is known that point   satisfies  

Let associated quadratic function  

Roots of   show that when   or  

General case

edit

For function allequal(), see isclose().

The following python code implements the functionality of this section:

# python code.

TwoRootsOfCubicDebug = 0

def TwoRootsOfCubic (abcd, x1) :
    '''
x2,x3 = TwoRootsOfCubic (abcd, x1)
f(x2) = f(x3) = f(x1)
If x1 is a root, then f(x2) = f(x3) = f(x1) = 0, and x2,x3 are roots.
x1 may be complex.
'''
    a,b,c,d = abcd
    B = a*x1 + b
    C = B*x1 + c
    disc = B*B - 4*a*C
    almostZero = 1e-15
    if abs(disc) <  almostZero :
        x2 = x3 = -B/(2*a)
    else :
        if isinstance (disc, complex) or (disc > 0) :
            root = disc ** .5
        else :
            root = ((-disc) ** .5)*1j
        x2 = (-B - root)/(2*a)
        x3 = (-B + root)/(2*a)

    if not TwoRootsOfCubicDebug : return x2,x3

    sum1,sum2,sum3 = [ (a*x*x*x + b*x*x + c*x + d) for x in (x1,x2,x3) ]
    print ('TwoRootsOfCubic ():')
    print ('    y = (',a,')xx + (',B, ')x + (', C, ')')
    print ('    for x1 =',x1,', sum1 =',sum1)
    print ('    for x2 =',x2,', sum2 =',sum2)
    print ('    for x3 =',x3,', sum3 =',sum3)
# sum1,sum2,sum3 should all be equal.
# In practice there may be small rounding errors.
# The following check allows for small errors, but flags
# errors that are not "small".
    allEqualDebug = 1
    allEqual((sum1,sum2,sum3))

    return x2,x3

The example above:

# python code.
print ( TwoRootsOfCubic ((3,-6,-3,22), 1) )
print ( TwoRootsOfCubic ((3,-6,-3,22), -1) )
print ( TwoRootsOfCubic ((3,-6,-3,22), 2) )
(-1.0, 2.0)
(1.0, 2.0)
(-1.0, 1.0)

When 1 root is known:

# python code.
print ( TwoRootsOfCubic ((1,-2,-5,6), 1) )
print ( TwoRootsOfCubic ((1,-3,-9,-5), 5) )
(-2.0, 3.0)
(-1.0, -1.0)

The method works with complex values:

# python code.
TwoRootsOfCubicDebug = 1
print ( TwoRootsOfCubic ((1,0,0,27), -3) )
print ( TwoRootsOfCubic ((1,9,31,39), -3+2j) )
TwoRootsOfCubic ():
    y = ( 1 )xx + ( -3 )x + ( 9 )
    for x1 = -3 , sum1 = 0
    for x2 = (1.5-2.598076211353316j) , sum2 = 0j
    for x3 = (1.5+2.598076211353316j) , sum3 = 0j
((1.5-2.598076211353316j), (1.5+2.598076211353316j))

TwoRootsOfCubic ():
    y = ( 1 )xx + ( (6+2j) )x + ( (9+6j) )
    for x1 = (-3+2j) , sum1 = 0j
    for x2 = (-3-2j) , sum2 = 0j
    for x3 = (-3+0j) , sum3 = 0j
((-3-2j), (-3+0j))

Notice complex coefficients:  


Reporting an error:

print(TwoRootsOfCubic ((3,-6,-3,22), -4+3j))
TwoRootsOfCubic ():
    y = ( 3 )xx + ( (-18+9j) )x + ( (42-90j) )
    for x1 = (-4+3j) , sum1 = (124+486j)
    for x2 = (0.264468373145825-5.338376386119454j) , sum2 = (124.00000000000007+485.9999999999998j)
    for x3 = (5.735531626854176+2.338376386119455j) , sum3 = (124.00000000000017+486.0000000000003j)
allEqual()6: 2 values not close. (124.00000000000007+485.9999999999998j) , (124.00000000000017+486.0000000000003j)
    abs(a-b)   = 5.211723197616109e-13
    comparison = 5.015695365550026e-13
((0.264468373145825-5.338376386119454j), (5.735531626854176+2.338376386119455j))

Notice complex coefficients:  

Function defined by 4 points

edit
 
Figure 1. Cubic function defined by 4 points

Any 4 points on the curve may be used to define the function.

Because the cubic function contains 4 coefficients, 4 simultaneous equations are needed to define the function.

See Figure 1. The cubic function may be defined by any 4 unique points on the curve.

For example, let us choose the four points:

 

Rearrange the standard cubic function to prepare for the calculation of  

 

For function solveMbyN see "Solving simultaneous equations" .

# python code

points = ((-4,-2), (-3,3), (2,3), (8,8))

L11 = []

for point in points :
    x,y = point
    L11 += [[x*x*x, x*x, x, 1, -y]]

print (L11)
[[-27,  9, -3, 1, -3],     #
 [-64, 16, -4, 1,  2],     # matrix supplied to function solveMbyN() below.
 [  8,  4,  2, 1, -3],     # 4 rows by 5 columns.
 [512, 64,  8, 1, -8]]     #

# python code

output = solveMbyN(L11)
print (output)
# 4 coefficients a, b, c, d:
(0.07575757575757577, -0.4545454545454544, -0.9848484848484848, 6.181818181818182)

The 4 coefficients above are in fact the values  

Cubic function defined by the 4 points   is  

Function defined by 3 points and 1 slope

edit

The cubic function may be defined by any 3 unique points on the curve and the slope at any 1 of these points.

For example, let us choose the three points:

 

It is known that the slope at point   is  

Rearrange the standard cubic function to prepare for the calculation of  

 

Equation of slope:  

Rearrange the equation of slope to prepare for the calculation of  

 

For function solveMbyN see "Solving simultaneous equations" .

# python code

points = ((-4,-2), (2,3), (8,8))

L11 = []

for point in points :
    x,y = point
    L11 += [[x*x*x, x*x, x, 1, -y]]

(x,y) = (8,8)
L11 += [[3*x*x, 2*x, 1, 0, -(6 + 19/66)]]

print (L11)
[[-64, 16, -4, 1,  2],     
 [  8,  4,  2, 1, -3],                 # matrix supplied to function solveMbyN() below.
 [512, 64,  8, 1, -8],                 # 4 rows by 5 columns.
 [192, 16,  1, 0, -6.287878787878788]]

# python code

output = solveMbyN(L11)
print (output)
# 4 coefficients a, b, c, d:
(0.07575757575757572, -0.4545454545454543, -0.9848484848484839, 6.181818181818179)

The 4 coefficients above are in fact the values   (same as above.)

 
Graphs of 2 different cubic functions that satisfy the same 4 criteria.

If these 4 criteria (3 points and 1 slope) are used to define the cubic in which   is the independent variable, result is:

     

Both curves satisfy the points   and have the same slope at point  

(In fact  )

The simplest cubic function

edit
 
Figure 1.

The simplest cubic function has coefficients  

The simplest cubic function has coefficients  , for example:

 .

To solve the equation:

 

 

 

The function also contains two complex roots that may be found as solutions of the associated quadratic:

  

     


Curve   is useful for finding the cube root of a real number.


Solve:  

 

 

This is equivalent to finding a root of function  


If you use Newton's method to solve   it may be advantageous to put   in form   where  

Then   Remember to preserve correct sign of result.

Roots of equal absolute value

edit

The cubic function  

Let one value of   be   and another be  .

Substitute these values into the original function in   and expand.

 

 

 

 

Reduce   and   and substitute   for  :

 

 

Combine   and   to eliminate   and produce a function in  :

 

From  

If   is a solution and function   becomes:

 

 

  and two roots of   are  .

An example

edit
 
Figure 2.

The roots of equal absolute value are  

See Figure 2.


 

 

The function has roots of equal absolute value.

 

The roots of equal absolute value are  .

This method works with complex roots of equal absolute value.


Consider function:  

 

 

  has roots of equal absolute value.

 

 

Roots of equal absolute value are:  

Equal Roots

edit

Combine   and   from above to eliminate   and produce a function in  :


         


From   above:    


If  , then   is a solution ,   and   become:

 

 

If   because  , there is a stationary point where  .

Note:

  •   is a factor of discriminant of cubic formula below. If   because the discriminant is  , function   contains at least 2 roots equal to   when both functions   are  .
  •   are functions of the curve and the slope of the curve. In other words, equal roots occur where the curve and the slope of the curve are both zero.

  and   can be combined to produce:

 

 


  and   can be combined to produce:

 

 


If the original function   contains 3 unique roots, then   are numerically different.


If the original function   contains exactly 2 equal roots, then   are numerically identical, and the 2 roots have the value   in  .


If the original function   contains 3 equal roots, then   are both null,   are numerically identical and  .


From equations (4g) and (5g):

     

Examples

edit

No equal roots

edit
 
Figure 3a.

Cubic function with 3 unique, real roots at  .

Consider function  

from  

from  

  are numerically different.

Exactly 2 equal roots

edit
 
Figure 3b.

Cubic function with 2 equal, real roots at  .

Consider function  

from  

from  

There are 2 equal roots at  

See Function_as_product_of_linear_function_and_quadratic above.

To calculate all roots:

# python code.
a,b,c,d = 1,-3,-9,-5

# Associated quadratic:
p = -1
A = a
B = A*p + b
C = B*p + c

# Associated linear function:
a1 = A
b1 = a1*p + B

print ('x3 =', -b1/a1)
x3 = 5.0

Roots of cubic function   are  

3 equal roots

edit
 
Figure 3c.

Cubic function with 3 equal, real roots at  .

Consider function  

from  

from  

from  

  are numerically identical, the discriminant of each is   and  

Depressed cubic

edit

The depressed cubic may be used to solve the cubic equation.

In the cubic function:   let  , substitute for   and expand:

 

When the function is equated to  , the depressed equation is:

  where

  and

 

In the depressed equation the coefficient of   is   and the coefficient of   is  .

 

The depressed function is a specific case of the general function in which coefficient   is missing.

Let  

Then point of inflection has coordinates   and  

When  

If coefficient   is missing, the cubic function becomes   and

  • point of inflection has coordinates   and
  • slope at point of inflection  

Be prepared for the possibility that one or both of   may be zero.

6 examples

edit

Six simple depressed cubic functions illustrate all the possible shapes of all cubic functions:

When A = 0

edit
 
Figure 4a.

Cubic function with slope 0 at point of inflection  .

This condition occurs when the cubic function in   has exactly one stationary point or when slope at point of inflection is zero.

 

 

 

 

The other roots may be derived from the associated quadratic:

  

       

When B = 0

edit
 
Figure 4b.

Cubic function with point of inflection   on   axis.

This condition occurs when the cubic function in   is of format   or when point of inflection is on the   axis.

 

 

 

 

 

When A = B = 0

edit
 
Figure 4c (same as 3c above).

Cubic function with:
* point of inflection   on   axis,
* slope   at point of inflection.

This condition occurs when:

  • slope at point of inflection is  , and
  • point of inflection is on   axis.


Consider function  

     

 

Vieta's substitution

edit

See Vieta's Substitution.

Let the depressed cubic be written as:   where   and  

Let  

Substitute for   in the depressed function:

 

  where   and  .

From the quadratic formula:  

The discriminant  . Substitute for   and expand:

This discriminant =  

The factor   is a factor of   under "Equal Roots" above.

Discriminant (B² - 4C³) == 0

edit
 
Figure 5a.

Cubic function with 2 equal, real roots at  .

If discriminant  , the function contains at least 2 equal, real roots.

Consider function   

 

 

 

 

Associated quadratic    

The 2 equal roots are:  .


Discriminant (B² - 4C³) positive

edit
 
Figure 5b.

Cubic function with discriminant   positive
and 1 real root at  .

If discriminant   is positive, the function contains exactly 1 real root.

Consider function  

discriminant  

 

 

 

 

or:

 

 

 


 

The associated quadratic is:  

and the two complex roots are:      

Discriminant (B² - 4C³) negative

edit

If discriminant   is negative, the function contains 3 real roots and   becomes the complex number  .


Let   be the modulus of  .

Let   be the real part of  .

Let   be the imaginary part of  .

Then  

 

 

 

Let   be the phase of  .

Then   and  .

 . Therefore:

 

 

 

 

An example

edit
 
Figure 5c.

Cubic function with 3 unique, real roots at  .

  in which  

 

 

 

 

 

  radians.

  radians.

 

 

 

 

 

Using Cosine (A/3)

edit

For function cosAfrom_cos3A see "Cosine(A/3)" .

# python code
from decimal import *
getcontext().prec = 40

a,b,c,d = [ Decimal(v) for v in (1,-2,-5,6) ]

A = 9*a*c - 3*b*b
B = 27*a*a*d - 9*a*b*c + 2*b*b*b
C = A/-3

Wreal = -B/2
wmod = C.sqrt()
Wmod = wmod * wmod * wmod
cosWφ = Wreal/Wmod

data = cosAfrom_cos3A(cosWφ)

for coswφ in data :
    wreal = wmod * coswφ
    t = 2*wreal
    x = (-b+t)/(3*a)
    print ('x =', float(x))

Results are:

x = 3.0
x = -2.0
x = 1.0

Review of complex math

edit
 
Figure 6a: Components of complex number Z.

Origin at point  .
  parallel to   axis.
  parallel to   axis.
  = modulus of   
Angle   is the phase of    


 
Figure 6b: Complex numbers   and  .

Origin at point  .
  (off image to left.)
 
 
 

A complex number contains a real part and an imaginary part, eg:  

In theoretical math the value   is usually written as  . In the field of electrical engineering and computer language Python it is usually written as  .


The value   is a complex number expressed in rectangular format.

The value   is a complex number expressed in polar format where   is the modulus of   or   and   is the phase of   or  

     

Multiplication of complex numbers

edit

       

To multiply complex numbers, multiply the moduli and add the phases.

Complex number cubed

edit

             


Generally    

For the cube of a complex number in polar format,  

Cube root of complex number W

edit

Let   and  

If   then:

  and

 

Complex number w + C/w

edit

Let   where  

 

If  

 

In the case of 3 real roots,  

Cubic formula

edit

The substitutions made above can be used to produce a formula for the solution of the cubic equation.

Given cubic equation:   calculate the 3 values of  

  where:

Coefficients of depressed cubic:

 

 

One root of cubic function:

 

 

 

 

 

 

Formula incorporating all eight statements above is:

 

Cube roots of unity are:   See "Cube roots of 1."


Therefore   has 3 values:

 

 

 

It is not necessary to use both values of  

Choose either   or  

If   contains 3 equal roots,   and line t = w + C/w fails with divisor  

Before using this formula, check for equal roots as in "3 equal roots" above.

Using cubic formula

edit

2 equal roots

edit
 
Graph of cubic function with 2 equal roots at  
Y axis compressed for clarity.

Calculate roots of  

# python code
a,b,c,d = 1, -7, -5, 75
A = 9*a*c - 3*b*b
B = 27*a*a*d - 9*a*b*c + 2*b*b*b
C = -A/3
Δ = B*B - 4*C*C*C
print ('Δ =', Δ)
W = -B/2
# The following 2 lines ensure that cube root of negative
# real number is real number.
if W < 0 : w_ = -((-W)**(1/3))
else : w_ = W**(1/3)
r3 = 3**(0.5)
values_of_w = (w_, 
               w_*(-1 + 1j*r3)/2, 
               w_*(-1 - 1j*r3)/2)
for w in values_of_w :
    print ()
    print ('w =', w)
    t = w + C/w
    print ('t =', t)
    x = (-b + t)/(3*a)
    print ('x =', x)
Δ = 0.0

w = -8
t = -16
x = -3

w = (4-6.928203230275509j)
t = 8
x = 5

w = (4+6.928203230275508j)
t = 8
x = 5

Notice that:

  •   is zero.
  •  
  •  

1 real root

edit
 
Graph of cubic function with 1 real root at  
Y axis compressed for clarity.

Calculate roots of  

# python code
a,b,c,d = 1, -7, -1, 87
A = 9*a*c - 3*b*b
B = 27*a*a*d - 9*a*b*c + 2*b*b*b
C = -A/3
Δ = B*B - 4*C*C*C
print ('Δ =', Δ)
δ = (Δ)**.5
W = (-B+δ)/2
if W < 0 : w_ = -((-W)**(1/3))
else : w_ = W**(1/3)
r3 = 3**(0.5)
values_of_w = (w_, 
               w_*(-1 + 1j*r3)/2, 
               w_*(-1 - 1j*r3)/2)
for w in values_of_w :
    print ()
    print ('w =', w)
    t = w + C/w
    print ('t =', t)
    x = (-b + t)/(3*a)
    print ('x =', x)
Δ = 1997568.0

w = -4.535898384862245
t = -16
x = -3

w = (2.2679491924311215-3.9282032302755088j)
t = (8.0+6.0j)
x = (5.0+2.0j)

w = (2.267949192431123+3.9282032302755083j)
t = (8.0-6.0j)
x = (5.0-2.0j)

Notice that:

  •   is positive.
  •  
  •   does not equal  

3 real roots

edit
 
Graph of cubic function with 3 real roots,  
Y axis compressed for clarity.

Calculate roots of  

# python code
a,b,c,d = 5, -62, 11, 726
A = 9*a*c - 3*b*b
B = 27*a*a*d - 9*a*b*c + 2*b*b*b
C = -A/3
Δ = B*B - 4*C*C*C
print ('Δ =', Δ)
δ = (Δ)**.5
W = (-B-δ)/2
w_ = W**(1/3)
r3 = 3**(0.5)
values_of_w = (w_, 
               w_*(-1 + 1j*r3)/2, 
               w_*(-1 - 1j*r3)/2)
for w in values_of_w :
    print ()
    print ('w =', w)
    t = w + C/w
    print ('t =', t)
    x = (-b + t)/(3*a)
    print ('x =', x)
Δ = -197238264300.0

w = (51.5-32.042939940024226j)
t = 103
x = 11

w = (2.0+60.62177826491069j)
t = 4.0
x = 4.4

w = (-53.5-28.578838324886462j)
t = -107
x = -3

Notice that:

  •   is negative
  •  
  •   equals  

cos (A/3)

edit

The method above for calculating   depends upon calculating the value of angle  

However,   may be calculated from   because  

Generally, when   is known, there are 3 possible values of the third angle because  

This suggests that there is a cubic relationship between   and  

Expansion of cos (3A)

edit
 
Figure 7a.

Graph of  

The well known identity for   is:

 

The derivation of this identity may help understanding and interpreting the curve of  

Let  

  and  

Therefore the point   is on the curve and  

A 3A cos A cos 3A
0 0 1 1
180 180*3 -l -1
60 180 0.5 -1

Three simultaneous equations may be created from the above table:

 

 

Therefore  

 

 

  and  

When   is known,  

Newton's Method

edit
 
Figure 7b.

Newton's Method used to calculate   when  

Newton's method is a simple and fast root finding method that can be applied effectively to the calculation of   when   is known because:

  • the function is continuous in the area under search.
  • the derivative of the function is continuous in the area under search.
  • the method avoids proximity to stationary points.
  • a suitable starting point is easily chosen.

See Figure 7b.

Perl code used to calculate   when   is:

$cos3A = 0.1;

$x = 1; # starting point.
$y = 4*$x*$x*$x - 3*$x - $cos3A;

while(abs($y) > 0.00000000000001){
    $s = 12*$x*$x - 3; # slope of curve at x.
    $delta_x = $y/$s;
    $x -= $delta_x;
    $y = 4*$x*$x*$x - 3*$x - $cos3A;

    print "                                                                                   
x=$x                                                                                              
y=$y                                                                                              
";
}

print "                                                                                           
cos(A) = $x                                                                                       
";
x=0.9
y=0.116

x=0.882738095238095
y=0.00319753789412588

x=0.882234602936352
y=2.68482638085543e-06

x=0.882234179465815
y=1.89812054962601e-12

x=0.882234179465516
y=-3.60822483003176e-16

cos(A) = 0.882234179465516

When cos(3A) is positive

edit
 
Figure 7c.

Newton's Method used to calculate   when  

When   output of the above code is:

x=0.933333333333333
y=0.0521481481481486

x=0.926336712383224
y=0.000546900278781126

x=0.926261765753783
y=6.24370847246425e-08

x=0.926261757195518
y=7.7715611723761e-16

cos(A) = 0.926261757195518

If all 3 values of   are required, the other 2 values can be calculated as roots of the associated quadratic function with coefficients  

x1 = -0.136742508909433
x2 = -0.789519248286085

Proof:

# python code
values = (0.926261757195518, -0.136742508909433, -0.789519248286085)

for cosA in values :
    cos3A_ = 4*cosA*cosA*cosA -	3*cosA
    difference = abs (cos3A_ - 0.4)
    print ('cosA =',cosA,'   difference =',difference)

Results:

cosA =  0.926261757195518    difference = 7.771561172376096e-16
cosA = -0.136742508909433    difference = 1.7208456881689926e-15
cosA = -0.789519248286085    difference = 2.1094237467877974e-15

When cos(3A) is negative

edit
 
Figure 7d.

Newton's Method used to calculate   when  

When   is negative, the starting value of  

When   output of the above code is:

x=-0.911111111111111
y=-0.0920054869684496

x=-0.89789474513884
y=-0.00190051666894692

x=-0.897610005610658
y=-8.73486682706481e-07

x=-0.89760987462259
y=-1.8446355554147e-13

x=-0.897609874622562
y=-1.66533453693773e-16

cos(A) = -0.897609874622562

An example

edit
 
Figure 7e.

Cubic function with 3 unique, real roots at  .

  in which  

 

 

 

 

 

Use the code beside Figure 7b above with initial conditions:

$cosWphi = -0.338086344651354;

$cos3A = $cosWφ;

$x = -1; # starting point.

 

 

 

 

 

Point of Inflection

edit

The Point of Inflection is the point at which the slope of the curve is minimum.

After taking the first and second derivatives value   at point of inflection is:

 

The slope at point of inflection is:

 

Value   at point of inflection is:

 

From basic principles

edit
 
Figure 1. 4 points relative to point of inflection.

Relative to point of inflection  :
Points   have coordinates  .
Points   have coordinates  .
When 2 points are equidistant in terms of   they are also equidistant in terms of  

  may be calculated from basic principles.

Let us define the point of inflection as the point about which the curve is symmetric.

Let   and let   be non-zero.

Then   where   is point of inflection.

Let