Bopytex/example/tpl_2ndDeg.tex

125 lines
3.6 KiB
TeX
Raw Normal View History

2015-02-08 16:04:05 +00:00
\documentclass[a4paper,10pt]{article}
\RequirePackage[utf8x]{inputenc}
\RequirePackage[francais]{babel}
\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{subfig}
\RequirePackage{graphicx}
\RequirePackage{color}
% Title Page
\title{Calcul littéral et statistiques}
\date{\today}
\begin{document}
\maketitle
\section{Polynômes}
2015-03-19 21:05:00 +00:00
\Block{set P = Polynom_deg2.random(["{a}", "{b}", "{c}"], ["{b}**2 - 4*{a}*{c} == 0"])}
2015-02-08 16:04:05 +00:00
Résoudre l'équation suivante
\begin{eqnarray*}
\Var{P} & = & 0
\end{eqnarray*}
Solution:
2015-03-19 21:05:00 +00:00
On commence par calculer le discriminant de $P(x) = \Var{P}$.
2015-02-08 16:04:05 +00:00
\begin{eqnarray*}
\Delta & = & b^2-4ac \\
2015-03-19 21:05:00 +00:00
\Var{P.delta.explain()|calculus(name="\\Delta")}
2015-02-08 16:04:05 +00:00
\end{eqnarray*}
2015-03-19 21:05:00 +00:00
\Block{if P.delta > 0}
comme $\Delta = \Var{P.delta} > 0$ donc $P$ a deux racines
2015-02-08 16:04:05 +00:00
\begin{eqnarray*}
2015-03-19 21:05:00 +00:00
x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-P.b} - \sqrt{\Var{P.delta}}}{2 \times \Var{P.a}} = \Var{P.roots()[0] } \\
x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-P.b} + \sqrt{\Var{P.delta}}}{2 \times \Var{P.a}} = \Var{P.roots()[1] }
2015-02-08 16:04:05 +00:00
\end{eqnarray*}
2015-03-19 21:05:00 +00:00
Les solutions de l'équation $\Var{P} = 0$ sont donc $\mathcal{S} = \left\{ \Var{min(P.roots())}; \Var{max(P.roots())} \right\}$
2015-02-08 16:04:05 +00:00
2015-03-19 21:05:00 +00:00
\Block{elif P.delta == 0}
Comme $\Delta = 0$ donc $P$ a deux racines
2015-02-08 16:04:05 +00:00
\begin{eqnarray*}
2015-03-19 21:05:00 +00:00
x_1 = \frac{-b}{2a} = \Var{P.roots()[0]} \\
2015-02-08 16:04:05 +00:00
\end{eqnarray*}
2015-03-19 21:05:00 +00:00
La solution de $\Var{P} = 0$ est donc $\mathcal{S} = \left\{ \Var{P.roots()[0]}\right\}$
2015-02-08 16:04:05 +00:00
\Block{else}
2015-03-19 21:05:00 +00:00
Alors $\Delta = \Var{P.delta} < 0$ donc $P$ n'a pas de racine donc l'équation $\var{P} = 0$ n'a pas de solution.
2015-02-08 16:04:05 +00:00
\Block{endif}
\bigskip
~\dotfill
\bigskip
2015-03-19 21:05:00 +00:00
\Block{set P = Polynom_deg2.random(["{a}", "{b}", "{c}"])}
\Block{set Q = Polynom_deg2.random(["{a}", "{b}", "{c}"])}
2015-02-08 16:04:05 +00:00
Résoudre l'équation suivante
\begin{eqnarray*}
\Var{P} & = & \Var{Q}
\end{eqnarray*}
Solution:
On commence par se ramener à une équation de la forme $ax^2+bx+c = 0$.
2015-03-19 21:05:00 +00:00
\Block{set R = Polynom_deg2((P-Q)._coef)}
2015-02-08 16:04:05 +00:00
\begin{eqnarray*}
\Var{P} = \Var{Q} & \Leftrightarrow & \Var{P} - (\Var{Q}) = 0 \\
2015-03-19 21:05:00 +00:00
\Var{R.explain() | calculus(name = "", sep = "\\Leftrightarrow", end = "= 0")}
2015-02-08 16:04:05 +00:00
\end{eqnarray*}
On cherche maintenant à résoudre l'équation $\Var{R} = 0$.
2015-03-19 21:05:00 +00:00
On commence par calculer le discriminant de $R(x) = \Var{R}$.
2015-02-08 16:04:05 +00:00
\begin{eqnarray*}
\Delta & = & b^2-4ac \\
2015-03-19 21:05:00 +00:00
\Var{R.delta.explain()|calculus(name="\\Delta")}
2015-02-08 16:04:05 +00:00
\end{eqnarray*}
2015-03-19 21:05:00 +00:00
\Block{set Delta = R.delta}
2015-02-08 16:04:05 +00:00
2015-03-19 21:05:00 +00:00
\Block{if R.delta > 0}
comme $\Delta = \Var{R.delta} > 0$ donc $R$ a deux racines
2015-02-08 16:04:05 +00:00
\begin{eqnarray*}
2015-03-19 21:05:00 +00:00
x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-R.b} - \sqrt{\Var{Delta}}}{2 \times \Var{R.a}} = \Var{R.roots()[0] } \\
x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-R.b} + \sqrt{\Var{Delta}}}{2 \times \Var{R.a}} = \Var{R.roots()[1] }
2015-02-08 16:04:05 +00:00
\end{eqnarray*}
2015-03-19 21:05:00 +00:00
Les solutions de l'équation $\Var{R} = 0$ sont donc $\mathcal{S} = \left\{ \Var{min(R.roots())}; \Var{max(R.roots())} \right\}$
2015-02-08 16:04:05 +00:00
2015-03-19 21:05:00 +00:00
\Block{elif R.delta == 0}
Comme $\Delta = 0$ donc $R$ a deux racines
2015-02-08 16:04:05 +00:00
\begin{eqnarray*}
2015-03-19 21:05:00 +00:00
x_1 = \frac{-b}{2a} = \Var{R.roots()[0]} \\
2015-02-08 16:04:05 +00:00
\end{eqnarray*}
2015-03-19 21:05:00 +00:00
La solution de $\Var{R} = 0$ est donc $\mathcal{S} = \left\{ \Var{R.roots()[0]}\right\}$
2015-02-08 16:04:05 +00:00
\Block{else}
2015-03-19 21:05:00 +00:00
Alors $\Delta = \Var{R.delta} < 0$ donc $R$ n'a pas de racine donc l'équation $\Var{R} = 0$ n'a pas de solution.
2015-02-08 16:04:05 +00:00
\Block{endif}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% End: