Message Boards Message Boards

0
|
5952 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solve Function on a Specific Interval

Posted 3 years ago

In order to get the exact answer using the Solve[] function, it would be useful to enter the specific interval. For example in calculating the values of x in the Solve function

Solve[2 Sin[x]^2 - Sin[x] - 1 == 0, x, Reals]

I would like the answer on the interval from 0 to 2 Pi.

Without the ability to enter the desired interval, I get the answer of:

{{x -> ConditionalExpression[-(\[Pi]/6) + 2 \[Pi] C[1], 
    C[1] \[Element] Integers]}, {x -> 
   ConditionalExpression[\[Pi]/2 + 2 \[Pi] C[1], 
    C[1] \[Element] Integers]}, {x -> 
   ConditionalExpression[(7 \[Pi])/6 + 2 \[Pi] C[1], 
    C[1] \[Element] Integers]}}

Which is not exactly correct since answer #1 is less than 0 and the answer for 2 pi (11pi/6) is not listed.

Thanks,

Mitch Sandlin

Attachments:
POSTED BY: Mitchell Sandlin
2 Replies
Posted 3 years ago

Hi Mitchell,

One way

Solve[2 Sin[x]^2 - Sin[x] - 1 == 0 && 0 < x < 2 Pi, x, Reals] // DeleteDuplicates
(* {{x -> π/2}, {x -> (7 π)/6}, {x -> (11 π)/6}} *)
POSTED BY: Rohit Namjoshi

Thanks so much. I also found that Reduce[] works real well also. Additionally you do not need to suffix // DeleteDuplicates to the Reduce[] expression.

Thanks again,

Mitch Sandlin

POSTED BY: Mitchell Sandlin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract