# Sympy


```python
import math

math.sqrt(9)
```




    3.0




```python
math.sqrt(8)
```




    2.8284271247461903




```python
import sympy
result = sympy.sqrt(8)
# result = 2*sqrt(2)
result
```




$\displaystyle 2 \sqrt{2}$




```python
result / 2
```




$\displaystyle \sqrt{2}$



# Símbolos en sympy


```python
# Representar la expresión x + 2y

expression = x + 2*y
```


```python
from sympy import symbols

x, y = symbols('x y')
expression = x + 2*y
expression

```




$\displaystyle x + 2 y$




```python
expression + 1

```




$\displaystyle x + 2 y + 1$




```python
expression - x

```




$\displaystyle 2 y$



# Integrales
El método principal de este módulo es `integrate()`

integrate(f, x) retorna la integral indefinida 

integrate(f, (x, a, b)) retorna la integral definida entre `b` y `a`



```python
from sympy import *
x = Symbol('x')

expr = 2 * (x**3)
expr

```




$\displaystyle 2 x^{3}$




```python
integrate(expr, x)
```




$\displaystyle \frac{x^{4}}{2}$




```python
expr = x**2 * exp(x) * cos(x)
expr
```




$\displaystyle x^{2} e^{x} \cos{\left(x \right)}$




```python
integrate(expr, x)
```




$\displaystyle \frac{x^{2} e^{x} \sin{\left(x \right)}}{2} + \frac{x^{2} e^{x} \cos{\left(x \right)}}{2} - x e^{x} \sin{\left(x \right)} + \frac{e^{x} \sin{\left(x \right)}}{2} - \frac{e^{x} \cos{\left(x \right)}}{2}$




```python

```

1b82882880df283cd24deaeba9da6b00c7e9f91e
ipynb
Jupyter Notebook
Videos/PrimerBimestre/video2.ipynb
renatojobal/python_sol
d8d0434755679d62caa34d0ea227aacc2aa1ad6d
MIT
Videos/PrimerBimestre/video2.ipynb
renatojobal/python_sol
d8d0434755679d62caa34d0ea227aacc2aa1ad6d
MIT
Videos/PrimerBimestre/video2.ipynb
renatojobal/python_sol
d8d0434755679d62caa34d0ea227aacc2aa1ad6d
MIT
2021-02-02T03:33:44.000Z
2021-02-02T03:34:20.000Z
Qwen/Qwen-72B
1. YES
2. YES