TransWikia.com

How to ask Mathematica to give NumberLinePlot of $sin x$ for non-integer $x$?

Mathematica Asked on May 6, 2021

How to ask Mathematica to give NumberLinePlot of $sin x$ on domain $xin(0,30)notinmathbb{N}$. I need solution for non-integer $x$

NumberLinePlot[{Sin[x] < 0, Sin[x] >= 0}, {x, 0, 30}]

2 Answers

You could include an additional predicate:

NumberLinePlot[
    {
    Sin[x] < 0 && Mod[x, 1] != 0, 
    Sin[x] >= 0 && Mod[x, 1] != 0
    },
    {x, 0, 30}
]

enter image description here

Correct answer by Carl Woll on May 6, 2021

positiveSol = 
 x /. Solve[
   Sin[x] > 0 && 0 < x < 30 && x ∈ PositiveIntegers]
negativeSol = 
 x /. Solve[
   Sin[x] < 0 && 0 < x < 30 && x ∈ PositiveIntegers]
NumberLinePlot[! AnyTrue[positiveSol, EqualTo[x]], {x, 0, 30}]
NumberLinePlot[! AnyTrue[negativeSol, EqualTo[x]], {x, 0, 30}]

enter image description here enter image description here

Answered by cvgmt on May 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP