Trigonometric Functions
Although the commands discussed in the previous section may be applied to
trigonometric functions, doing so does not take advantage of the simplification
offered by trigonometric identities. To incorporate these into the calculation, the
option Trig→True must be set. (The default is Trig→False for all but the Simplify
command.) The following examples show the difference.
EXAMPLES
Sin[x]
Input: Cancel[ ]
1 – 𝐶𝑜𝑠[𝑥]2
Sin[x]
Output:
1 – 𝐶𝑜𝑠[𝑥]2
Sin[x]
Input: Cancel [ , Trig → True ]
1 – 𝐶𝑜𝑠[𝑥]2
Output: Csc[x]
EXAMPLES
𝐶𝑜𝑠[𝑥]2 𝑆𝑖𝑛[𝑥]2
Input: Together [ 2
+ ]
1−𝑆𝑖𝑛[𝑥] 1−𝐶𝑜𝑠[𝑥]2
𝐶𝑜𝑠[𝑥]2 −𝐶𝑜𝑠[𝑥]4 +𝑆𝑖𝑛[𝑥]2 −𝑆𝑖𝑛[𝑥]4
Output:
(−1+𝐶𝑜𝑠[𝑥]2 )(−1+𝑆𝑖𝑛[𝑥]2 )
𝐶𝑜𝑠[𝑥]2 𝑆𝑖𝑛[𝑥]2
Input: Together [ 2
+ , 𝑇𝑟𝑖𝑔 → 𝑇𝑟𝑢𝑒]
1−𝑆𝑖𝑛[𝑥] 1−𝐶𝑜𝑠[𝑥]2
Output: 2
𝐓𝐫𝐢𝐠 → 𝐓𝐫𝐮𝐞 applies to hyperbolic as well as circular functions.
Input: Expand[(𝐶𝑜𝑠ℎ[𝑥]2 + 𝑆𝑖𝑛ℎ[𝑥]2 )(𝐶𝑜𝑠ℎ[𝑥]2 – 𝑆𝑖𝑛ℎ[𝑥]2 )]
Output: 𝐶𝑜𝑠ℎ[𝑥]4 – 𝑆𝑖𝑛ℎ[𝑥]4
Input: Expand[(𝐶𝑜𝑠ℎ[𝑥]2 + 𝑆𝑖𝑛ℎ[𝑥]2 )(𝐶𝑜𝑠ℎ[𝑥]2 – 𝑆𝑖𝑛ℎ[𝑥]2 ), 𝑇𝑟𝑖𝑔 → 𝑇𝑟𝑢𝑒]
Output: 𝐶𝑜𝑠ℎ[𝑥]2 + 𝑆𝑖𝑛ℎ[𝑥]2
To allow additional manipulation of trigonometric expressions, Mathematica offers
the following specialized commands, which apply to both circular and hyperbolic
functions:
✓ TrigExpand[expression] expands expression, splitting up sums and multiples
that appear in arguments of trigonometric functions and expanding out
products of trigonometric functions into sums and powers, taking advantage
of trigonometric identities whenever possible.
✓ TrigReduce[expression] rewrites products and powers of trig functions in
expression as trigonometric expressions with combined arguments, reducing
expression to a linear trig function (i.e., without powers or products).
✓ TrigFactor [expression] converts expression into a factored expression of
trigonometric functions of a single argument.
The next example shows the difference between Expand and TrigExpand.
EXAMPLES
Input: Expand[(Sin[x] + Cos[x])^2]
Output: 𝐶𝑜𝑠[𝑥]2 + 2 𝐶𝑜𝑠[𝑥] 𝑆𝑖𝑛[𝑥] + 𝑆𝑖𝑛[𝑥]2
Input: TrigExpand [(Sin[x] + Cos[x])^2]
Output: 1 + 2 𝐶𝑜𝑠[𝑥] 𝑆𝑖𝑛[𝑥]
EXAMPLES
Input: TrigExpand[Sin[x + y]]
Output: 𝐶𝑜𝑠[𝑦] 𝑆𝑖𝑛[𝑥] + 𝐶𝑜𝑠[𝑥] 𝑆𝑖𝑛[𝑦]
Input: TrigExpand[Sin[2 x]]
Output: 2 𝐶𝑜𝑠[𝑥] 𝑆𝑖𝑛[𝑥]
Input: TrigExpand[Sin[2 x + y]]
Output: 2 𝐶𝑜𝑠[𝑥] 𝐶𝑜𝑠[𝑦] 𝑆𝑖𝑛[𝑥] + 𝐶𝑜𝑠[𝑥]2 𝑆𝑖𝑛[𝑦] – 𝑆𝑖𝑛[𝑥]2 𝑆𝑖𝑛[𝑦]
TrigExpand can also be applied to hyperbolic functions.
EXAMPLES
Input: TrigExpand[Cosh[x + y]]
Output: 𝐶𝑜𝑠ℎ[𝑥] 𝐶𝑜𝑠ℎ[𝑦] + 𝑆𝑖𝑛ℎ[𝑥] 𝑆𝑖𝑛ℎ[𝑦]
EXAMPLES
TrigReduce rewrites the original
Input: TrigReduce[Sin[2 x]^2 + Sin[x] Cos[3 x]^3] expression as a linear trig expression.
1
Output: (4 – 4 𝐶𝑜𝑠[4𝑥]– 3 𝑆𝑖𝑛[2𝑥] + 3 𝑆𝑖𝑛[4𝑥]– 𝑆𝑖𝑛[8𝑥] + 𝑆𝑖𝑛[10𝑥])
8
Input: TrigReduce[Sinh[2 x]^2 + Sinh[x] Cosh[3 x]^3]
1
Output: (– 4 + 4 𝐶𝑜𝑠ℎ[4𝑥]– 3 𝑆𝑖𝑛ℎ[2𝑥] + 3 𝑆𝑖𝑛ℎ[4𝑥]– 𝑆𝑖𝑛ℎ[8𝑥] +
8
𝑆𝑖𝑛ℎ[10𝑥])
The next example shows the difference between TrigFactor and TrigReduce.
Notice that TrigFactor writes the expression as a product, while TrigReduce writes
the expression as a sum of linear trig functions.
EXAMPLES
expression = 24 Sin[x]^2 Cos[x]^2 + 16 Cos[x]^4;
Input: TrigFactor[expression]
Output: – 4 𝐶𝑜𝑠[𝑥]2 (– 5 + 𝐶𝑜𝑠[2 𝑥])
Input: TrigReduce[expression]
Output: 9 + 8 𝐶𝑜𝑠[2 𝑥] – 𝐶𝑜𝑠[4 𝑥]
The Solve command can be used to solve trigonometric equations. However,
because only principal values of inverse trigonometric functions are returned, not
all solutions will be obtained.
Since trigonometric and hyperbolic functions can be represented in terms of
exponential functions (complex exponentials in the case of circular trig functions),
Mathematica offers two conversion functions:
✓ TrigToExp[expression] converts trigonometric and hyperbolic functions to
exponential form.
✓ ExpToTrig[expression] converts exponential functions to trigonometric
and/or hyperbolic functions.
TrigToExp and ExpToTrig may also be used to convert inverse trigonometric and
hyperbolic functions.
EXAMPLES
Input: TrigToExp[Cos[x]]
𝑒 −𝑖𝑥 𝑒 𝑖𝑥
Output: +
2 2
Input: TrigToExp[Sinh[x]]
𝑒 −𝑥 𝑒𝑥
Output: − +
2 2
ExpToTrig[Exp[x]]
𝐶𝑜𝑠ℎ[𝑥] + 𝑆𝑖𝑛ℎ[𝑥]
ExpToTrig[Exp[I x]]
𝐶𝑜𝑠[𝑥] + 𝑖𝑆𝑖𝑛[𝑥]