```python
import loader
from sympy import *
init_printing()
from root.solver import *
```

#### Solve $t^2 y' + 2ty - y^3 = 0$
First convert to standard form: $y' + \frac{2}{t} = \frac{1}{t^2} y^3$


```python
_, p = first_order_bernoulli(2 / t, 1 / (t ** 2), 2)
p.display()
```


$\displaystyle \text{Use the substitution }v = y^{1-n}\text{, }y = v y^n$



$\displaystyle \frac{d}{d t} v{\left (t \right )} = - \frac{\frac{d}{d t} y{\left (t \right )}}{y^{2}{\left (t \right )}}\Rightarrow\frac{d}{d t} y{\left (t \right )} = - y^{2}{\left (t \right )} \frac{d}{d t} v{\left (t \right )}$



$\displaystyle \text{Substitute }y'(t)\text{ into the original equation}$



$\displaystyle - y^{2}{\left (t \right )} \frac{d}{d t} v{\left (t \right )} + \frac{2 y{\left (t \right )}}{t} = \frac{y^{2}{\left (t \right )}}{t^{2}}$



$\displaystyle \text{Divide both sides by }\frac{y^{n}}{n - 1}$



$\displaystyle \frac{d}{d t} v{\left (t \right )} - \frac{2}{t y{\left (t \right )}} = - \frac{1}{t^{2}}$



$\displaystyle \text{Note that }v = y^{1-n}$



$\displaystyle \frac{d}{d t} v{\left (t \right )} - \frac{2 v{\left (t \right )}}{t} = - \frac{1}{t^{2}}$



$\displaystyle \text{Now we need to solve the linear ODE in }v$



$\displaystyle \text{Calculate the integrating factor }\mu$



$\displaystyle \mu = e^{\int \left(- \frac{2}{t}\right)\, dt} = \frac{1}{t^{2}}$



$\displaystyle \text{Multiply both sides of the equation by }\mu$



$\displaystyle \frac{1}{t^{2}} \frac{d}{d t} v{\left (t \right )} - \frac{2 v{\left (t \right )}}{t^{3}} = - \frac{1}{t^{4}}$



$\displaystyle \frac{d}{d t} \frac{v{\left (t \right )}}{t^{2}} = - \frac{1}{t^{4}}$



$\displaystyle \frac{v{\left (t \right )}}{t^{2}} = C + \frac{1}{3 t^{3}}$



$\displaystyle v{\left (t \right )} = C t^{2} + \frac{1}{3 t}$



$\displaystyle \text{Use }y = v^{\frac{1}{1 - n}}\text{ to solve for }y$



$\displaystyle y{\left (t \right )} = \frac{3 t}{3 C t^{3} + 1}$



```python

```

71912940175ff3f7bd60b48976eb0100ba426c5e
ipynb
Jupyter Notebook
notebooks/first-order-bernoulli.ipynb
kaiyingshan/ode-solver
30c6798efe9c35a088b2c6043493470701641042
MIT
2019-02-17T23:15:20.000Z
2019-02-17T23:15:27.000Z
notebooks/first-order-bernoulli.ipynb
kaiyingshan/ode-solver
30c6798efe9c35a088b2c6043493470701641042
MIT
notebooks/first-order-bernoulli.ipynb
kaiyingshan/ode-solver
30c6798efe9c35a088b2c6043493470701641042
MIT
Qwen/Qwen-72B
1. YES
2. YES