Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

The equation $$ \sin x + \sqrt{3} \cos x = 1,$$ where $x \in [-2\pi, 2\pi]$ has four roots $-\dfrac{3\pi}{2}$, $\dfrac{\pi}{2}$, $\dfrac{\pi}{2}$ and $\dfrac{11\pi}{6}$. Sum of roots of the given equation is $\dfrac{2\pi}{3}$. How do I tell Mathematica to do that?

I tried

Solve[{Sin[x] + Sqrt[3]*Cos[x] == 1, -2*\[Pi] <= x <= 2*\[Pi]}, {x}]


edit from comment

I repaired the given equation to

Solve[{Sin[x] + Sqrt[3]Cos[x] == 1, -2[Pi] <= x <= 2*[Pi]}, {x}] 

and used

Simplify@Total[ x /. Solve[{Sin[x] + Sqrt[3] Cos[x] == 2, -2 Pi <= x <= 2 Pi}, {x}]], 

and I got the answer

-4 [Pi] + 8 ArcTan[1/(2 + Sqrt[3])].  

How do I get the answer -((5 [Pi])/3)?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

One way :

Total[Reduce[Sin[x] + Sqrt[3] Cos[x] == 1 && -2 \[Pi] <= x <= 2 \[Pi], x] /. Or -> List /. x == rhs_ -> rhs] // Simplify

(* (2 \[Pi])/3 *)
share|improve this answer
    
Thank Artes very much. –  minthao_2011 Sep 28 '12 at 8:18

To answer your added question: try FullSimplify[]:

FullSimplify @ Total[ DeleteDuplicates[ x 
      /. Solve[{Sin[x] + Sqrt[3] Cos[x] == 2, -2 Pi <= x <= 2 Pi}, {x}]]]

returns

$ \dfrac{-5 \pi}{3}$

Like Artes says you need DeleteDuplicates[] because of the multiple roots.

From the documentation:

FullSimplify[expr]
tries a wide range of transformations on expr involving elementary and special functions, and returns the simplest form it finds.

share|improve this answer

Your Answer

 
discard

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.