discrim - Maple Programming Help

discrim

discriminant of a polynomial

 Calling Sequence discrim(p, x)

Parameters

 p - polynomial in x x - independent variable

Description

 • If $d=\mathrm{degree}\left(p,x\right)$ and $a=\mathrm{lcoeff}\left(p,x\right)$ then the discriminant is

$\frac{{\left(-1\right)}^{\frac{d\left(d-1\right)}{2}}\mathrm{resultant}\left(p,\frac{\partial }{\partial x}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}p,x\right)}{a}$

Examples

 > $p≔a{x}^{2}+bx+c$
 ${p}{≔}{a}{}{{x}}^{{2}}{+}{b}{}{x}{+}{c}$ (1)
 > $\mathrm{discrim}\left(p,x\right)$
 ${-}{4}{}{a}{}{c}{+}{{b}}^{{2}}$ (2)
 > $l≔5{x}^{2}+x-1$
 ${l}{≔}{5}{}{{x}}^{{2}}{+}{x}{-}{1}$ (3)
 > $\mathrm{discrim}\left(l,x\right)$
 ${21}$ (4)
 > $\mathrm{solve}\left(l,x\right)$
 ${-}\frac{{1}}{{10}}{+}\frac{\sqrt{{21}}}{{10}}{,}{-}\frac{{1}}{{10}}{-}\frac{\sqrt{{21}}}{{10}}$ (5)
 > $k≔\frac{{x}^{2}}{2}-x+3$
 ${k}{≔}\frac{{1}}{{2}}{}{{x}}^{{2}}{-}{x}{+}{3}$ (6)
 > $\mathrm{discrim}\left(k,x\right)$
 ${-5}$ (7)
 > $\mathrm{solve}\left(k,x\right)$
 ${1}{+}{I}{}\sqrt{{5}}{,}{1}{-}{I}{}\sqrt{{5}}$ (8)