RÉSOLUTION D'UNE ÉQUATION DU SECOND DEGRÉ

Cours

Propriété 1 : $a, b$ et $c$ sont des réels, $a \neq 0$. On note $(E)$ l'équation $ax^2 + bx + c = 0$ définie dans $\mathbb{R}$.

  • Si $\Delta > 0$ alors $(E)$ a 2 solutions distinctes $x_1 = \dfrac{-b - \sqrt{\Delta}}{2a}$ et $x_2 = \dfrac{-b + \sqrt{\Delta}}{2a}$.
  • Si $\Delta = 0$ alors $(E)$ a une solution $x_0 = -\dfrac{b}{2a}$.
  • Si $\Delta < 0$ alors $(E)$ n'a pas de solution.

Démonstration :

  • Si $\Delta > 0$ alors
    $\displaystyle ax^2 + bx + c = a \left[ \left(x + \dfrac{b}{2a}\right)^2 - \dfrac{\Delta}{4a^2} \right] = a \left[ \left(x + \dfrac{b}{2a}\right)^2 - \left(\dfrac{\sqrt{\Delta}}{2a}\right)^2 \right]$
    $\displaystyle = a \left(x + \dfrac{b}{2a} + \dfrac{\sqrt{\Delta}}{2a}\right) \left(x + \dfrac{b}{2a} - \dfrac{\sqrt{\Delta}}{2a}\right) = a \left(x + \dfrac{b + \sqrt{\Delta}}{2a}\right) \left(x + \dfrac{b - \sqrt{\Delta}}{2a}\right) = 0$
    $a \neq 0$ donc $x + \dfrac{b + \sqrt{\Delta}}{2a} = 0$ ou $x + \dfrac{b - \sqrt{\Delta}}{2a} = 0$ d'où $x = \dfrac{-b - \sqrt{\Delta}}{2a}$ ou $x = \dfrac{-b + \sqrt{\Delta}}{2a}$.
  • Si $\Delta = 0$ alors
    $\displaystyle ax^2 + bx + c = a \left[ \left(x + \dfrac{b}{2a}\right)^2 - 0 \right] = a \left(x + \dfrac{b}{2a}\right)^2 = 0$
    $a \neq 0$ donc $x + \dfrac{b}{2a} = 0$ d'où $x = -\dfrac{b}{2a}$.
  • Si $\Delta < 0$ alors $-\dfrac{\Delta}{4a^2} > 0$ et $\left(x + \dfrac{b}{2a}\right)^2 \geq 0$ donc $\left(x + \dfrac{b}{2a}\right)^2 - \dfrac{\Delta}{4a^2} > 0$
    $a \neq 0$ donc l'équation $ax^2 + bx + c = 0$ n'a pas de solution.

Exemple de résolution d'une équation du second degré :

Résolution de l'équation $x^2 - 5x + 6 = 0$ dans $\mathbb{R}$ :

Les coefficients de ce polynôme de degré 2 sont $a = 1$, $b = -5$, $c = 6$
donc $\Delta = b^2 - 4ac = (-5)^2 - 4 \times 1 \times 6 = 25 - 24 = 1$

$\Delta > 0$ donc l'équation a 2 solutions :

$\displaystyle \begin{cases} x_1 = \dfrac{-b - \sqrt{\Delta}}{2a} = \dfrac{5 - 1}{2 \times 1} = \dfrac{4}{2} = 2 \\[0.3cm] x_2 = \dfrac{-b + \sqrt{\Delta}}{2a} = \dfrac{5 + 1}{2 \times 1} = \dfrac{6}{2} = 3 \end{cases}$ donc $S = \{ 2 ; 3 \}$.

Programme Python : Résolution de $ax^2+bx+c=0$

from math import *

a = float(input("Entrez a : "))
b = float(input("Entrez b : "))
c = float(input("Entrez c : "))

delta = b**2 - 4*a*c

if delta < 0:
    print("Aucune solution")
elif delta == 0:
    x0 = -b / (2*a)
    print("Solution unique :", x0)
else:
    x1 = (-b - sqrt(delta)) / (2*a)
    x2 = (-b + sqrt(delta)) / (2*a)
    print("Deux solutions :", x1, "et", x2)

Vocabulaire : Les solutions de l'équation $ax^2 + bx + c = 0$ sont appelées les racines du polynôme $ax^2 + bx + c$.

Propriété 2 : $a, b$ et $c$ sont des réels, $a \neq 0$.

  • Si $\Delta > 0$ alors $ax^2 + bx + c = a(x - x_1)(x - x_2)$.
  • Si $\Delta = 0$ alors $ax^2 + bx + c = a(x - x_0)^2$.

L'expression $a(x - x_1)(x - x_2)$, ou l'expression $a(x - x_0)^2$, est appelée forme factorisée du polynôme $ax^2 + bx + c$.

Propriété 3 : Si le polynôme $ax^2 + bx + c$ a deux racines $x_1$ et $x_2$ alors :

$\displaystyle \begin{cases} x_1 + x_2 = -\dfrac{b}{a} \\[0.3cm] x_1 \times x_2 = \dfrac{c}{a} \end{cases}$

Démonstration :

$\displaystyle \begin{aligned} \forall x \in \mathbb{R},\quad ax^2 + bx + c &= a\left[\left(x + \dfrac{b}{2a}\right)^2 - \dfrac{\Delta}{4a^2}\right] \\[0.3cm] &= a(x - x_1)(x - x_2) \\[0.3cm] &= a(x^2 - x_1 x - x_2 x + x_1 x_2) \\[0.3cm] &= a[x^2 - x(x_1 + x_2) + x_1 x_2] \\[0.3cm] &= ax^2 - a(x_1 + x_2)x + a x_1 x_2 \end{aligned}$

Par identification, $\begin{cases} b = -a(x_1 + x_2) \\ c = a x_1 x_2 \end{cases}$ donc $\begin{cases} x_1 + x_2 = -\dfrac{b}{a} \\[0.3cm] x_1 \times x_2 = \dfrac{c}{a} \end{cases}$

Racine évidente :

Résolution de l'équation $2x^2 - 5x + 3 = 0$ dans $\mathbb{R}$ :

On remarque que $x_1 = 1$ est une racine évidente de l'équation car $2(1)^2 - 5(1) + 3 = 2 - 5 + 3 = 0$.

D'après la propriété précédente, le produit des racines est $x_1 \times x_2 = \dfrac{c}{a}$, c'est-à-dire $1 \times x_2 = \dfrac{3}{2}$.

On en déduit que $x_2 = \dfrac{3}{2}$. L'équation a donc deux solutions distinctes.

Ainsi, $S = \left\{ 1 ; \dfrac{3}{2} \right\}$.