Depressed cubic polynomial
22 May 2012
29 May 2012)
Function to obtain the "depressed" cubic polynomial, from the general cubic form.
function p2 = depressedcubic(p1)
% depressedcubic.m - Convert a 3rd-order polynomial to the depressed cubic form
% Syntax: p2 = depressedcubic(p1)
% Where p1 has the form p1 = [ a b c d ] meaning p1(y) = a*y^3 + b*y^2 + c*y +d
% and p2 is p2 = [ a 0 k1 k2 ]
% Input should be a valid vector of coefficients following the Matlab format with
% the highest-order coefficient first and the independent term last.
% The depressed form p2 is returned with same shape of p1 (i.e., p1
% being a row vector or a column vector) as long as it is a 4-vector.
% The only condition needed, other than entering a valid cubic polynomial, is that
% "a" should not be zero.
% Let p1(y) be a 3rd-order polynomial such that p1(y) = a*y^3 + b*y^2 + c*y +d
% By applying the change of variable y = x - b/(3a) we can obtain the cubic form:
% p2(x) = a*x^3 + k1*x + k2
% where k1 = c - b^2/(3a)
% k2 = d - bc/(3a) + 2*b^3 /(27*a^2)
% Thus, depressedcubic.m converts a general cubic polynomial to a new cubic polynomial
% without the x^2 term, also known as "depressed cubic polynomial".
% Historical Note:
% The method was first published by Girolamo Cardano (1501-1576) in his Ars Magna,
% based on the solution by Nicolo' Fontana (a.k.a. Tartaglia; 1500-1557) whose work
% was based on Scipione Del Ferro (1465-1526).
% The true developers being Del Ferro and Tartaglia; while Cardano was only the publisher.
% References - Web:
% * http://www-history.mcs.st-andrews.ac.uk/history/HistTopics/Quadratic_etc_equations.html
% * http://www.sosmath.com/algebra/factor/fac11/fac11.html
% * R Franci and T Rigatelli, Towards a history of algebra from Leonardo of Pisa to Luca Pacioli, Janus 72 (1985), 17-85.
% * B Hughes, The earliest correct algebraic solutions of cubic equations, Vita mathematica (Washington, DC, 1996), 107-112.
% * (Spanish) C Romo Santos, Cardano's 'Ars magna' and the solutions of cubic and quartic equations, Rev. Acad. Canaria Cienc. 7 (1) (1995), 187-201.
% * (Italian) R Franci and T Rigatelli, Storia della teoria delle equazioni algebriche (Milan, 1979).
% Version history:
% Version 1: Originally intended to process monic cubic forms (old name delferro.m)
% Version 2: (Current version) It can process a general cubic form. References to articles in
% journals on Math History added. Also, following suggestions by D'Errico, J., some
% web references are added, the Help section is improved and the file is renamed
% with a more representative name (depressedcubic.m)
% Matlab function by Isaac M. M., Trieste(Italy). May 22, 2012 @18h45:54
% Istituto Nazionale di Oceanografia e di Geofisica Sperimentale
% Trieste, ITALY.
% Developed under Matlab(TM) version 22.214.171.124 (R14) Service Pack 3
% Last modified on May 29, 2012 @12h17:25
if ( isvector(p1) )
error('coefficient of x^3 should not be zero')
a = p1(1);
b = p1(2);
c = p1(3);
d = p1(4);
k1 = c - (b*b)/(3*a);
k2 = d - (c*b)/(3*a) + 2*(b*b*b)/(27*a*a);
p2(2) = 0;
p2(3) = k1;
p2(4) = k2;
error('Input should be a third-order Polynomial function (4-vector)')
error('Input argument should be a vector of polynomial coefficients')