Suma, Resta y Producto
f1[x_] := 2 x - 2
f2[x_] := x - 1
Quiet@Manipulate[
Plot[{f[x], g[x], op[f[x], g[x]]}, {x, -3, 3}, PlotRange -> 3,
GridLines -> All, AspectRatio -> 1,
PlotLabels -> {"f(x)", "g(x)"}], {f, {f1 -> "2x-2",
Sin -> "Sen(x)", Cos -> "Cos(x)"}}, {g, {f2 -> "x-1",
Sin -> "Sen(x)", Cos -> "Cos(x)"}}, {{op, "",
"Operación"}, {Plus -> "f[x]+g[x]", Subtract -> "f[x]-g[x]",
Times -> "f[x]\[CenterDot]g[x]"}}]
La gráfica azul es f(x), la amarilla es g(x) y la verde corresponde a la operación realizada.
Composición de Funciones
Clear[f, g, ff, gg, gf, fg]
f1[x_] := 2 x + 1
f2[x_] := x^2 + 1
Manipulate[
Plot[{f[x], g[x],
Evaluate@
Switch[op, fg, f[g[x]], gf, g[f[x]], ff, f[f[x]], gg,
g[g[x]]]}, {x, -4, 4}, PlotRange -> 5,
PlotStyle -> {Blue, Yellow, Green}, GridLines -> All,
AspectRatio -> Automatic], {{f, Sin, "f(x): Azul"}, {f1 -> "2x+1",
f2 -> "x²+1", Sin -> "Sen(x)",
Cos -> "Cos(x)", Abs -> "|x|"}}, {{g, Cos, "g(x): Amarillo"}, {f1 ->
"2x+1", f2 -> "x²+1",
Sin -> "Sen(x)", Cos -> "Cos(x)", Abs -> "|x|"}}, {{op, "",
"Composición: Verde"}, {fg ->
"f∘g", gf -> "g∘f",
ff -> "f∘f", gg -> "g∘g"}}]
Para aprender más sobre Mathematica ingrese aquí sitio de aprendizaje de Wolfram o en mi website ustamathematica.wixsite.com/basicas
No hay comentarios.:
Publicar un comentario