Solving differential equations with initial value starting not at 0
Hello,
I'm trying sage instead of Mathematica and for I have a lot of problem, but first what is realy frustrating is solving diff eq. with initial value. For example, my equation is:
t*diff(y,t) + y == t*exp(t^2), and y(2) = 1
The problem is that every tutorial/documentation I googled, there is something like:
t = var('t')
y = function('y',t)
desolve(t*diff(y,t) + y == t*exp(t^2),y, ics=[1])
but it sets y(0) = 1, and I want to y(2) = 1.
I don't know if it's me googling poorly or something with sage doc, but plz, help me solve this.
Ok, I think I've got the solution:
t = var('t')
y = function('y',t)
de = lambda y: t*diff(y,t) + y - t*exp(t^2)
desolve(de(x),[x,t],[1,2])