Vous êtes sur la page 1sur 5

Slide 1 of 3

UNAH
Facultad de ciencias
Escuela de fsica
Laboratorio de FS 321
Grficas e Integrales en Mathematica
Hecho por:
Prosilapio Ventura
Registro: 20091001996
Instructor: Juan Junior Caldern Santamara
La vida entera es Arte... Arte que nace y muere en uno mismo.
Ciudad universitaria, Lunes 11 de septiembre de 2011
Grficas en 2D
Definimos la funcin seno y la graficamos:
In[2]:= f[x_] := Sin[x]
In[3]:= Plot[f[x], {x, 0, 2 }]
Out[3]=
1 2 3 4 5 6
1.0
0.5
0.5
1.0
Despus de revisar la ayuda dibujamos la grfica en un estilo propio.
In[18]:= Plot[f[x], {x, 0, 2 }, AxesLabel - {x, y},
AxesStyle - Directive[Gray, FontSize - 15],
ColorFunction - Function[{x, y}, If[x > 2 && x < 5, Green, Black]],
ColorFunctionScaling - False, PlotStyle - Thick,
PlotLabel - Style[Sin[x], 18, Brown],
Ticks - {{0, / 2, {, "Semiperiodo", 0.25}, 3 / 2, 2 },
{-1, -1 / 2, 1 / 2, 1}}]
Out[18]=

2
Semiperiodo
3
2
2
x
1

1
2
1
2
1
y
sinx
Grficas en 3D
Definimos la funcin gaussiana en 2 variables y la graficamos:
In[19]:= g[x_, y_] := e
-[x
2
+y
2
|
In[22]:= Plot3D[g[x, y], {x, -2, 2}, {y, -2, 2}]
Out[22]=
2
1
0
1
2
2
1
0
1
2
0.0
0.5
1.0
Despus de revisar la ayuda dibujamos la grfica en un estilo propio.
2 By Juan Junior.nb
In[50]:= Plot3D]g[x, y], {x, -2, 2}, {y, -2, 2}, AxesLabel - {x, y, z},
AxesStyle - Directive[Gray, FontSize - 15],
ColorFunction - Function[{x, y, z}, Hue[x / 2, (y + 2) / 3, 2 (z + 1 / 8)]],
ColorFunctionScaling - False, PlotStyle - Thick,
PlotLabel - Style]e
-[x
2
+y
2
|
, 18, Brown
Out[50]=

x
2
y
2
2
1
0
1
2
x
2
1
0
1
2
y
0.0
0.5
1.0
z
In[61]:= Plot3D]g[x, y], {x, -2, 2}, {y, -2, 2}, AxesLabel - {x, y, z},
AxesStyle - Directive[Gray, FontSize - 15],
ColorFunction - Function]{x, y, z}, Hue]e
-[x
2
+y
2
|
,
ColorFunctionScaling - False, PlotStyle - Thick,
PlotLabel - Style]e
-[x
2
+y
2
|
, 18, Brown
Out[61]=

x
2
y
2
2
1
0
1
2
x
2
1
0
1
2
y
0.0
0.5
1.0
z
By Juan Junior.nb 3
Slide 2 of 3
Integrales Indefinida
Con la barra de herramientas Basic Math Assistant.
In[62]:=
_
x dx
Out[62]=
x
2
2
Ahora haremos tres integrales interesantes: [ Sin[x] x, [ Tan[x] x y [
nx
x
In[69]:= _
_
f[x] dx,
_
Sin[x] dx_
Out[69]= {Cos[x], Cos[x]]
In[78]:=
_
f[x]
f'[x]
dx
Out[78]=
1
2 2
2 ArcTan1 2 Tan[x] 2 ArcTan1 2 Tan[x]
Log1 2 Tan[x] Tan[x] Log1 2 Tan[x] Tan[x]
Ahora preguntamos si la integral anterior es realmente [ Tan[x] x
In[79]:=
_
Tan[x] dx ==
Out[79]= True
Mathematica nos responde que si.
In[80]:= FullSimplify_
_
(f'[x] + I f[x])
-I n
dx_
Out[80]=

n
n
In[81]:=
_
e
n+x
dx =
Out[81]=

n x
n

n
n
Aunque parece una identidad evidente. Para Mathematica, esta igualdad no es tan trivial.
4 By Juan Junior.nb
Slide 3 of 3
Integrales Definidas
Con la barra de herramientas Basic Math Input.
In[82]:=
_
0

(e
n+x
) dx
Out[82]= ConditionalExpression
1
n
, Re[n] 0
Mathematica nos dice que el valor de la integral es
1
n
siempre y cuando la parte real de n sea negativa
Para que Mathematica no tenga ninguna duda, podemos especificarle previamente las restricciones de n.
In[84]:= FullSimplify_
_
0

(e
n+x
) dx, n Reals && n < 0_
Out[84]=
1
n
By Juan Junior.nb 5

Vous aimerez peut-être aussi