# 2. Algebrai műveletek


```python
import math
import numpy as np
import sympy as sp
sp.init_printing()
```


```python
F, m, a, b, c, x = sp.symbols("F m a b c x")
```


```python
F=m*a
```


```python
F.subs([(a,7)])
```


```python
F.subs([(a,7),(m,1.1)])
```


```python
((a+b)**3).expand()
```


```python
((a+b)**7 - (b+2*a)**3).expand()
```


```python
(a**2+b**2+2*a*b).factor()
```


```python
sp.factor(a**2+b**2+2*a*b)
```


```python
sp.factor(b**3 + 3*a*b**2 + 3*a**2*b + a**3)
```


```python
a/b+c/b+7/b
```


```python
sp.ratsimp(a/b+c/b+7/b)
```


```python
(a/b+c/b+7/b).ratsimp()
```


```python
(sp.sin(x)**2 + sp.cos(x)**2).simplify()
```


```python
(sp.cos(2*x)).expand()
```


```python
sp.expand_trig(sp.cos(2*x))
```


```python
import scipy.constants
```


```python
scipy.constants.golden
```


```python
math.sqrt(-1+0j)
```


```python
np.sqrt(-1+0j)
```




    1j




```python
sp.limit(sp.sin(x)/x,x,0)
```


Taylor-sor megadása. Első paraméter a függvény, második a változó, harmadik az érték ami körül akarjuk a sort kifejteni, negyedik pedig a fokszám:

$$f\left(x\right) \approx \sum\limits_{i=0}^{N} \dfrac{\left(x - x_0\right)^i}{i!} \left.\dfrac{\mathrm{d}^i f}{\mathrm{d} x^i}\right|_{x = x_0}$$


```python
sp.series(sp.sin(x),x,0,20)
```


```python
lista = np.array([2,3,64,89,1,4,9,0,1])
```


```python
lista.sort()
lista
```




    array([ 0,  1,  1,  2,  3,  4,  9, 64, 89])



4434e0454377491104f53895a6ad94ca57dfdbb6
ipynb
Jupyter Notebook
01/01_02_algebrai_muveletek.ipynb
TamasPoloskei/BME-VEMA
542725bf78e9ad0962018c1cf9ff40c860f8e1f0
MIT
01/01_02_algebrai_muveletek.ipynb
TamasPoloskei/BME-VEMA
542725bf78e9ad0962018c1cf9ff40c860f8e1f0
MIT
2018-11-20T14:17:52.000Z
2018-11-20T14:17:52.000Z
01/01_02_algebrai_muveletek.ipynb
TamasPoloskei/BME-VEMA
542725bf78e9ad0962018c1cf9ff40c860f8e1f0
MIT
Qwen/Qwen-72B
1. YES
2. YES