Este documento presenta un laboratorio sobre gráficas e integrales en Mathematica. En la primera diapositiva se define la función seno y se grafica, luego se define la función gaussiana de dos variables y se grafica en 3D con diferentes estilos. La segunda diapositiva calcula integrales indefinidas como la integral de seno, tangente y potencias. La tercera diapositiva calcula integrales definidas como la integral de una potencia entre límites.
1. Slide 1 of 3
UNAH
Facultad de ciencias
Escuela de física
Laboratorio de FS 321
Gráficas e Integrales en Mathematica
Hecho por:
Prosilapio Ventura
Registro: 20091001996
Instructor: Juan Junior Calderón Santamaría
“La vida entera es Arte... Arte que nace y muere en uno mismo.”
Ciudad universitaria, Lunes 11 de septiembre de 2011
Gráficas en 2D
Definimos la función seno y la graficamos:
In[2]:= f x_ : Sin x
In[3]:= Plot f x , x, 0, 2 Π
1.0
0.5
Out[3]=
1 2 3 4 5 6
0.5
1.0
Después de revisar la ayuda dibujamos la gráfica en un estilo propio.
2. 2 By Juan Junior.nb
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
sin x
y
1
1
2
Out[18]=
x
1
Π 3Π
2
2
Semiperiodo 2
2Π
1
Gráficas en 3D
Definimos la función gaussiana en 2 variables y la graficamos:
x2 y2
In[19]:= g x_, y_ :
In[22]:= Plot3D g x, y , x, 2, 2 , y, 2, 2
2
1
0
1
2
1.0
Out[22]=
0.5
0.0
2
1
0
1
2
Después de revisar la ayuda dibujamos la gráfica en un estilo propio.
3. By Juan Junior.nb 3
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,
x2 y2
PlotLabel Style , 18, Brown
x2 y2
1.0
Out[50]=
0.5 2
z
0.0 1
2
1 0 y
0
x 1
1
2 2
In[61]:= Plot3D g x, y , x, 2, 2 , y, 2, 2 , AxesLabel x, y, z ,
AxesStyle Directive Gray, FontSize 15 ,
x2 y2
ColorFunction Function x, y, z , Hue ,
ColorFunctionScaling False, PlotStyle Thick,
x2 y2
PlotLabel Style , 18, Brown
x2 y2
1.0
Out[61]= 0.5
z
2
0.0
2 1
1 0
0 y
x 1
1
2 2
4. 4 By Juan Junior.nb
Slide 2 of 3
Integrales Indefinida
Con la barra de herramientas “Basic Math Assistant”.
In[62]:= x x
x2
Out[62]=
2
n x
Ahora haremos tres integrales interesantes: Sin x x, Tan x x y x
In[69]:= f x x, Sin x x
Out[69]= Cos x , Cos x
f x
In[78]:= x
f' x
1
Out[78]= 2 ArcTan 1 2 Tan x 2 ArcTan 1 2 Tan x
2 2
Log 1 2 Tan x Tan x Log 1 2 Tan x Tan x
Ahora preguntamos si la integral anterior es realmente Tan x x
In[79]:= Tan x x
Out[79]= True
Mathematica nos responde que si.
In
In[80]:= FullSimplify f' x If x x
x n
Out[80]=
n
n x
In[81]:= x
x n
nx
Out[81]=
n n
Aunque parece una identidad evidente. Para Mathematica, esta igualdad no es tan trivial.
5. By Juan Junior.nb 5
Slide 3 of 3
Integrales Definidas
Con la barra de herramientas “Basic Math Input”.
n x
In[82]:= x
0
1
Out[82]= ConditionalExpression , Re n 0
n
1
Mathematica nos dice que el valor de la integral es 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.
n x
In[84]:= FullSimplify x, n Ε Reals && n 0
0
1
Out[84]=
n