You can use FunctionDomain
and FunctionRange
:
FunctionDomain[Tan[x], x]
1/2 + x/π ∉ Integers
FunctionRange[Tan[x],x,y]
True
FunctionRange[Sin[x], x, y]
-1 <= y <= 1
Update on questions in comments:
- how the answer $1/2 + x/π ∉ \mathbb{Z}$ is related to the right result $ x ≠ π / 2 + k π $?
The two expressions are equivalent: Move $\Pi/2$$\pi/2$ to the lhs and divide both sides of the second expression by $\Pi$$\pi$ to get $ x/π - 1/2 ≠ k $ ($k$ integer).
- Why does Mathematica return the first expression (not the second) as the answer?
The first one is simpler by LeafCount
:
1/2 + x/π ∉ Integers // LeafCount
11
ForAll[k, Element[k, Integers], x != k + π/2] // LeafCount
14