Ask Your Question

Why am I getting a different solution on SageMath for an ODE compared to when I work it by hand?

asked 2021-07-08 02:38:41 +0200

Austin gravatar image

I am solving the separable linear ODE y'(x)+y(x)'-1 = 0 and SageMath returns the solution:

(_C + e^x)*e^(-x)

However, when I work it by hand I get this answer with a minor difference:

y = -e^(-x)C +1

Where is the negative sign in the SageMath solution?

Here is my code:

y = function('y')(x) 
x = var('x')  
de = diff(y,x)+y-1 == 0 
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-07-08 22:20:03 +0200

slelievre gravatar image

There is not really a difference.

Both answers involve an arbitrary constant.

Your C is the opposite of Sage's _C.

edit flag offensive delete link more


Ahh that makes sense. Thank you!

Austin gravatar imageAustin ( 2021-07-09 01:21:16 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2021-07-08 02:38:41 +0200

Seen: 153 times

Last updated: Jul 08 '21