"""
¿Cu ́al es el dominio y el rango de y = x**2 + 2?
"""
x,y=var("x,y")
f(x)=x**2+2
r=2
grafica = plot(f, (-r,r))
M=f(r)
region = region_plot(y>2, (x, -r, r), (y, 0, M), incol='pink', bordercol='red', borderstyle='dashed', plot_points=250,aspect_ratio=1)
show(grafica+region)
"""
¿Cual es el dominio y el rango de y = 1/(x-3)?
"""
x=var("x")
f(x)=1/(x-3)
r=8
grafica = plot(f, (3-r,3+r), legend_label='$1/(x-3)$')+plot(0, (3-r,3+r), color=hue(0.9), thickness=3)
#ejex = plot(const, (3-r,3+r), color="red").show(ymin = -5, ymax = 5)
#region = region_plot(y>2, (x, -r, r), (y, -M, M), incol='pink', bordercol='red', borderstyle='dashed', plot_points=250,aspect_ratio=1)
grafica.show(ymin = -5, ymax = 5)
x=var("x")
f(x)=x^2
R=5
plt1=plot(f(x),(-R,R),legend_label=str(f(x)), color="blue")
plt2=plot(f(x-2),(-R,R),legend_label=str(f(x-2)), color="red")
plt3=plot(f(x+1),(-R,R),legend_label=str(f(x+1)), color="green")
(plt1+plt2+plt3).show()
x=var("x")
f(x)=3*x
R=5
plt1=plot(f(x),(-R,R),legend_label=str(f(x)), color="blue")
plt2=plot(f(x-2),(-R,R),legend_label=str(f(x-2)), color="red")
plt3=plot(f(x+1),(-R,R),legend_label=str(f(x+1)), color="green")
(plt1+plt2+plt3).show()
x=var("x")
f(x)=2/x
R=5
plt1=plot(f(x),(-R,R),legend_label=str(f(x)), color="blue")
plt2=plot(f(x-2),(-R,R),legend_label=str(f(x-2)), color="red")
plt3=plot(f(x+1),(-R,R),legend_label=str(f(x+1)), color="green")
(plt1+plt2+plt3).show(ymin = -5, ymax = 5)
x=var("x")
f(x)=sqrt(x)
R=5
plt1=plot(f(x),(-R,R),legend_label=str(f(x)), color="blue")
plt2=plot(f(x-2),(-R,R),legend_label=str(f(x-2)), color="red")
plt3=plot(f(x+1),(-R,R),legend_label=str(f(x+1)), color="green")
(plt1+plt2+plt3).show()
x=var("x")
f(x)=x^2
R=5
plt1=plot(f(x),(-R,R),legend_label=str(f(x)), color="blue")
plt2=plot(f(x)+2,(-R,R),legend_label=str(f(x)+2), color="red")
plt3=plot(f(x)-1,(-R,R),legend_label=str(f(x)-1), color="green")
(plt1+plt2+plt3).show()
x=var("x")
f(x)=3*x
R=5
plt1=plot(f(x),(-R,R),legend_label=str(f(x)), color="blue")
plt2=plot(f(x)+2,(-R,R),legend_label=str(f(x)+2), color="red")
plt3=plot(f(x)-1,(-R,R),legend_label=str(f(x)-1), color="green")
(plt1+plt2+plt3).show()
x=var("x")
f(x)=2/x
R=100
plt1=plot(f(x),(-R,R),legend_label=str(f(x)), color="blue")
plt2=plot(f(x)+2,(-R,R),legend_label=str(f(x)+2), color="red")
plt3=plot(f(x)-1,(-R,R),legend_label=str(f(x)-1), color="green")
(plt1+plt2+plt3).show(ymin=-5, ymax=5)
x=var("x")
f(x)=sqrt(x)
R=5
plt1=plot(f(x),(-R,R),legend_label=str(f(x)), color="blue")
plt2=plot(f(x)+2,(-R,R),legend_label=str(f(x)+2), color="red")
plt3=plot(f(x)-1,(-R,R),legend_label=str(f(x)-1), color="green")
(plt1+plt2+plt3).show(ymin=-2, ymax=5)