Entrada destacada

Distancia media de dos puntos en un cuadrado unitario

martes, 24 de noviembre de 2020

Transformaciones de Funciones



Consiste en los cambios que se pueden obtener sobre una función al pre-componer y pos-componer con respecto a funciones lineales.

Consideraremos la función:


f[x_] := Piecewise[{{x + 2, -1 <= x < 0}, {2, 0 <= x < 2}, {-x + 4, 
    2 <= x < 4}, {x - 4, 4 <= x <= 5}}, None]
Plot[f[x], {x, -5, 5}, GridLines -> All]


Pos - composición : Transformación en Y

Sea g(x) = c x + d, realizaremos la composición (g\[SmallCircle]f)(x) = g(f(x)) = c f(x) + d, que afecta a la función en el eje Y. 

f[x_] := Piecewise[{{x + 2, -1 <= x < 0}, {2, 0 <= x < 2}, {-x + 4, 
    2 <= x < 4}, {x - 4, 4 <= x <= 5}}, None]
Manipulate[g[x_] := c x + d; 
 Show[Plot[{f[x], g[f[x]]}, {x, -6, 6}, 
   PlotLabel -> Row[{c, "f(x)", If[d >= 0, "+", ""], d}], 
   PlotStyle -> {{Dashed, Blue}, {Red, Thickness[0.01]}}, 
   PlotRange -> 8, GridLines -> All, AspectRatio -> 1], 
  Graphics[{Text["f(x)", {2.2, 2.2}]}]], {{c, 1}, -3, 3}, {{d, 0}, -3,
   3}]



Pre - composición : Transformación en X

Sea g(x) = a x + b, realizaremos la composición (f\[SmallCircle]g)(x) = f(g(x)) = f(a x + b), que afecta a la función en el eje X. 

f[x_] := Piecewise[{{x + 2, -1 < x < 0}, {2, 0 < x < 2}, {-x + 4, 
    2 < x < 4}, {x - 4, 4 < x < 5}}, None]
Manipulate[g[x_] := a x + b; 
 Show[Plot[{f[x], f[a x + b]}, {x, -6, 6}, 
   PlotLabel -> Row[{"f(", a, "x", If[b >= 0, "+", ""], b, ")"}], 
   PlotStyle -> {{Dashed, Blue}, {Red, Thickness[0.01]}}, 
   PlotRange -> 8, GridLines -> All, AspectRatio -> 1], 
  Graphics[{Text["f(x)", {2.2, 2.2}]}]], {{a, 1}, -3, 3}, {{b, 0}, -3,
   3}]


Composiciones con g (x) = - x

Clear[f, gf, gfg]
f[x_] := Piecewise[{{x + 2, -1 < x < 0}, {2, 0 < x < 2}, {-x + 4, 
    2 < x < 4}, {x - 4, 4 < x < 5}}, None]
Manipulate[
 Plot[{f[x], 
   Evaluate@Switch[op, fg, f[-x], gf, -f[x], gfg, -f[-x]]}, {x, -5, 
   5}, PlotRange -> 5, 
  PlotStyle -> {{Dashed, Blue}, {Red, Thickness[0.01]}}, 
  GridLines -> All, 
  AspectRatio -> 1], {{op, "", "Composición: Roja"}, {fg -> "f(-x)", 
   gf -> "-f(x)", gfg -> "-f(-x)"}}]







Para aprender más sobre Mathematica ingrese aquí sitio de aprendizaje de Wolfram o en mi website ustamathematica.wixsite.com/basicas

martes, 17 de noviembre de 2020

Frase Célebre de George Polyá

Si no puedes resolver un problema,
entonces hay una manera más sencilla de resolverlo:
encuéntrala.

George Polyá

martes, 10 de noviembre de 2020

Funciones Inversas


Definición

La inversa de una función f(x) corresponde a una función g(x) tal que:

( f ∘ g ) ( x ) = x        y       ( g ∘ f ) ( x ) = x

En la práctica, la gráfica de la inversa de una función corresponde a su simétrica con respecto a la función idéntica 
Id( x ) = x.
Para que la inversa sea función es necesario que la función inicial sea inyectiva, rectas horizontales la cortan en un único punto.

Show[ContourPlot[{y == x^2 + 1, y == x, x == y^2 + 1}, {x, -5, 
   5}, {y, -5, 5}, Axes -> True, GridLines -> Automatic], 
 Graphics[{Text["f(x)", {-1, 3}], 
   Text["\!\(\*SuperscriptBox[\(f\), \(-1\)]\)(x)", {3, -1}], 
   Text["Id", {4, 4.2}], Red, Dashed, Line[{{-2, 4}, {2, 4}}], 
   Line[{{4, -2}, {4, 2}}]}]]


La función f(x), por no ser inyectiva, no tiene inversa pues f^-1(x) NO es una función. Las líneas horizontales en f (para ser inyectiva) se vuelven verticales en f^-1 (para ser función).

