MathGroup Archive 2010

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

Search the Archive

Re: Surprising FullSimplify result

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

Two techniques that are useful for manipulating or simplifying expressions

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.


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  

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

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?



  • 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