# HP Forums

Full Version: how to solve a system of diff eq ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I try to solve this small system of differential equation :

x'(t)+y(t)=t^2
x'(t)+y'(t)=6

with initial conds : x(0)=0 and y(0)=1

I tried with desolve on 10077,
something like that desolve({x'+y=t^2, x'+y'=6} and x(0)=0 and y(0)=1, {x,y})
but I didn't get any result.

does someone knows how to do ?
Three points:

1. I solved the second equation for x', plug it into the first equation, and solved for x and y separately;
2. I think you have to tell desolve that t is the time variable or it assumes x;
3. I have never had luck typing y'. Typing diff(y) seems to work better.

Here's the code:

desolve(((6-(y')+y) = (t^2)) AND ((y(0)) = 1),t,y)
returns y:
t^2+5*e^t+2*t-4

diff(t^2+5*e^t+2*t-4,t)
returns y':
5*e^t+2*t+2

desolve(((x'+5*e^t+2*t+2) = 6) AND ((x(0)) = 0),t,x)
returns x:
-t^2-5*e^t+4*t+5
desolve solves differential equations, not systems, except for linear systems with constant coefficient for the homogeneous part, then the syntax is
desolve(y'=A*y+b) where A is the matrix and b a vector (second member)
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :