resultant
Resultant of two polynomials
Description
Examples
Find the resultant of two polynomials.
syms x y p = x^2+y; q = x-2*y; resultant(p,q)
ans = 4*y^2 + y
Find the resultant with respect to a specific variable by using the third argument.
resultant(p,q,y)
ans = 2*x^2 + x
If two polynomials have a common root, then the resultant must be 0 at that root. Solve polynomial equations in two variables by calculating the resultant with respect to one variable, and solving the resultant for the other variable.
First, calculate the resultant of two polynomials with respect to
                            x to return a polynomial in
                        y.
syms x y p = y^3 - 2*x^2 + 3*x*y; q = x^3 + 2*y^2 - 5*x^2*y; res = resultant(p,q,x)
res = y^9 - 35*y^8 + 44*y^6 + 126*y^5 - 32*y^4
Solve the resultant for y values of the roots. Avoid
                        numerical roundoff errors by solving equations symbolically using the
                            solve function. solve
                        represents the solutions symbolically by using
                        root.
yRoots = solve(res)
yRoots =
                                              0
                                              0
                                              0
                                              0
 root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 1)
 root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 2)
 root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 3)
 root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 4)
 root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 5)Calculate numeric values by using vpa.
vpa(yRoots)
ans =
                                                                         0
                                                                         0
                                                                         0
                                                                         0
                                        0.23545637976581197505601615070637
 - 0.98628744767074109264070992415511 - 1.1027291033304653904984097788422i
 - 0.98628744767074109264070992415511 + 1.1027291033304653904984097788422i
                                         1.7760440932430169904041045113342
                                          34.96107442233265321982129918627Assume that you want to investigate the fifth root. For the fifth root,
                        calculate the x value by substituting the
                            y value into p and
                            q. Then simultaneously solve the polynomials for
                            x. Avoid numerical roundoff errors by solving
                        equations symbolically using solve.
eqns = subs([p q], y, yRoots(5)); xRoot5 = solve(eqns,x);
Calculate the numeric value of the fifth root by using
                            vpa.
root5 = vpa([xRoot5 yRoots(5)])
root5 = [ 0.37078716473998365045397220797284, 0.23545637976581197505601615070637]
Verify that the root is correct by substituting root5
                        into p and q. The result is
                            0 within roundoff error.
subs([p q],[x y],root5)
ans = [ -6.313690360861895794753956010471e-41, -9.1835496157991211560057541970488e-41]
Input Arguments
Polynomial, specified as a symbolic expression or function.
Polynomial, specified as a symbolic expression or function.
Variable, specified as a symbolic variable.
Version History
Introduced in R2018a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)