# Program 02c: Power series solution first order ODE; exa 7 chp 2
|
|
from sympy import dsolve, Function, pprint
|
|
from sympy.abc import t
|
|
x = Function('x')
|
|
dxdt = x(t).diff(t)
|
|
ode = dxdt+t*x(t)-t**3
|
|
sol = dsolve(ode, hint='1st_power_series', n=8, ics={x(0): 1})
|
|
print('Solution:\n')
|
|
pprint(sol)
|