Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Surprising FullSimplify result

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111510] Re: Surprising FullSimplify result
  • From: "David Park" <djmpark at comcast.net>
  • Date: Tue, 3 Aug 2010 06:42:48 -0400 (EDT)

Two techniques that are useful for manipulating or simplifying expressions
are:

1) Protect certain subexpressions against participating in simplifications
by using a Hold or HoldForm. 

2) Operate only on a selected subset of level parts in an expression.

The following uses the first technique:

Cos[theta]^2 + Sin[theta]^2 + L^2 Cos[theta]^2; 
MapAt[Hold, %, 2]; 
% // Simplify // ReleaseHold 

1 + L^2 Cos[theta]^2 


The second technique can be implemented using the MapLevelParts or
MapLevelPatterns routines in the Presentations Manipulation subsection.

Needs["Presentations`Master`"] 

Cos[theta]^2 + Sin[theta]^2 + L^2 Cos[theta]^2; 
% // MapLevelParts[Simplify, {{1, 3}}] 

1 + L^2 Cos[theta]^2 

Or using patterns and TrigExpand instead:

Cos[theta]^2 + Sin[theta]^2 + L^2 Cos[theta]^2; 
% // MapLevelPatterns[TrigExpand, {{(Sin | Cos)[_]^2}}] 


1 + L^2 Cos[theta]^2 


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  


From: Sam Takoy [mailto:sam.takoy at yahoo.com] 

Here's what I am getting

Cos[theta]^2 + Sin[theta]^2 // FullSimplify
Out[540]= 1

Cos[theta]^2 + Sin[theta]^2 + L^2 Cos[theta]^2 // FullSimplify
Out[541]= 1/2 (2 + L^2 + L^2 Cos[2 theta])

I'm really surprised that the answer in the latter case is not

1+ L^2 Cos[theta]^2

Is there an explanation?

Thanks,

Sam




  • Prev by Date: Re: Re: assuming certain properties about variables
  • Next by Date: Re: ReplaceAll and ReplaceRepeated Strange Behavior
  • Previous by thread: Re: Surprising FullSimplify result
  • Next by thread: Re: Surprising FullSimplify result