```python
import numpy as np
from sympy import *
from mpmath import mp

import matplotlib.pyplot as plt
```

## Problem 1


```python
x, y = symbols('x y')
```


```python
eq = Eq(y, sympify('ln(x)'))
eq
```




    Eq(y, log(x))




```python
x = solve(eq, x)[0]
x
```




    exp(y)




```python
plot(x, (y, 1, 2), xlim=(0, 3), ylim=(0, 10))
```


```python
ans = integrate(mp.pi*x**2, (y, 1, 2))
ans
```




    -1.5707963267949*exp(2) + 1.5707963267949*exp(4)




```python
ans.evalf()
```




    74.1558713431779



### Arrived Ans:


```python
(mp.pi*(exp(4)-exp(2))/2).evalf()
```




    74.1558713431779



## Problem 2


```python
x, y0, y1, pi = symbols('x y0 y1 pi')
```


```python
y0 = 6 - x**2
y0
```




    -x**2 + 6




```python
y1 = 2
y1
```




    2




```python
eq = Eq(y0, y1)
eq
```




    Eq(-x**2 + 6, 2)




```python
bounds = solve(eq, x)
bounds
```




    [-2, 2]




```python
plot((y0, (x, *bounds)), (y1, (x, *bounds)), xlim=(-3, 3), ylim=(0, 10))
```


```python
ans = integrate(pi*(y0**2-y1**2), (x, -2, 2))
ans
```




    384*pi/5




```python
ans.subs(pi, mp.pi)
```




    241.274315795696



## Problem 3


```python
x, y0, y1, pi, r0, r1 = symbols('x y0 y1 pi r0 r1')
```


```python
y0 = x
y0
```




    x




```python
y1 = x**2
y1
```




    x**2




```python
eq = Eq(y0, y1)
solve(eq, x)
```




    [0, 1]




```python
plot(y0, y1, xlim=(-1, 3), ylim=(0, 4))
```


```python
r0 = 2 - y0
r0
```




    -x + 2




```python
r1 = 2 - y1
r1
```




    -x**2 + 2




```python
(r1**2-r0**2).simplify()
```




    x*(x**3 - 5*x + 4)




```python
integrate(pi*(r1**2-r0**2), x)
```




    pi*x**5/5 - 5*pi*x**3/3 + 2*pi*x**2




```python
integrate(pi*(r1**2-r0**2), (x, 0, 1))
```




    8*pi/15




```python
integrate(pi*(r0**2-r1**2), x).subs(x, 1)
```




    -8*pi/15




```python
integrate(pi*(r0**2-r1**2), (x, 1, sqrt(2)))
```




    -52*pi/15 + 38*sqrt(2)*pi/15




```python
integrate(pi*r0**2, x).subs(x, sqrt(2))
```




    -4*pi + 14*sqrt(2)*pi/3




```python
ans = integrate(pi*(r1**2-r0**2), (x, 0, 1)) + integrate(pi*(r0**2-r1**2), (x, 1, sqrt(2))) + integrate(pi*r0**2, (x, sqrt(2), 2))
ans
```




    -32*sqrt(2)*pi/15 + 56*pi/15




```python
ans.subs(pi, mp.pi).evalf()
```




    2.25046230533071




```python

```

66e3db477d59e6fd4d764c3e4bf2b99a86878576
ipynb
Jupyter Notebook
data/TEMP.ipynb
LE-LOY/socialsims
b1eb0413d3ce52886e41679024974f5d7c1dc32f
MIT
data/TEMP.ipynb
LE-LOY/socialsims
b1eb0413d3ce52886e41679024974f5d7c1dc32f
MIT
data/TEMP.ipynb
LE-LOY/socialsims
b1eb0413d3ce52886e41679024974f5d7c1dc32f
MIT
Qwen/Qwen-72B
1. YES
2. YES