\documentclass[12pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage[hmargin=1.5cm,vmargin=1.5cm]{geometry}
\usepackage{tikz}
\usepackage[colorlinks=true]{hyperref}
\setlength{\parindent}{0pt}
\begin{document}
\title{La diagonale du cube}
\author{Stéphane PASQUET\\ \url{http://www.mathweb.fr}}
\maketitle

Soit ABCDHEFG un cube d'arête 1.\\
Calculez la longueur de la diagonale [EC].

\begin{center}
\begin{tikzpicture}
\draw (0,0) node[above left] {A} -- (3,0) node[below right] {D} -- (3,-3) node[below right] {C} -- (0,-3) node[below left] {B} -- cycle;
\draw (1.5,1.5) node[above left] {E} -- (4.5,1.5) node[below right] {H} -- (4.5,-1.5) node[below right] {G};
\draw[dashed] (4.5,-1.5) -- (1.5,-1.5) node[left] {F} -- (1.5,1.5);
\draw[dashed] (1.5,-1.5) -- (0,-3);
\draw (0,0) -- (1.5,1.5);
\draw (3,0) -- (4.5,1.5);
\draw (3,-3) -- (4.5,-1.5);
\draw[thick,dotted,red] (1.5,1.5) -- (3,-3);
\draw[dotted,gray] (1.5,-1.5) -- (3,-3);
\end{tikzpicture}
\end{center}

\medskip

\textbf{Réponse.}

\medskip

Le triangle FBC est rectangle en B donc, d'après le théorème de Pythagore, $FC^2 = FB^2 + BC^2$.\\
Donc $FC^2 = 1^2 + 1^2 = 2$.

\medskip

De même, dans le triangle EFC rectangle en F : $EC^2 = FC^2 + EF^2$.\\
Donc $EC^2 = 2 + 1^2 = 3$.

\medskip

\underline{Ainsi,$EC = \sqrt{3}$.}
\end{document}
