```python
import sympy as sp
```


```python
x,y = sp.symbols('x y')
f = sp.Function('f')(x)
g = sp.Function('f')(x, y)
f
g
```




$\displaystyle f{\left(x,y \right)}$




```python
f.diff(x)
```




$\displaystyle \frac{d}{d x} f{\left(x \right)}$




```python
g.diff(x)
```




$\displaystyle \frac{\partial}{\partial x} f{\left(x,y \right)}$




```python
ode = sp.Eq(x*f.diff(x,x)+f.diff(x), x**3)
display(ode)
sol = sp.dsolve(ode)
sol
```


$\displaystyle x \frac{d^{2}}{d x^{2}} f{\left(x \right)} + \frac{d}{d x} f{\left(x \right)} = x^{3}$





$\displaystyle f{\left(x \right)} = C_{1} + C_{2} \log{\left(x \right)} + \frac{x^{4}}{16}$




```python
ivp = sp.dsolve(ode, ics={f.subs(x,1):0, f.diff().subs(x,2):1})
ivp
```




$\displaystyle f{\left(x \right)} = \frac{x^{4}}{16} - 2 \log{\left(x \right)} - \frac{1}{16}$




```python
ivp.subs(x,1)

```




$\displaystyle f{\left(1 \right)} = 0$




```python
ivp.rhs.diff().subs(x,2)
```




$\displaystyle 1$




```python
(x*ivp.rhs.diff(x,x) + ivp.rhs.diff()).simplify()
```




$\displaystyle x^{3}$




```python

```

6813d38d0f780bc8357f164dfb214db550f22b52
ipynb
Jupyter Notebook
python/matplotlib/Scipy/ODE.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/matplotlib/Scipy/ODE.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/matplotlib/Scipy/ODE.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
Qwen/Qwen-72B
1. YES
2. YES