I can also do this in Mathematica the following way,

$Assumptions = True;

T1 = (t1 - ((u x1)/c^2))/Sqrt[1 - (u^2/c^2)];

T2 = (t2 - ((u x2)/c^2))/Sqrt[1 - (u^2/c^2)];

dT = T2 - T1;

FullSimplify[dT /. t2 -> dt + t1]

(c^2*dt + u*(x1 - x2))/(c^2*Sqrt[1 - u^2/c^2])

FullSimplify[dT /. t2 -> dt + t1, Element[c, Reals]]

(c^2*dt + u*(x1 - x2))/(Sqrt[(c - u)*(c + u)]*Abs[c])

$Assumptions = Element[c, Reals];

FullSimplify[dT /. t2 -> dt + t1]

(c^2*dt + u*(x1 - x2))/(Sqrt[(c - u)*(c + u)]*Abs[c])


Still don't know how to do this in Sage :(

On Jun 19, 1:32 pm, Jacare Omoplata <walkeystal...@gmail.com> wrote:
> I found out that in Mathematica this can be done by
> PolynomialReduce[dT, dt, {t1, t2}]. Output given below.
>
> In[26]:= FullSimplify[PolynomialReduce[dT, dt, {t1, t2}]]
>
> Out[26]= {{1/Sqrt[1 - u^2/c^2]}, (u (x1 - x2))/(c^2 Sqrt[1 - u^2/
> c^2])},
>
> But I'd rather use Sage. Does Sage have a counterpart to this
> Mathematica function? If not how do get the same result?
>
> On Jun 19, 11:19 am, Jacare Omoplata <walkeystal...@gmail.com> wrote:
>
>
>
>
>
>
>
> > The following are the expressions,
>
> > sage: var('x1,t1,x2,t2,u,c',domain=RR);assume(u>0);assume(c>u);
> > (x1, t1, x2, t2, u, c)
> > sage: T1 = (t1-((u*x1)/(c^2)))/sqrt(1-((u^2)/(c^2)))
> > sage: T2 = (t2-((u*x2)/(c^2)))/sqrt(1-((u^2)/(c^2)))
> > sage: dT = T2-T1
> > sage: dt = t2-t1
>
> > Suppose I know that dT is in this form,
>
> > dT = a*dt + b,
>
> > Assuming I DID NOT know that,
> > a = 1/sqrt(1-((u^2)/(c^2)))   ,
> > b = (u*(x2 - x1))/((c^2)*sqrt(1-((u^2)/(c^2))))  ,
>
> > is there any way I can find 'a' and 'b' using Sage?
>
> > What if I didn't know that dT is in the form of a*dt + b, but just
> > knew dT in terms of x1,t1,x2,t2,u and c ?
>
> > Can I still express dT in terms of dt using sage?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to