       Re: How to find one expression in terms of another expression?

• To: mathgroup at smc.vnet.net
• Subject: [mg119741] Re: How to find one expression in terms of another expression?
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Mon, 20 Jun 2011 08:04:23 -0400 (EDT)

```On 6/19/11 at 7:29 PM, walkeystalkey at gmail.com (Jacare Omoplata)
wrote:

>I want to find dT in terms of dt. They are given below.

>In:= Element[{x1, x2, t1, t2, u, c}, Reals]
>Out= (x1 | x2 | t1 | t2 | u | c) \[Element] Reals

The above isn't useful outside a list of assumptions. You cannot
set global properties of variables in this manner.

>In:= T1 = (t1 - ((u x1)/c^2))/Sqrt[1 - (u^2/c^2)]
>Out= (t1 - (u x1)/c^2)/Sqrt[1 - u^2/c^2]

>In:= T2 = (t2 - ((u x2)/c^2))/Sqrt[1 - (u^2/c^2)]
>Out= (t2 - (u x2)/c^2)/Sqrt[1 - u^2/c^2]

>In:= dT = T2 - T1
>Out= -((t1 - (u x1)/c^2)/Sqrt[1 - u^2/c^2]) + (
>t2 - (u x2)/c^2)/Sqrt[1 - u^2/c^2]

>In:= dt = t2 - t1
>Out= -t1 + t2

This is what is causing the error message when you use Solve

>If I knew that dT can be written in terms of dt in the form, dT = a
>dt + b, Can I use Mathematica to find a and b?

Yes,

>I tried using  Solve[dT == a dt + b, dt], but that gives an error.

The problem here is you have already given dt a value. And it is
that value that gets substituted in the equation you set up.
That is your input to Solve is exactly equivalent to

Solve[dT == a (t2-t1) + b, t2-t1]

Since t2-t1 is clearly not a variable you get the error message.
A couple of things can be done.

Use Block to localize dt, i.e.,

In:= Block[{dt}, Solve[dT == a dt + b, dt]]
Out= {{dt -> (-(b*c^2*Sqrt[(c^2 - u^2)/c^2]) + c^2*(-t1) +
c^2*t2 +
u*x1 - u*x2)/(a*c^2*Sqrt[(c^2 - u^2)/c^2])}}

Clear the definition of dt and use Solve as you did above. But I
suspect neither of these will give you the result you are
looking for.

I think you want something like

In:= expr=Together[dT] /. t2 -> dt + t1 // Simplify
Out= (c^2*dt + u*(x1 - x2))/(c^2*Sqrt[1 - u^2/c^2])

In:= CoefficientList[expr, dt]
Out= {(u*(x1 - x2))/(c^2*Sqrt[1 - u^2/c^2]), 1/Sqrt[1 - u^2/c^2]}

```

• Prev by Date: Re: How to find one expression in terms of another
• Next by Date: Re: Why can't FullSimplify give more uniform output?
• Previous by thread: Re: Multiple use of Set on lists
• Next by thread: Re: How to find one expression in terms of another expression?