Ask Your Question
1

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 +0100

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 
desolve(de,y)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

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

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

Comments

Ahh that makes sense. Thank you!

Austin gravatar imageAustin ( 2021-07-09 01:21:16 +0100 )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

Stats

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

Seen: 201 times

Last updated: Jul 08 '21