Composée de fonctions - Exercices

Composee[{a_, b_, c_}] := 
        StringForm["`` o `` o ``", a, b, c];
CompSol[{a_, b_, c_}] := 
        StringForm["``(``(``(x))) = ``(``(``)) = ``(``) =  ``", a, b, c, 
          a, b, c[x], a, b@c[x], a@b@c[x]];

Exercice 1

f[x_] := (Sqrt[x - 1]);
g[x_] := Sin[x];
h[x_] := (1/x) + 2;
a[1] = {f, g, h};
a[2] = {g, f, h};
a[3] = {h, f, g};
a[4] = {g, h, f};
Print["On considère les fonctions f, g et h "];  
    Print["f(x) = ", f[x]]; Print["g(x) = ", g[x]]; 
    Print["h(x) = ", h[x]];
Print["Déterminer les composées \
suivantes:"];
Do[Print[i, ") ", Composee[a[i]]], {i, 4}];

Solutions

Do[Print[i, ") ", CompSol[a[i]]], {i, 4}]

Exercice 2

f[x_] := x^2 - 1;
g[x_] := 1/(x - 1);
h[x_] := Sqrt[x] + 1;
a[1] = {h, g, f};
a[2] = {g, f, h};
a[3] = {f, g, f};
a[4] = {g, h, f};
Print["On considère les fonctions f, g et h "];  
    Print["f(x) = ", f[x]]; Print["g(x) = ", g[x]]; 
    Print["h(x) = ", h[x]];
Print["Déterminer les composées \
suivantes:"];
Do[Print[i, ") ", Composee[a[i]]], {i, 4}];

Solutions

Do[Print[i, ") ", CompSol[a[i]]], {i, 4}]

Exercice 3

f[x_] := Abs[x];
g[x_] := x/(x + 2);
h[x_] := x^3;
a[1] = {f, g, h};
a[2] = {g, h, h};
a[3] = {h, g, f};
a[4] = {g, h, f};
Print["On considère les fonctions f, g et h "];  
    Print["f(x) = ", f[x]]; Print["g(x) = ", g[x]]; 
    Print["h(x) = ", h[x]];
Print["Déterminer les composées \
suivantes:"];
Do[Print[i, ") ", Composee[a[i]]], {i, 4}];

Solutions

Do[Print[i, ") ", CompSol[a[i]]], {i, 4}]