# Simplification


```python
# Load sympy module
from sympy import *
```


```python
# Define variables
x, y = symbols('x y')
```

## Simplification of $$\frac{x^2 + x\times y}{x + y} = x$$


```python
# Simplification
simplify((x**2 + x*y)/(x + y))
```




$\displaystyle x$



## Rational simplification of $$(x^2 + 1)(x + 2) = x^3 + 2x^2 + x + 2$$


```python
# Rational simplification
expand((x**2 + 1)*(x+2))
```




$\displaystyle x^{3} + 2 x^{2} + x + 2$



## Factor of $$x^2 + 2x + 1 = (x + 1)^2$$


```python
# Factor
factor(x**2 + 2*x + 1)
```




$\displaystyle \left(x + 1\right)^{2}$



b1553dce9a07fce105cf4e7a561f10a89f9d645c
ipynb
Jupyter Notebook
simplification.ipynb
ricoen/learn-math
fc84bc4d0dc353f8ccb3c52e36155069e9ca5af4
MIT
2021-11-30T10:05:29.000Z
2021-12-30T13:39:08.000Z
simplification.ipynb
ricoen/learn-math
fc84bc4d0dc353f8ccb3c52e36155069e9ca5af4
MIT
simplification.ipynb
ricoen/learn-math
fc84bc4d0dc353f8ccb3c52e36155069e9ca5af4
MIT
Qwen/Qwen-72B
1. YES
2. YES