Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

The equation

$$3\sin^2 x - 3\cos x -6\sin x + 2\sin 2x + 3=0$$

has a solution $x = 0$. That means it has a factor of $\cos x - 1$. I tried to write the given equation has the form

$$(\cos x - 1)P(x)=0.$$

I am looking for the factor $P(x)$. How can I get Mathematica to find it?

share|improve this question
TrigFactor[3 Sin[x]^2 - 3 Cos[x] - 6 Sin[x] + 2 Sin[2 x] + 3] gives the output -2 Sqrt[2] Sin[\[Pi]/4 - x/2] (Cos[x/2] - 3 Sin[x/2]) (2 Cos[x/2] - Sin[x/2]) Sin[x/2]. This has an overall factor Sin[x/2] which gives your x = 0 solution. – Stephen Luttrell Mar 31 '13 at 15:11
up vote 3 down vote accepted

Because $$ 3\sin^2 x - 3\cos x -6\sin x + 2\sin 2x + 3 = (\cos x - 1)P(x)$$ then $$ P(x) = \frac{3\sin^2 x - 3\cos x -6\sin x + 2\sin 2x + 3}{\cos x - 1} $$ I think you can just simplify this expression in Mathematica:

 3 - 3 Cos[x] - 6 Sin[x] + 3 Sin[x]^2 + 2 Sin[2 x])/(-1 + Cos[x])]

-6 - 3 Cos[x] + 2 Cot[x/2] + 4 Sin[x]

then $$P(x)=-6 - 3 \cos x + 2 \cot \frac{x}{2} + 4 \sin x $$

share|improve this answer
Sorry I find my answer is error... but I don't know how to delete it – Ai Xin Mar 31 '13 at 4:06
I don't think your answer is wrong. It's the question that's inaccurate. The stated factor isn't really a factor, in the sense that one can't convert the equation to a polynomial such that the variable $z = \cos x-1$ is a factor. And your answer shows this, I think. I edited your answer to format the code. – Jens Mar 31 '13 at 4:09
The reason why I think I am wrong is that (cos(x)-1)*P(x) is not strictly equal to the original expression---when I divided the original expression by (cos(x)-1) ,I ignore the case that (cos(x)-1) may be zero.So when x=0,(cos(x)-1)*P(x) is meaningless,for P(x) contain cot(x/2) and cot(0) is meaningless.(however, when x approaches to 0, the limit of (cos(x)-1)*P(x) is 0 ) – Ai Xin Mar 31 '13 at 12:06

enter image description here

Example how to factor a trigonometric expression

share|improve this answer

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.