```python
import sympy
```


```python
x = sympy.symbols("x")
slope = 3

# Phi-sides
phi1 = 3*x
phi2 = 2-3*x
phi3 = 3*x-1
phi4 = 3-3*x
```


```python
interval1 = sympy.integrate(slope**2, (x, 0, sympy.Rational(1, 3)))
interval2 = sympy.integrate(slope**2, (x, sympy.Rational(1, 3), sympy.Rational(2, 3)))

interval3 = sympy.integrate(phi1**2, (x, 0, sympy.Rational(1, 3)))
interval4 = sympy.integrate(phi2**2, (x, sympy.Rational(1, 3), sympy.Rational(2, 3)))

K_11 = interval1 + interval2 + interval3 + interval4
K_11
```




$\displaystyle \frac{56}{9}$




```python
interval1 = sympy.integrate(-slope*slope, (x, sympy.Rational(1, 3), sympy.Rational(2, 3)))
interval2 = sympy.integrate(phi2*phi3, (x, sympy.Rational(1, 3), sympy.Rational(2, 3)))

K_12 = interval1 + interval2
K_12
```




$\displaystyle - \frac{53}{18}$




```python
# Because of symmetry

sympy.Matrix([[K_11, K_12], [K_12, K_11]])
```




$\displaystyle \left[\begin{matrix}\frac{56}{9} & - \frac{53}{18}\\- \frac{53}{18} & \frac{56}{9}\end{matrix}\right]$



10a3d87d5930a7dc83ed71e21e2cb01db0d2f5cc
ipynb
Jupyter Notebook
3.BoundaryValueProblems/Exam2/Exam2.ipynb
nickovchinnikov/Computational-Science-and-Engineering
45620e432c97fce68a24e2ade9210d30b341d2e4
MIT
2021-01-14T08:00:23.000Z
2022-01-31T14:00:11.000Z
3.BoundaryValueProblems/Exam2/Exam2.ipynb
nickovchinnikov/Computational-Science-and-Engineering
45620e432c97fce68a24e2ade9210d30b341d2e4
MIT
3.BoundaryValueProblems/Exam2/Exam2.ipynb
nickovchinnikov/Computational-Science-and-Engineering
45620e432c97fce68a24e2ade9210d30b341d2e4
MIT
2022-01-25T15:21:40.000Z
2022-01-25T15:21:40.000Z
Qwen/Qwen-72B
1. YES
2. YES