Práctica Tema 4 (ejercicios 9, 10, 11, 12, 14, 15 y 17)

436 days ago by david.orden

# EJERCICIO 9: x,y,z=var('x,y,z') F=x^2+y^2+z^2 R=2 G=x^2+y^2 b=1 p1=implicit_plot3d(F==R^2,(x,-(R+0.5),(R+0.5)),(y,-(R+0.5),(R+0.5)),(z,-(R+0.5),(R+0.5)), color='blue',opacity=0.5) p2=implicit_plot3d(G==b^2,(x,-(R+0.5),(R+0.5)),(y,-(R+0.5),(R+0.5)),(z,-(R+0.5),(R+0.5)), color='red') p1+p2 
       
# EJERCICIO 10: x,y,z=var('x,y,z') F=x^2+y^2+z^2 G=x^2+y^2-z^2 p1=implicit_plot3d(F==1,(x,-1.5,1.5),(y,-1.5,1.5),(z,-1.5,1.5), color='blue',opacity=0.5) p2=implicit_plot3d(G==0,(x,-1.5,1.5),(y,-1.5,1.5),(z,-1.5,1.5), color='red') p1+p2 
       
# EJERCICIO 11: x,y,z=var('x,y,z') p1=plot3d(x^2+y^2,(x,-2,4),(y,-2,4),(z,-2,4), color='blue') p2=plot3d(2+2*x+2*y,(x,-2,4),(y,-2,4),(z,-2,4), color='red',opacity=0.5) p1+p2 
       
# EJERCICIO 12: x,y,z=var('x,y,z') F=x^2+y^2+z^2 p1=implicit_plot3d(F==2,(x,-1.5,1.5),(y,-1.5,1.5),(z,0,1.5), color='blue',opacity=0.5) p2=plot3d(x^2+y^2,(x,-1.5,1.5),(y,-1.5,1.5),(z,0,1.5), color='red') p1+p2 
       
# EJERCICIO 14: x,y,z=var('x,y,z') F=x^2+y^2-2*z G=z p1=implicit_plot3d(F==0,(x,-4,4),(y,-4,4),(z,0,3), color='blue',opacity=0.5) p2=implicit_plot3d(G==2,(x,-4,4),(y,-4,4),(z,0,3), color='red') p1+p2 
       
# EJERCICIO 15: x,y,z=var('x,y,z') F=x^2+y^2+z^2 p1=implicit_plot3d(F==1,(x,-2.5,2.5),(y,-2.5,2.5),(z,-2.5,2.5), color='blue') p2=implicit_plot3d(F==4,(x,-2.5,2.5),(y,-2.5,2.5),(z,-2.5,2.5), color='red',opacity=0.5) p1+p2 
       
# EJERCICIO 17: x,y,z=var('x,y,z') F=x^2+y^2 G=z H=x^2+y^2-(z-2)^2 p1=implicit_plot3d(F==1,(x,-4,4),(y,-4,4),(z,-4,4), color='blue') p2=implicit_plot3d(G==0,(x,-4,4),(y,-4,4),(z,-4,4), color='red') p3=implicit_plot3d(H==0,(x,-4,4),(y,-4,4),(z,-4,4), color='green',opacity=0.5) p1+p2+p3 
       
integrate? 
       

File: /home/sage/sage_install/sage-4.6/local/lib/python2.6/site-packages/sage/misc/functional.py

Type: <type ‘function’>

Definition: integrate(x, *args, **kwds)

Docstring:

Returns an indefinite or definite integral of an object x.

First call x.integrate() and if that fails make an object and integrate it using Maxima, maple, etc, as specified by algorithm.

For symbolic expression calls sage.calculus.calculus.integral - see this function for available options.

EXAMPLES:

sage: f = cyclotomic_polynomial(10)
sage: integral(f)
1/5*x^5 - 1/4*x^4 + 1/3*x^3 - 1/2*x^2 + x
sage: integral(sin(x),x)
-cos(x)
sage: y = var('y')
sage: integral(sin(x),y)
y*sin(x)
sage: integral(sin(x), x, 0, pi/2)
1
sage: sin(x).integral(x, 0,pi/2)
1
sage: integral(exp(-x), (x, 1, oo))
e^(-1)

Numerical approximation:

sage: h = integral(sin(x)/x^2, (x, 1, pi/2)); h
integrate(sin(x)/x^2, x, 1, 1/2*pi)
sage: h.n()
0.339447940978915...

Specific algorithm can be used for integration:

sage: integral(sin(x)^2, x, algorithm='maxima')
1/2*x - 1/4*sin(2*x)
sage: integral(sin(x)^2, x, algorithm='sympy')
-1/2*sin(x)*cos(x) + 1/2*x

File: /home/sage/sage_install/sage-4.6/local/lib/python2.6/site-packages/sage/misc/functional.py

Type: <type ‘function’>

Definition: integrate(x, *args, **kwds)

Docstring:

Returns an indefinite or definite integral of an object x.

First call x.integrate() and if that fails make an object and integrate it using Maxima, maple, etc, as specified by algorithm.

For symbolic expression calls sage.calculus.calculus.integral - see this function for available options.

EXAMPLES:

sage: f = cyclotomic_polynomial(10)
sage: integral(f)
1/5*x^5 - 1/4*x^4 + 1/3*x^3 - 1/2*x^2 + x
sage: integral(sin(x),x)
-cos(x)
sage: y = var('y')
sage: integral(sin(x),y)
y*sin(x)
sage: integral(sin(x), x, 0, pi/2)
1
sage: sin(x).integral(x, 0,pi/2)
1
sage: integral(exp(-x), (x, 1, oo))
e^(-1)

Numerical approximation:

sage: h = integral(sin(x)/x^2, (x, 1, pi/2)); h
integrate(sin(x)/x^2, x, 1, 1/2*pi)
sage: h.n()
0.339447940978915...

Specific algorithm can be used for integration:

sage: integral(sin(x)^2, x, algorithm='maxima')
1/2*x - 1/4*sin(2*x)
sage: integral(sin(x)^2, x, algorithm='sympy')
-1/2*sin(x)*cos(x) + 1/2*x