I need to calculate the discriminant of the following polynomial by hand:
$$\lambda^2-8\lambda-a\lambda-27+5a$$
where $a$ is a constant
I calculate the discriminant D as
$$D=(-a\lambda-8\lambda)^2-4\cdot1\cdot((-27)+5a)={a}^{2}{\lambda}^{2}+16\,a{\lambda}^{2}+64\,{\lambda}^{2}-20\,a+108$$
However, when I calculate the discriminant using Maple I get
$$D=a^2-4a+172$$
Which is the correct result.
Can anyone see where I've gone wrong?
Well, the discriminant of a polynomial $ax^2+bx+c$ is given by
$$b^2-4ac$$
So, taking you polynomial $x^2-8x-ax-27+5a=x^2-(8+a)x-27+5a$, we have that the discriminant is
$$(-(8+a))^2-4(-27+5a)=8^2+16a+a^2+108-20a=a^2-4a+172$$
As a little on the side: The discriminant of a polynomial is helpful tool in reasoning about the roots of a polynomial without knowing them.
In the quadratic case, i.e. looking a polynomials of degree two $ax^2+bx+c$, the discriminant has this nice and simple form of $b^2-4ac$ to which you can give a straightforward connection to the roots of $ax^2+bx+c$ by looking at the general expression for the solution given by the quadratic formula:
$$x_{1,2}=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$
Here, the discriminant appears under the square root and thus can work as a measure of how many real roots there are and what multiplicity they have.
If $b^2-4ac=0$, then $\sqrt{b^2-4ac}=0$ and by the above formula there is one real solution of multiplicity two.
For $b^2-4ac>0$, you have $\sqrt{b^2-4ac}>0$, giving you two distinct real solutions.
Lastly for $b^2-4ac<0$, you have $\sqrt{b^2-4ac}\in\mathbb C$ and thus no real solutions.