# Revision history [back]

### 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: tdiff(y,t) + y == texp(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(tdiff(y,t) + y == texp(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.

 2 No.2 Revision kcrisman 12082 ●39 ●126 ●246

### 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: tdiff(y,t) is:

t*diff(y,t) + y == texp(t^2), t*exp(t^2), and y(2) = 1


The problem is that every tutorial/documentation I googled, there is something like: like:

t = var('t')
y = function('y',t)
desolve(tdiff(y,t) desolve(t*diff(y,t) + y == texp(t^2),y, t*exp(t^2),y, ics=[1])
but it sets y(0) = 1, and I want to y(2) = 1.1.


I don't know if it's me googling poorly or something with sage doc, but plz, help me solve this.

### 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])