How can I get Sagemath to simplify the following?

139 Views Asked by At

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

1

There are 1 best solutions below

0
On BEST ANSWER

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