1

I am new to sage. If I provide the following instructions to sagemath

x, y = var('x,y')
E = function('E')(x,y)
F = function('F')(x,y)  
G = function('G')(x,y)
s = function('s')(x,y)   
firstX = E^(-1/2) * diff(s,x) 
(E^(-1/2) * diff(firstX,x))

it produces this result:

-1/2*(diff(E(x, y), x)*diff(s(x, y), x)/E(x, y)^(3/2) - 2*diff(s(x, y), x, x)/sqrt(E(x, y)))/sqrt(E(x, y)) 

while I would like it to produce

-1/2*(diff(E(x, y), x)*diff(s(x, y), x)/E(x, y)^2 + diff(s(x, y), x, x)) / E(x, y)

simplify_full/full_simplify (any difference?) gives

-1/2*(diff(E(x, y), x)*diff(s(x, y), x) - 2*E(x, y)*diff(s(x, y), x, x))/E(x, y)^2

which is good in a sense but I think it would be better to have two distinct summands. Do you know of any way to get this?

thanks

  • In general, getting sage to simplify to a certain desired output is kind of tricky. Part of the territory when working with computer algebra systems is taking their output and doing some touch-ups to make things more human-readable. It's kind of tedious, but at least it's not "hard". I've heard that mathematica has better defaults than sage, so that you don't have to do AS much of this, but I don't have any personal experience there and I think there's no way to avoid it entirely. – HallaSurvivor May 16 '23 at 02:48
  • 1
    If you look at the help message for simplify_full or full_simplify via EXPRESSION.full_simplify?, it says ALIAS: "simplify_full" and "full_simplify" are the same. – John Palmieri May 21 '23 at 04:55

1 Answers1

1

First note that it may be better to use Sagecell rather than alternate sites.

One can do the calculation in Sagemath this way

x, y = var('x,y')
E = function('E')(x,y)
F = function('F')(x,y)  
G = function('G')(x,y)
s = function('s')(x,y)   
firstX = E^(-1/2) * diff(s,x) 
show(expand( (E^(-1/2) * diff(firstX,x)) ))

which gives

enter image description here

Leucippus
  • 26,329