Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working with partial differential equations at the moment and at a point I get a trigonometric equation like this:

$$\sin^{2}(\pi x)\cos(2 \pi x)$$

Now I would like to know how I can expand this in maple into non quadratic terms (this will be useful because I can see the fourierterms by sight then instead of doing a big inverse fourier transformation)

The answer here would be:

$$-1/4-(1/4)\cdot \cos(4\pi x)+(1/2)\cdot\cos(2 \pi x)$$

I can do this by hand but I'd like to be able to do it with maple to save time. I should be possible since in my notes I see that the result was done by maple (M! above the equal sign ^^)

I tried simplify(...,trig) and expand.. But those didn't help.

share|cite|improve this question
how about combine(...,trig)? – Maesumi Jan 16 '13 at 15:14
@Maesumi thanks!! That worked! ^^ can't you post it in an answer so I can give you a correct answer reward? – Spyral Jan 16 '13 at 15:18
Maesumi's works great. Another more pedestrian one is: convert(%,exp);expand(%);simplify(%,symbolic); – GEdgar Jan 16 '13 at 15:19
up vote 2 down vote accepted

How about starting with combine(...,trig)? There are just too many ways of writing a trig expression and it is a bit hard to tell a computer algebra system like Maple to "do it this way"! Here are some more examples.

share|cite|improve this answer
Well to be honest, I know it's hard to tell it 'do it this way', but what I asked to expand it into none quadratic terms is exactly what combine(...,trig) seems to do (also looking at the other examples), so for what I asked, it actually seems to be possible to tell maple 'Do this pretty please' :D – Spyral Jan 16 '13 at 15:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.