0% found this document useful (0 votes)
14 views2 pages

Gráficas de Funciones Racionales

Uploaded by

Bernardo Medina
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Gráficas de Funciones Racionales

Uploaded by

Bernardo Medina
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NOMBRE: Medina Rodriguez Bernardo Isaac

GRUPO: TIF - Mecatronica


4x − 9
f (x) =
2x + 3

In [1]: import [Link] as plt


import numpy as np

def f(x):
return (4*x - 9) / (2*x + 3)

x1 = [Link](-10, -1.51, 400)


x2 = [Link](-1.49, 10, 400)
asintota_vertical = -1.5
asintota_horizontal = 4 / 2

[Link](figsize=(10, 8))
[Link]('Gráfico de la función racional $f(x) = \\frac{4x-9}{2x+3}$', fontsize=16)
[Link]('Eje X', fontsize=12)
[Link]('Eje Y', fontsize=12)
[Link](True)
[Link](0, color='black', linewidth=0.5)
[Link](0, color='black', linewidth=0.5)
[Link](asintota_vertical, color='red', linestyle='--', label=f'Asíntota vertical $x={asintota_vertical}$')
[Link](asintota_horizontal, color='green', linestyle='--', label=f'Asíntota horizontal $y={asintota_horizontal}$')
[Link](x1, f(x1), color='blue')
[Link](x2, f(x2), color='blue', label='f(x)')
[Link]()
[Link](-20, 20)
[Link]()

2x + 4
f (x) =
x − 2

In [1]: import [Link] as plt


import numpy as np

def f(x):
return (2*x + 4) / (x - 2)

x1 = [Link](-10, 1.9, 400)


x2 = [Link](2.1, 10, 400)
y1 = f(x1)
y2 = f(x2)

fig, ax = [Link](figsize=(10, 8))


[Link](x1, y1, color='blue', label='$f(x) = \\frac{2x+4}{x-2}$')
[Link](x2, y2, color='blue')
[Link](x=2, color='red', linestyle='--', label='Asíntota vertical ($x=2$)')
[Link](y=2, color='green', linestyle='--', label='Asíntota horizontal ($y=2$)')
ax.set_title('Gráfica de la función racional $f(x) = \\frac{2x+4}{x-2}$')
ax.set_xlabel('Eje x')
ax.set_ylabel('Eje y')
ax.set_ylim(-20, 20)
[Link](True)
[Link]()
[Link]()

1
f (x) =
2
(x − 1)

In [2]: import numpy as np


import [Link] as plt

def f(x):
return 1 / (x - 1)**2

x1 = [Link](-5, 0.99, 100)


x2 = [Link](1.01, 5, 100)
y1 = f(x1)
y2 = f(x2)

fig, ax = [Link](figsize=(10, 6))


[Link](x1, y1, color='blue', label='$f(x) = 1/(x-1)^2$')
[Link](x2, y2, color='blue')
[Link](x=1, color='red', linestyle='--', label='Asíntota en x=1')
ax.set_ylim(-1, 20)
ax.set_title('Gráfica de la función $f(x) = \\frac{1}{(x-1)^2}$', fontsize=16)
ax.set_xlabel('Eje x', fontsize=12)
ax.set_ylabel('Eje y', fontsize=12)
[Link]()
[Link](True)
[Link]()

4
f (x) =
3
(x + 2)

In [4]: import [Link] as plt


import numpy as np

def f(x):
return 4 / (x + 2)**3

x1 = [Link](-10, -2.001, 500)


x2 = [Link](-1.999, 10, 500)
y1 = f(x1)
y2 = f(x2)

[Link](figsize=(10, 6))
[Link](x1, y1, label=r'$f(x) = \frac{4}{(x+2)^3}$')
[Link](x2, y2)
[Link]('Gráfica de la función racional $f(x) = \\frac{4}{(x+2)^3}$')
[Link]('Eje x')
[Link]('Eje y')
[Link](x=-2, color='gray', linestyle='--', label='Asíntota vertical x=-2')
[Link](y=0, color='gray', linestyle='--', label='Asíntota horizontal y=0')
[Link](-10, 10)
[Link](True)
[Link]()
[Link]()

x
f (x) =
2
x − 1

In [8]: import numpy as np


import [Link] as plt

def f(x):
return x / (x**2 - 1)

x1 = [Link](-5, -1.01, 100)


x2 = [Link](-0.99, 0.99, 100)
x3 = [Link](1.01, 5, 100)
y1 = f(x1)
y2 = f(x2)
y3 = f(x3)

[Link](figsize=(10, 8))
[Link](x1, y1, 'b')
[Link](x2, y2, 'b')
[Link](x3, y3, 'b')
[Link](x=-1, color='r', linestyle='--', label='Asíntotas verticales')
[Link](x=1, color='r', linestyle='--')
[Link](y=0, color='g', linestyle='--', label='Asíntota horizontal')
[Link]('Gráfica de la función racional $f(x) = x / (x^2 - 1)$')
[Link]('Eje X')
[Link]('Eje Y')
[Link](True)
[Link]()
[Link](-10, 10)
[Link]()

