Re: Simplifying algebraic expr: howto?
- To: mathgroup@smc.vnet.net
- Subject: [mg11521] Re: Simplifying algebraic expr: howto?
- From: carlos@mars.Colorado.EDU (Carlos A. Felippa)
- Date: Fri, 13 Mar 1998 12:22:10 -0500
- Organization: University of Colorado, Boulder
- References: <6dqqf0$rk0@smc.vnet.net> <6dv577$5jm@smc.vnet.net>
In article <6dv577$5jm@smc.vnet.net> "Daniel G. Hyams" <dgh2@Ra.MsState.EDU> writes: >On 7 Mar 1998, Daniel G. Hyams wrote: > >> >> I apologize for the (probable) simpleness of this questions, but I am >> new to mathamatica... >> >> I have an expression (for example): >> >> u*(nx*u + ny*v) ---- (1) >> >> and a definition: >> >> theta = nx*u+ny*v >> >> How do I get mathematica to simplify the expression (1) such that it >> returns: >> >> u*theta ? > >Thanks to the couple of folks who responded to the questions, but I am >afraid that I did not make it clear enough... > >The code that follows does indeed work: > >T = (nx*u+ny*v)*u >T /. (nx*u+ny*v -> t) > >Mathematica: t*u > >But, this seems to do just a textual-type substitution. The following >snippet does not work (like I want it to): > >T = (nx*u+ny*v)*u + (-nx*u-ny*v)*v >T /. (nx*u+ny*v -> t) > >Mathematica: t*u + v(-nx*u - ny*v) > >Obviously, the solution that I want is: t*u-t*v > >The point is that the variable "t" is in a very complicated expression, >which can be considerably simplified by factoring it out, if only I >could tell Mathematica its identity. It also appears as > v*nx*u + ny*v^2 = v(nx*u + ny*v) = v*t > > or > > nx^2*u + 2*nx*ny*u*v + ny^2*v = (nx*u+ny*v)^2 = t^2 > >and I would like Mathematica to identify occurances like these. > > >----------------------------------------------------------- Daniel G. >Hyams >email: dhyams@ebicom.net >phone: (601) 323-4198 >----------------------------------------------------------- > > I faced that problem many times over the past 3 years. So far as I know there is no general solution.