Slide 1 of 3UNAHFacultad de ciencias
Escuela de física
Laboratorio de FS 321Gráficas e Integrales en Mathematica
Hecho por:Prosilapio Ventura
Registro: 20091001996Instructor: 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 2DDefinimos la función seno y la graficamos:
In[2]:= f@x_D := Sin@xDIn[3]:= Plot@f@xD, 8x, 0, 2 Π<D
Out[3]=1 2 3 4 5 6
-1.0
-0.5
0.5
1.0
Después de revisar la ayuda dibujamos la gráfica en un estilo propio.
In[18]:= Plot@f@xD, 8x, 0, 2 Π<, AxesLabel ® 8x, y<,
AxesStyle ® Directive@Gray, FontSize ® 15D,
ColorFunction ® Function@8x, y<, If@x > 2 && x < 5, Green, BlackDD,
ColorFunctionScaling ® False, PlotStyle ® Thick,
PlotLabel ® Style@Sin@xD, 18, BrownD,
Ticks ® 880, Π � 2, 8Π, "Semiperiodo", 0.25<, 3 Π � 2, 2 Π<,
8-1, -1 � 2, 1 � 2, 1<<D
Out[18]=
Π
2Semiperiodo 3 Π
22 Π
x
-1
-12
12
1y
sinHxL
Gráficas en 3DDefinimos la función gaussiana en 2 variables y la graficamos:
In[19]:= g@x_, y_D := ã-Ix2+y2M
In[22]:= Plot3D@g@x, yD, 8x, -2, 2<, 8y, -2, 2<D
Out[22]=
-2
-1
0
1
2
-2-1
01
2
0.0
0.5
1.0
Después de revisar la ayuda dibujamos la gráfica en un estilo propio.
2 By Juan Junior.nb
In[50]:= Plot3DAg@x, yD, 8x, -2, 2<, 8y, -2, 2<, AxesLabel ® 8x, y, z<,
AxesStyle ® Directive@Gray, FontSize ® 15D,
ColorFunction ® Function@8x, y, z<, Hue@x � 2, Hy + 2L � 3, 2 Hz + 1 � 8LDD,
ColorFunctionScaling ® False, PlotStyle ® Thick,
PlotLabel ® StyleAã-Ix2+y2M, 18, BrownEE
Out[50]=
ã-x2- y2
-2
-1
0
1
2
x
-2
-1
0
1
2
y
0.0
0.5
1.0
z
In[61]:= Plot3DAg@x, yD, 8x, -2, 2<, 8y, -2, 2<, AxesLabel ® 8x, y, z<,
AxesStyle ® Directive@Gray, FontSize ® 15D,
ColorFunction ® FunctionA8x, y, z<, HueAã-Ix2+y2MEE,
ColorFunctionScaling ® False, PlotStyle ® Thick,
PlotLabel ® StyleAã-Ix2+y2M, 18, BrownEE
Out[61]=
ã-x2- y2
-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 IndefinidaCon la barra de herramientas “Basic Math Assistant”.
In[62]:= à x âx
Out[62]=x2
2
Ahora haremos tres integrales interesantes: Ù Sin@xD âx, Ù Tan@xD âx y Ù ãn*x âx
In[69]:= :à f@xD âx, à Sin@xD âx>Out[69]= 8-Cos@xD, -Cos@xD<
In[78]:= á f@xDf'@xD âx
Out[78]=1
2 2I-2 ArcTanA1 - 2 Tan@xD E + 2 ArcTanA1 + 2 Tan@xD E +
LogA1 - 2 Tan@xD + Tan@xDE - LogA1 + 2 Tan@xD + Tan@xDEMAhora preguntamos si la integral anterior es realmente Ù Tan@xD âx
In[79]:= à Tan@xD âx == %
Out[79]= True
Mathematica nos responde que si.
In[80]:= FullSimplifyBà Hf'@xD + I f@xDL-I n âxF
Out[80]=
Iãä xM-ä n
n
In[81]:= à ãn*x âx � %
Out[81]=ãn x
n�
Iãä xM-ä 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 DefinidasCon la barra de herramientas “Basic Math Input”.
In[82]:= à0
¥Hãn*xL âx
Out[82]= ConditionalExpressionB-1
n, Re@nD < 0F
Mathematica nos dice que el valor de la integral es - 1n
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]:= FullSimplifyBà0
¥Hãn*xL âx, n Ε Reals && n < 0F
Out[84]= -1
n
By Juan Junior.nb 5
Top Related