2
x
f (x) =
x2 − 4

In [9]: import [Link] as plt


import numpy as np

x1 = [Link](-10, -2.1, 500)


x2 = [Link](-1.9, 1.9, 500)
x3 = [Link](2.1, 10, 500)
y1 = x1**2 / (x1**2 - 4)
y2 = x2**2 / (x2**2 - 4)
y3 = x3**2 / (x3**2 - 4)

[Link](figsize=(10, 8))
[Link](x1, y1, color='blue')
[Link](x2, y2, color='blue')
[Link](x3, y3, color='blue')
[Link](x=-2, color='red', linestyle='--', label='Asíntota Vertical $x=-2$')
[Link](x=2, color='red', linestyle='--', label='Asíntota Vertical $x=2$')
[Link](y=1, color='green', linestyle='--', label='Asíntota Horizontal $y=1$')
[Link]('Gráfico de la función racional $f(x) = x^2 / (x^2 - 4)$', fontsize=16)
[Link]('$x$', fontsize=12)
[Link]('$f(x)$', fontsize=12)
[Link]()
[Link](True)
[Link](-10, 10)
[Link]()

2
1 − x
f (x) =
2
x

In [11]: import numpy as np


import [Link] as plt

def f(x):
return (1 - x**2) / (x**2)

x1 = [Link](-10, -0.1, 500)


x2 = [Link](0.1, 10, 500)
y1 = f(x1)
y2 = f(x2)

[Link](figsize=(10, 6))
[Link](x1, y1, color='blue', label='$f(x) = \\frac{1-x^2}{x^2}$')
[Link](x2, y2, color='blue')

[Link](x=0, color='red', linestyle='--', label='Asíntota vertical $x=0$')


[Link](y=-1, color='green', linestyle='--', label='Asíntota horizontal $y=-1$')
[Link]('Gráfico de la función racional $f(x) = \\frac{1-x^2}{x^2}$', fontsize=16)
[Link]('Eje X', fontsize=12)
[Link]('Eje Y', fontsize=12)
[Link](True)
[Link]()
[Link](-10, 5)
[Link]()

x(x − 5)
f (x) =
2
x − 9

In [2]: import [Link] as plt


import numpy as np

def f(x):
return (x * (x - 5)) / (x**2 - 9)

asintota_1 = -3
asintota_2 = 3
x1 = [Link](-20, asintota_1, 500, endpoint=False)
x2 = [Link](asintota_1, asintota_2, 500, endpoint=False)
x3 = [Link](asintota_2, 20, 500, endpoint=True)
y1 = f(x1)
y2 = f(x2)
y3 = f(x3)
[Link](figsize=(10, 8))
[Link](r'Gráfica de la función racional $f(x) = \frac{x(x-5)}{x^2 - 9}$', fontsize=15)
[Link]('Eje x')
[Link]('Eje y')
[Link](True)
[Link](0, color='black', linewidth=0.5)
[Link](0, color='black', linewidth=0.5)
[Link](1, color='red', linestyle='--', label='Asíntota horizontal (y=1)')
[Link](asintota_1, color='green', linestyle='--', label=f'Asíntota vertical (x={asintota_1})')
[Link](asintota_2, color='green', linestyle='--')
[Link](x1, y1, color='blue')
[Link](x2, y2, color='blue')
[Link](x3, y3, color='blue')
[Link]()
[Link](-15, 15)
[Link] ()

C:\Users\Dell Latitude 7480\AppData\Local\Temp\ipykernel_7452\[Link]: RuntimeWarning: divide by zero encountered in divide


return (x * (x - 5)) / (x**2 - 9)

2
x − 9
f (x) =
x

In [14]: import numpy as np


import [Link] as plt

def f(x):
return (x**2 - 9) / x

x_neg = [Link](-10, -0.1, 400)


x_pos = [Link](0.1, 10, 400)
y_neg = f(x_neg)
y_pos = f(x_pos)
[Link](figsize=(10, 6))
[Link](x_neg, y_neg, label='$f(x) = \\frac{x^2-9}{x}$')
[Link](x_pos, y_pos)
[Link](x=0, color='red', linestyle='--', label='Asíntota vertical en $x=0$')
x_asintota = [Link](-10, 10, 2)
y_asintota = x_asintota
[Link](x_asintota, y_asintota, color='green', linestyle=':', label='Asíntota oblicua en $y=x$')
[Link]('Gráfico de la función racional $f(x) = \\frac{x^2-9}{x}$', fontsize=16)
[Link]('Eje x', fontsize=12)
[Link]('Eje y', fontsize=12)
[Link](True, linestyle='--')
[Link](fontsize=10)
[Link](-20, 20)
[Link](-10, 10)
[Link]()
In [ ]:

You might also like