% theme: Calcul litteral

\begin{parts}
    \part Développer les expressions suivantes
    \begin{multicols}{3}
        \begin{subparts}
            \Block{set e = Expression.random("_*(_*x + _)")}
            \subpart $A = \Var{e}$
            \begin{solution}
                \begin{eqnarray*}
                    \Var{e.simplify().explain() | calculus(name = "A")}
                \end{eqnarray*}
            \end{solution}

            \Block{set e = Expression.random("(_*x+_)(_*x + _)", val_min = 2)}
            \subpart $B = \Var{e}$
            \begin{solution}
                \begin{eqnarray*}
                    \Var{e.simplify().explain() | calculus(name = "B")}
                \end{eqnarray*}
            \end{solution}

            \columnbreak

            \Block{set e = Expression.random("(_*x + _)^2", val_min = 2)}
            \subpart $C = \Var{e}$
            \begin{solution}
                \begin{eqnarray*}
                    \Var{e.simplify().explain() | calculus(name = "C")}
                \end{eqnarray*}
            \end{solution}

        \end{subparts}
    \end{multicols}

    \part Factoriser les expressions suivantes
    \begin{multicols}{3}
        \begin{subparts}
            \Block{set e = Expression.random("{a}x*(_*x + _)", conditions = ['{a} >= 2'])}
            \subpart $A = \Var{e.simplify()}$
            \begin{solution}
                \begin{eqnarray*}
                    A = \Var{e.simplify()} = \Var{e}
                \end{eqnarray*}
            \end{solution}

            \Block{set e = Expression.random("_x*(_*x + _)")}
            \subpart $B = \Var{e.simplify()}$
            \begin{solution}
                \begin{eqnarray*}
                    B = \Var{e.simplify()} = \Var{e}
                \end{eqnarray*}
            \end{solution}

            \columnbreak

            \Block{set e = Expression.random("_x*(_*x + _)")}
            \subpart $C = \Var{e.simplify()}$
            \begin{solution}
                \begin{eqnarray*}
                    C = \Var{e.simplify()} = \Var{e}
                \end{eqnarray*}
            \end{solution}

        \end{subparts}
    \end{multicols}

    \part Résoudre les équations suivantes.
    \begin{multicols}{3}
        \begin{subparts}
            \Block{set e = Equation.random("{a}x  + _  = 0",
                                            conditions = ["{a}!= 1"],
                                            val_min = 2,
                                            val_max = 150
                                            )}
            \subpart $\Var{e}$
            \begin{solution}
                \begin{align*}
                    \Block{for i in e.solve()} \Var{i[0]} &= \Var{i[1]} \\ \Block{endfor}
                \end{align*}
            \end{solution}

            \Block{set e = Equation.random("_x + _ = _",
                                            conditions = ["{a}!= 1"],
                                            val_min = -10,
                                            val_max = 15
                                            )}
            \subpart $\Var{e}$
            \begin{solution}
                \begin{align*}
                    \Block{for i in e.solve()} \Var{i[0]} &= \Var{i[1]} \\ \Block{endfor}
                \end{align*}
            \end{solution}

            \Block{set e = Equation.random("{a}x + _ = {b}x + _",
                                            conditions=["{a} != {b}"],
                                            val_min = -10,
                                            val_max = 20
                                            )}
            \subpart $\Var{e}$
            \begin{solution}
                \begin{align*}
                    \Block{for i in e.solve()} \Var{i[0]} &= \Var{i[1]} \\ \Block{endfor}
                \end{align*}
            \end{solution}
        \end{subparts}
    \end{multicols}


\end{parts}

