type/trig - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/trig

type/trig

check for trigonometric functions

type/trigh

check for hyperbolic functions

 Calling Sequence type(expr, trig(x)) type(expr, trig) type(expr, trigh(x)) type(expr, trigh)

Parameters

 expr - any expression x - variable name

Description

 • The call type(expr, trig) returns true if expr is a function and the function name is one of the trigonometric functions:

$\mathrm{sin},\mathrm{cos},\mathrm{tan},\mathrm{sec},\mathrm{csc},\mathrm{cot},\mathrm{sinh},\mathrm{cosh},\mathrm{tanh},\mathrm{sech},\mathrm{csch},\mathrm{coth}$

 • The call type(expr, trig(x)) checks, in addition, that the argument to the trigonometric function contains the variable name x.
 • The call type(expr, trigh) returns true if expr is a function and the function name is one of the functions:

$\mathrm{sinh},\mathrm{cosh},\mathrm{tanh},\mathrm{sech},\mathrm{csch},\mathrm{coth}$

 Otherwise, it returns false.
 • The call type(expr, trigh(x)) checks, in addition, that the argument to the hyperbolic function contains the variable name x.
 • It is important to note that the type trigh is a subset of the type trig; that is, objects of type trigh are also of type trig, but the converse is not true.

Examples

 > $\mathrm{type}\left(\mathrm{sin}\left(x\right),'\mathrm{trig}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\mathrm{sin}\left(x\right),'\mathrm{trig}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{sinh}\left(x\right),'\mathrm{trigh}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\mathrm{sinh}\left(x\right),'\mathrm{trigh}'\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left({ⅇ}^{x},'\mathrm{trig}'\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left({ⅇ}^{x},'\mathrm{trigh}'\right)$
 ${\mathrm{false}}$ (6)
 > $\mathrm{type}\left(\mathrm{sin}\left(x\right)+\mathrm{cos}\left(x\right),'\mathrm{trig}'\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{type}\left(\mathrm{sin}\left(x\right)+\mathrm{cos}\left(x\right),'\mathrm{trigh}'\right)$
 ${\mathrm{false}}$ (8)
 > $\mathrm{type}\left(\mathrm{sin}\left(1\right),'\mathrm{trig}\left(x\right)'\right)$
 ${\mathrm{false}}$ (9)
 > $\mathrm{type}\left(\mathrm{sin}\left(1\right),'\mathrm{trigh}\left(x\right)'\right)$
 ${\mathrm{false}}$ (10)
 > $\mathrm{type}\left(\mathrm{tanh}\left(3x-1\right),'\mathrm{trig}\left(x\right)'\right)$
 ${\mathrm{true}}$ (11)
 > $\mathrm{type}\left(\mathrm{tanh}\left(3x-1\right),'\mathrm{trigh}\left(x\right)'\right)$
 ${\mathrm{true}}$ (12)
 > $\mathrm{type}\left(\mathrm{tan}\left(3x-1\right),'\mathrm{trigh}\left(x\right)'\right)$
 ${\mathrm{false}}$ (13)