```python
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```


```python
x = np.linspace(2, 2*np.pi)
len(x)
print(x[:5])
```

    [ 2.          2.08741195  2.17482389  2.26223584  2.34964778]



```python
x = np.linspace(0, 2*np.pi, 100)
len(x)
```




    100




```python
y = np.sin(x)
len(y)
```




    100




```python
y[:5]
```




    array([ 0.        ,  0.06342392,  0.12659245,  0.18925124,  0.25114799])




```python
plt.figure(figsize=(12,4))
plt.plot(x,y, "x-" , ms=7, label = "$\sin(x)$")
plt.plot(x,np.cos(x), label = "$\cos(x)$", lw = 5)
plt.xlabel("$x$", fontsize = 18)
plt.ylabel("$y$", fontsize = 18)
plt.title("Funciones")
plt.legend()
plt.grid()
plt.plot(x,0*x, lw = 1)
plt.show()

```


```python
import sympy as sym
sym.init_printing(use_latex='mathjax')
```


```python
sym.var('x')
sym.sin(x)*np.sin(3)
```




$$0.141120008059867 \sin{\left (x \right )}$$




```python
sym.var("x", real = True)
```




$$x$$




```python
f= x**2; f
```




$$x^{2}$$




```python
df = sym.diff(f,x,1)
```


```python
# resolver f'(x)=0 y mostrar soluciones
xc = sym.solve(df, x)
xc
```




$$\left [ 0\right ]$$




```python
# convertir f e una función que se pueda evaluar numéricamente 

f_num = sym.lambdify([x], f, 'numpy')
x_vec = np.linspace(-5, 5, 100)

# graficar
plt.plot(x_vec, f_num(x_vec), color = "cyan")
plt.grid()
plt.xlabel('$x$', fontsize = 18)
plt.ylabel('$x^2$', fontsize = 18)
plt.show()
```


```python
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```


```python
def f(x):
    return x**2
```


```python
def h(x,y):
    return np.sin(x)/np.tan(y)
```


```python
x = np.linspace(-5,5)
plt.plot(x,f(x),"--")
plt.plot(x,h(x,.1), "-.")
plt.plot(x,h(x,.4), "-")
plt.scatter(0,0,marker = "D",s=50,lw=50)
plt.show
```


```python

```

a1a1e7bd94922bfbac33aa7850411bf933db49de
ipynb
Jupyter Notebook
Modulo1/Clase4Douglas.ipynb
douglasparism/SimulacionM2018
85953efb86c7ebf2f398474608dfda18cb4cf5b8
MIT
Modulo1/Clase4Douglas.ipynb
douglasparism/SimulacionM2018
85953efb86c7ebf2f398474608dfda18cb4cf5b8
MIT
Modulo1/Clase4Douglas.ipynb
douglasparism/SimulacionM2018
85953efb86c7ebf2f398474608dfda18cb4cf5b8
MIT
Qwen/Qwen-72B
1. YES
2. YES