I'm trying to the a slope field and some solutions to
dxdt=x2−4x
I was able to get the slope field to plot with:
x,y=var('x','t')
plot_slope_field(x^2-4*x,(t,0,5),(x,-4,8))
I can't figure out how to the solutions to plot. I can get a general solution:
t = var('t')
x = function('x')(t)
f=desolve(diff(x,t) == x^2-4*x,[x,t])
show(f)
14log(x(t)−4)−14log(x(t))=C+t
If I try it with initial values, say ics=[2,2], I get imaginary solutions:
14log(x(t)−4)−14log(x(t))=14iπ+t−2
I was able to plot solutions with another windows tool, winplot, but really want to do it in sage. Any clues on how I can do that?