Restricciones del Dominio e Inversas

Seno

gra = Graphics[{Point[{0, 0}]}];
Manipulate[
 Show[Plot[{If[id, x, Sin[x]], Sin[x]}, {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-Pi, Pi}}, AspectRatio -> Automatic], 
  If[re, Plot[Sin[x], {x, -Pi/2, Pi/2}, PlotStyle -> {Red, Dashed}], 
   gra], If[inv, 
   Plot[ArcSin[x], {x, -Pi, Pi}, PlotStyle -> {Green, Dashed}], 
   gra]], {{id, False, "Idéntica"}, {False, True}}, {{re, False, 
   "Restricción"}, {False, True}}, {{inv, False, "Inversa"}, {False, 
   True}}]


Coseno

gra = Graphics[{Point[{0, 0}]}];
Manipulate[
 Show[Plot[{If[id, x, Cos[x]], Cos[x]}, {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-Pi, Pi}}, AspectRatio -> Automatic], 
  If[re, Plot[Cos[x], {x, 0, Pi}, PlotStyle -> {Red, Dashed}], gra], 
  If[inv, Plot[ArcCos[x], {x, -Pi, Pi}, PlotStyle -> {Green, Dashed}],
    gra]], {{id, False, "Idéntica"}, {False, True}}, {{re, False, 
   "Restricción"}, {False, True}}, {{inv, False, "Inversa"}, {False, 
   True}}]



Tangente

gra = Graphics[{Point[{0, 0}]}];
Manipulate[
 Show[Plot[{If[id, x, Tan[x]], Tan[x]}, {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-Pi, Pi}}, AspectRatio -> Automatic], 
  If[re, Plot[Tan[x], {x, -Pi/2, Pi/2}, PlotStyle -> {Red, Dashed}], 
   gra], If[inv, 
   Plot[ArcTan[x], {x, -Pi, Pi}, PlotStyle -> {Green, Dashed}], 
   gra]], {{id, False, "Idéntica"}, {False, True}}, {{re, False, 
   "Restricción"}, {False, True}}, {{inv, False, "Inversa"}, {False, 
   True}}]


Todas en un Aplicativo

gra = Graphics[{Point[{0, 0}]}]; RefLink[
 Off,paclet : ref/Off][message];
f1[x_] := x^2
Manipulate[
 Switch[fun, Sin, aa = -Pi/2; bb = Pi/2; s = 1, Cos, aa = 0; bb = Pi; 
  s = 1, Tan, aa = -Pi/2; bb = Pi/2; s = 1, f1, aa = 0; bb = Pi; 
  s = -1]; Show[
  Plot[{If[id, x, fun[x]], fun[x]}, {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-Pi, Pi}}, AspectRatio -> Automatic], 
  If[re, Plot[fun[x], {x, aa, bb}, PlotStyle -> {Red, Dashed}], gra], 
  If[inv, Plot[s InverseFunction[fun][x], {x, -Pi, Pi}, 
    PlotStyle -> {Green, Dashed}], gra]], {{fun, Sin, 
   "Función"}, {Sin -> "Seno", Cos -> "Coseno", Tan -> "Tangente", 
   f1 -> " Á\[Divide]É\[Divide]È\[Divide]SuperscriptBox[É\[Divide]xÀ\
\[Divide], É\[Divide]2À\[Divide]]À\[Divide] "}}, {{id, False, 
   "Idéntica"}, {False, True}}, {{re, False, "Restricción"}, {False, 
   True}}, {{inv, False, "Inversa"}, {False, True}}]


Inversas sin Restricción del Dominio

gra = Graphics[{Point[{0, 0}]}];
f1[x_] := x^2
f2[x_] := x^3
Manipulate[aa = -Pi; bb = Pi; 
 Switch[fun, f2, inversa = CubeRoot, Exp, inversa = Log, Log, 
  inversa = Exp, Sqrt, inversa = f1; aa = 0; bb = Pi]; 
 Show[Plot[{If[id, x, fun[x]], fun[x]}, {x, -Pi, Pi}, 
   PlotRange -> {{-Pi, Pi}, {-Pi, Pi}}, AspectRatio -> Automatic], 
  If[inv, Plot[inversa[x], {x, aa, bb}, PlotStyle -> {Green, Dashed}],
    gra]], {{fun, "", "Función"}, {Exp -> "Exponencial", 
   Log -> "Logarítmo", Sqrt -> "Raíz Cuadrada", 
   f2 -> " \!\(\*SuperscriptBox[\(x\), \(3\)]\) "}}, {{id, False, 
   "Idéntica"}, {False, True}}, {{inv, False, "Inversa"}, {False, 
   True}}]





Para aprender más sobre Mathematica ingrese aquí sitio de aprendizaje de Wolfram o en mi website ustamathematica.wixsite.com/basicas

martes, 3 de noviembre de 2020