Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Solving trig equation Mathematica repeats results

  1. Jul 13, 2013 #1


    User Avatar
    Gold Member

    I am new to Mathematica and I'm not sure if I'm using it properly but sometimes the output doesn't make sense to me. I Hope someone can help me understand or correct my usage.

    When solving trig equations Mathematica's Solve[] function gives the correct list of solutions but some of the solutions are repeated more than once. I present an example below.

    Given the simple trig equation:
    2 Sin[x]^2 + 3 Sin[x] + 1 == 0

    Find only those solutions that are in the interval zero to 2*Pi.

    There are only three solutions:
    (7 Pi)/6, (3 Pi)/2, and (11 Pi)/6

    Here is how I input the problem into Mathematica:
    Solve[{2 Sin[x]^2 + 3 Sin[x] + 1 == 0, 0 <= x <= 2 Pi}, x]

    Here is the output that Mathematica produces:
    {{x -> (7 Pi)/6}, {x -> (3 Pi)/2}, {x -> (3 Pi)/2}, {x -> (11 Pi)/6}}

    Notice that one of the solutions (3 Pi)/2 is repeated twice in the list of solutions. Why does it repeat this one solution. Why not repeat the others? Why repeat any of them? Am I doing something wrong?
  2. jcsd
  3. Jul 13, 2013 #2
    Mathematica considers it a double root. Compare with Solve[x^2 == 0, x].
  4. Jul 13, 2013 #3


    User Avatar
    Gold Member

    Thank you very much Hypersphere. You have made me aware of my need to study the concept of multiplicity and multiple roots.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook