Re: Simplifying an expression - with my own definition of what "simple"
- To: mathgroup at smc.vnet.net
- Subject: [mg83794] Re: [mg83441] Simplifying an expression - with my own definition of what "simple"
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sat, 1 Dec 2007 05:33:51 -0500 (EST)
- References: <200711200858.DAA07524@smc.vnet.net>
GroebnerBasis will do this for you. Here is Sin[x]^2: Z /. Solve[GroebnerBasis[{Z - Sin[x]^2, Cos[x] - 1 + 2*f[x]^2, 1 - Cos[x]^2 - Sin[x]^2}, {Z, f[x]}, {Sin[x], Cos[x]}] == 0, Z][[1]] -4*(f[x]^4 - f[x]^2) Here is Sin[x]^2+Cos[x]^4 Z /. Solve[GroebnerBasis[{Z - Sin[x]^2 - Cos[x]^4, Cos[x] - 1 + 2*f[x]^2, 1 - Cos[x]^2 - Sin[x]^2}, {Z, f[x]}, {Sin[x], Cos[x]}] == 0, Z][[1]] 16*f[x]^8 - 32*f[x]^6 + 20*f[x]^4 - 4*f[x]^2 + 1 It should also work with Eliminate (since Eliminate uses GroebnerBasis) but is a bit harder to control. Andrzej Kozlowski On 20 Nov 2007, at 17:58, user8472 wrote: > Hi, > > I am using Mathematica 5.2 on i386 Linux and I have the following > problem: I want to express a rational polynomial of trigonometric > functions in terms of elementary polynomials that I have defined > myself. > > A simplified example of what I want to do is illustrated as follows: > Suppose the elementary function is f[x_]:=Sin[x/2], then I want to > obtain > > Cos[x] becomes 1-2*f[x]^2 > > Sin[x]^2 becomes 4f[x]^2-4f[x]^4 > > and so on. So my own definition of "simple" is "in terms of f[x]". > > Is there a straightforward way to do this? > > My actual problem is a little harder since it involved multiple > variables and rational trigonometric polynomials, but at least > analytically I can show that it can always be rewritten in terms of > the elementary functions. The question is if Mathematica can in > principle solve such types of problems as illustrated above. > > Thanks in advance! >