<<

Introductions to Cos Introduction to the

General

The six trigonometric functions sin z , cosine cos z , tangent tan z , cotangent cot z , cosecant csc z , and secant sec z are well known and among the most frequently used elementary functions. The most popular func- tions sin z , cos z , tan z , and cot z are taught worldwide in high school programs because of their natural appear- H L H L H L H L H L ance in problems involving angle measurement and their wide applications in the quantitative sciences. H L The trigonometricH L H L functionsH L shareH manyL common properties.

Definitions of trigonometric functions

All trigonometric functions can be defined as simple rational functions of the exponential of ä z:

ãä z - ã-ä z sin z Š 2 ä ãä z + ã-ä z cos z Š H L 2 ä ãä z - ã-ä z tanHzL Š - ãä z + ã-ä z ä ãIä z + ã-ä z M cotHzL Š ãä z - ã-ä z I 2 ä M cscHzL Š ãä z - ã-ä z 2 secHzL Š . ãä z + ã-ä z

TheH Lfunctions tan z , cot z , csc z , and sec z can also be defined through the functions sin z and cos z using the following formulas:

sin z H L H L H L H L H L H L tan z Š cos z cos z cot z Š H L H L sin z H L 1 csc z Š H L H L sin z H L 1 sec z Š . H L cos z H L

A quickH L look at the trigonometric functions H L http://functions.wolfram.com 2

Here is a quick look at the graphics for the six trigonometric functions along the real axis.

3 2 1 sin x cos x f 0 -1 tan x H L -2 cot x H L -3 sec x -3 Π -2 Π -Π 0 Π 2 Π 3 Π cscHxL x H L H L Connections within the group of trigonometric functions andH Lwith other function groups

Representations through more general functions

The trigonometric functions are particular cases of more general functions. Among these more general functions, four different classes of special functions are particularly relevant: Bessel, Jacobi, Mathieu, and hypergeometric functions.

For example, sin z and cos z have the following representations through Bessel, Mathieu, and hypergeometric functions:

H L H L sin z Š Π z J z sin z Š -ä Π ä z I ä z sin z Š Π z Y z sin z Š ä ä z K ä z - -ä z K -ä z 2 1 2 2 1 2 2 -1 2 1 2 1 2 2 Π

     cos z Š Π z J z cos z Š Π ä z I ä z cos z Š - Π z Y z cos z Š ä z K ä z + - ä z K -ä z H L 2 -1 2H L H L 2 -1 2 H L H L 2 1 2H L H L I2 Π 1 2 H L 2 Π 1 2 H LN

sin z Š Se 1, 0, z  cos z Š Ce 1, 0, z     H L H L H L H L H L H L H L H L H L

3 z2 1 z2 sin z Š z 0F1 ; ; - cos z Š 0F1 ; ; - . H L H 2 L 4 H L H L 2 4 On the other hand, all trigonometric functions can be represented as degenerate cases of the corresponding doubly periodicH L JacobiJ ellipticN functionsH L whenJ theirN second parameter is equal to 0 or 1:

sin z Š sd z 0 Š sn z 0 sin z Š -ä sc ä z 1 Š -ä sd ä z 1 cos z Š cd z 0 Š cn z 0 cos z Š nc ä z 1 Š nd ä z 1 tan z Š sc z 0 tan z Š -ä sn ä z 1 cotHzL Š csHz È 0L H È L cotHzL Š ä ns äHz 1È L H È L cscHzL Š dsHz È 0L Š ns Hz È0 L cscHzL Š ä csH ä zÈ 1L Š ä dsH äÈz L1 secHzL Š dcH zÈ 0L Š nc z 0 secHzL Š cn ä zH 1È ŠL dn ä z 1 . H L H È L H L H È L RepresentationsH L H È L throughH È L relatedH L equivalentH È L functionsH È L H L H È L H È L H L H È L H È L Each of the six trigonometric functions can be represented through the corresponding hyperbolic function:

sin z Š -ä sinh ä z sin ä z Š ä sinh z cos z Š cosh ä z cos ä z Š cosh z tan z Š -ä tanh ä z tan ä z Š ä tanh z cotHzL Š ä coth äHz L cotHä zL Š -ä cothH Lz cscHzL Š ä cschH ä zL cscHä zL Š -ä cschH L z secHzL Š sech ä zH L secHä zL Š sech Hz L. H L H L H L H L RelationsH L to HinverseL functionsH L H L H L H L H L H L http://functions.wolfram.com 3

Each of the six trigonometric functions is connected with its corresponding inverse trigonometric function by two formulas. One is a simple formula, and the other is much more complicated because of the multivalued nature of the inverse function:

sin sin-1 z Š z sin-1 sin z Š z ; - Π < Re z < Π Re z Š - Π Im z ³ 0 Re z Š Π Im z £ 0 2 2 2 2 cos cos-1 z Š z cos-1 cos z Š z ; 0 < Re z < Π Re z Š 0 Im z ³ 0 Re z Š Π Im z £ 0 tan tan-1 z Š z tan-1 tan z Š z ; Re z < Π Re z Š - Π Im z < 0 Re z Š Π Im z > 0 I H LM H H LL  H2L ë H L 2 í H L ë H 2L í H L cotIcot-1 Hz LMŠ z cot-1 Hcot Hz LLŠ z ; Re z

I H LM H H LL  H L¤ ë H L í H L ë H L í H L Representations through other trigonometric functions I H LM H H LL  H L Þ H L ß H L Þ H L ß H L Each of the six trigonometric functions can be represented by any other trigonometric function as a rational func- tion of that function with linear arguments. For example, the sine function can be representative as a group-defining function because the other five functions can be expressed as follows:

cos z Š sin Π - z cos2 z Š 1 - sin2 z 2 2 sin z sin z 2 sin z tan z Š Š Π tan z Š cos z sin -z 1-sin2 z 2 H L I M Π H L H L H L sin H-Lz H2 L cos z 2 2 1-sin z cot z Š H L Š J N cot z Š H L H L sin z sin z H L sin2 z 1 1 csc z Š H L J N csc2 z Š H L sin z 2 H L H L sin z H L H L H L sec z Š 1 Š 1 sec2 z Š 1 . cos z Π 2 H L sin -z 1-sin z H L 2 H L H L

All six trigonometricH L functions can beH L transformed into any other trigonometric function of this group if the H L J N H L argument z is replaced by p Π 2 + q z with q2 Š 1 p Î Z:

sin -z - 2 Π Š -sin z sin z - 2 Π Š sin z sin -z - 3 Π Š cos z sin z - 3 Π Š cos z ì 2 2 sinH-z - Π ŠL sin z H L sinHz - Π ŠL -sinH zL sin -z - Π Š -cos z sin z - Π Š -cos z J 2 N H L J 2 N H L sin z + Π Š cos z sin Π - z Š cos z H 2 L H L H 2 L H L sinIz + Π ŠM -sin z H L sinIΠ - z MŠ sin z H L sin z + 3 Π Š -cos z sin 3 Π - z Š -cos z I 2M H L I 2 M H L sinHz + 2LΠ Š sin Hz L sinH2 Π -Lz Š -HsinL z J N H L J N H L H L H L H L H L http://functions.wolfram.com 4

cos -z - 2 Π Š cos z cos z - 2 Π Š cos z cos -z - 3 Π Š sin z cos z - 3 Π Š -sin z 2 2 cosH-z - Π ŠL -cosHzL cos Hz - Π ŠL -cos HzL cos -z - Π Š -sin z cos z - Π Š sin z J 2 N H L J 2 N H L cos z + Π Š -sin z cos Π - z Š sin z H 2 L H L H 2 L H L cosIz + Π ŠM -cos zH L cosIΠ - z MŠ -cosH L z cos z + 3 Π Š sin z cos 3 Π - z Š -sin z I 2M H L I 2 M H L cosHz + 2LΠ Š cos Hz L cosH2 Π -Lz Š cos Hz L

tanJ-z - ΠN Š -tanH L z tan Jz - Π ŠN tan z H L tanH-z - Π L Š cotHzL tan zH - Π ŠL -cot Hz L 2 2 tan z + Π Š -cot z tan Π - z Š cot z H 2 L H L H2 L H L tanIz + Π ŠM tan zH L tanI Π - zM Š -tanHzL cotI-z - MΠ Š -cotH Lz cotI z - ΠM Š cotHzL cotH-z -LΠ Š tanH Lz cot Hz - Π L Š -tan H zL 2 2 cot z + Π Š -tan z cot Π - z Š tan z H 2 L H L H2 L H L cotIz + Π ŠM cot zH L cotIΠ - z MŠ -cot Hz L cscI-z -M2 Π Š -HcscL z cscI z -M2 Π ŠHcscL z cscH-z -L3 Π ŠHsecL z cscH z -L 3 Π Š secH L z 2 2 cscH-z - Π ŠL csc z H L csc Hz - Π ŠL -csc HzL csc -z - Π Š -sec z csc z - Π Š -sec z J 2 N H L J 2 N H L csc z + Π Š sec z csc Π - z Š sec z H 2 L H L H 2 L H L cscIz + Π ŠM -csc zH L cscIΠ - z MŠ csc zH L csc z + 3 Π Š -sec z csc 3 Π - z Š -sec z I 2M H L I 2 M H L cscHz + 2LΠ Š csc Hz L csc H2 Π -Lz Š -cscH L z

secJ-z - 2NΠ Š secHzL sec zJ - 2 Π NŠ sec z H L secH-z - 3LΠ Š cscH Lz sec zH- 3 Π ŠL -csc zH L 2 2 secH-z - Π ŠL -secHzL sec Hz - Π ŠL -sec HzL sec -z - Π Š -csc z sec z - Π Š csc z J 2 N H L J 2 N H L sec z + Π Š -csc z sec Π - z Š csc z H 2 L H L H 2 L H L secIz + Π ŠM -sec zH L secIΠ - z MŠ -secH Lz sec z + 3 Π Š csc z sec 3 Π - z Š -csc z I 2M H L I 2 M H L secHz + 2LΠ Š sec Hz L sec H2 Π -Lz Š sec Hz L. J N H L J N H L The best-known properties and formulas for trigonometric functions H L H L H L H L Real values for real arguments

For real values of argument z, the values of all the trigonometric functions are real (or ). http://functions.wolfram.com 5

In the points z = 2 Π n m ; n Î Z m Î Z, the values of trigonometric functions are algebraic. In several cases they can even be rational numbers or integers (like sin Π 2 = 1 or sin Π 6 = 1 2). The values of trigonometric functions can be expressed using only square roots if n Î Z and m is a product of a power of 2 and distinct Fermat   ì primes {3, 5, 17, 257, …}. H  L H  L  Simple values at zero

All trigonometric functions have rather simple values for arguments z Š 0 and z Š Π 2:

sin 0 Š 0 sin Π Š 1 2 cos 0 Š 1 cos Π Š 0  2 Π Ž tan 0 Š 0 tan Š ¥ H L I 2 M Ž Π cot 0 Š ¥ cot Š 0 H L I2 M Ž Π csc 0 Š ¥ csc Š 1 H L I 2 M Π Ž sec 0 Š 1 sec Š ¥. H L I 2 M H L I M Analyticity H L I M All trigonometric functions are defined for all complex values of z, and they are analytical functions of z over the whole complex z-plane and do not have branch cuts or branch points. The two functions sin z and cos z are entire Ž functions with an essential singular point at z = ¥. All other trigonometric functions are meromorphic functions with simple poles at points z Š Π k ; k Î Z for csc z and cot z , and at points z Š Π 2 + Π k ; k Î Z for sec z and H L H L tan z .

Periodicity  H L H L   H L H L All trigonometric functions are periodic functions with a real period (2 Π or Π):

sin z Š sin z + 2 Π sin z + 2 Π k Š sin z ; k Î Z cos z Š cos z + 2 Π cos z + 2 Π k Š cos z ; k Î Z tan z Š tan z + Π tan z + Π k Š tan z ; k Î Z cotHzL Š cotHz + Π L cotHz + Π k ŠL cot zH L;k Î Z cscHzL Š cscHz + 2 ΠL cscHz + 2 Π kL Š cscHzL ; k Î Z secHzL Š secHz + 2LΠ secHz + 2 ΠLk Š secH Lz ; k Î Z. H L H L H L H L  ParityH L andH symmetryL H L H L  H L H L H L H L  All trigonometric functions have parity (either odd or even) and mirror symmetry:

 sin -z Š -sin z sin z Š sin z  cos -z Š cos z cos z Š cos z  tan -z Š -tan z tan z Š tan z H L H L HL H L cot -z Š -cot z cot z Š cot z H L H L HL H L csc -z Š -csc z csc z Š csc z H L H L HL H L sec -z Š sec z sec z Š sec z . H L H L H L H L SimpleH L representationsH L H L of derivativesH L H L H L H L H L http://functions.wolfram.com 6

The of all trigonometric functions have simple representations that can be expressed through other trigonometric functions:

¶sin z Š cos z ¶cos z Š -sin z ¶tan z Š sec2 z ¶z ¶z ¶z ¶cot z 2 ¶csc z ¶sec z H L Š -csc z H L Š -cot z csc z H L Š sec z tan z . ¶z ¶z ¶z H L H L H L H L H L H L Simple differential equations H L H L H L H L H L The solutions of the simplest second-order linear ordinary with constant coefficients can be represented through sin z and cos z :

w¢¢ z + w z Š 0 ; w z Š cos z w 0 Š 1 w¢ 0 Š 0 ¢¢ ¢ w z + w z Š 0 ; w z ŠH sinL z wH0L Š 0 w 0 Š 1 ¢¢ w z + w z Š 0 ; w z Š c1 cos z + c2 sin z . H L H L  H L H L ì H L ì H L AllH sixL trigonometricH L  H LfunctionsH L ì satisfyH L first-orderì H L nonlinear differential equations: H L H L  H L H L H L w¢ z - 1 - w z 2 Š 0 ; w z Š sin z w 0 Š 0 Re z < Π 2

w¢ z - 1 - w z 2 Š 0 ; w z Š cos z w 0 Š 1 Re z < Π 2 w¢HzL - w z 2 -H 1HŠLL0 ; w z ŠHtanL z HwL0íŠ 0H L í H L¤ w¢ z + w z 2 + 1 Š 0 ; w z Š cot z w Π Š 0 H L H H LL  H L H L í2 H L í H L¤ ¢ 2 4 2 w H zL - wH Lz + w z Š 0H L; w z ŠH Lcscß zH L ¢ 2 4 2 w HzL - wH Lz + w z Š 0H L; w z ŠH Lsecíz .I M H L H L H L  H L H L Applications of trigonometric functions H L H L H L  H L H L Triangle theorems

The prime application of the trigonometric functions are triangle theorems. In a triangle, a, b, and c represent the lengths of the sides opposite to the angles, D the area , R the circumradius, and r the inradius. Then the following identities hold:

Α + Β + Γ Š Π sin Α sin Β sin Γ Š Š a b c

sin HΑ L sin Β sinH LΓ Š HD L sin Α Š 2 D 2 R2 b c 2 2 2 2 2 2 cos Α Š b +c -a cot Α Š b +c -a 2 b c 4 D H L H ΒL H ΓL H L sin Α sin sin Š r cos Α + cos Β + cos Γ Š 1 + r 2 2 2 4 R R H L H L

I M J N I M H L H L H L http://functions.wolfram.com 7

a2 + b2 + c2 cot Α + cot Β + cot Γ Š 4 D tan Α + tan Β + tan Γ Š tan Α tan Β tan Γ cotHΑL cot ΒH +L cot ΑH cotL Γ + cot Β cot Γ Š 1 cos2 Α + cos2 Β + cos2 Γ Š 1 - 2 cos Α cos Β cos Γ H L H L H L H L H L H L Β tan Α tan H L2 H L2 H rL H L H L H L Š . H L ΒH L H L H L H L H L tan Α + tan c 2 2 I M J N For a right-angle triangle the following relations hold: I M J N sin Α Š a ; Γ Š Π cos Α Š b ; Γ Š Π c 2 c 2 tan Α Š a ; Γ Š Π cot Α Š b ; Γ Š Π b 2 a 2 cscHΑL Š c ; Γ Š Π sec HΑ LŠ c ; Γ Š Π . a 2 b 2 H L  H L  Other applications H L  H L  Because the trigonometric functions appear virtually everywhere in quantitative sciences, it is impossible to list their numerous applications in teaching, science, engineering, and art.

Introduction to the Cosine Function

Defining the cosine function

The cosine function is one of the oldest mathematical functions. It was first used in ancient Egypt in the book of Ahmes (c. 2000 B.C.). Much later F. Viète (1590) evaluated some values of cos n z , E. Gunter (1636) introduced the notation "Cosi" and the word "cosinus" (replacing "complementi sinus"), and I. Newton (1658, 1665) found the expansion for cos z . H L The classical definition of the cosine function for real arguments is: "the cosine of an angle Α in a right-angle triangle is the ratio of theH L length of the adjacent leg to the length of the hypotenuse." This description of cos Α is valid for 0 < Α < Π 2 when the triangle is nondegenerate. This approach to the cosine can be expanded to arbitrary real values of Α if consideration is given to the arbitrary point x, y in the x,y-Cartesian plane and cos Α is defined H L 2 2 1 2 as the ratio x x + y , assuming that Α is the value of the angle between the positive direction of the x-axis and

the direction from the origin to the point x, y . 8 < H L ’ I M The following formula can also be used as a definition of the cosine function: 8 < z2 z4 ¥ -1 k z2 k cos z Š 1 - + - ¼ Š . 2 24 k=0 2 k ! H L ThisH Lseries converges for allâ finite numbers z. H L A quick look at the cosine function http://functions.wolfram.com 8

Here is a graphic of the cosine function f x = cos x for real values of its argument x.

2

H L H L

1

f 0

-1

-2 -3 Π -2 Π -Π 0 Π 2 Π 3 Π x

Representation through more general functions

The function cos z is a particular case of more complicated mathematical functions. For example, it is a special 2 case of the generalized F ; a; w with the parameter a Š 1 at w Š - z : 0 1 2 4 H L 1 z2 cos z Š 0F1 ; ; - . 2 4 H L

It isH alsoL a particular case of the J z with the parameter Ν Š - 1 , multiplied by Π z : Ν 2 2

Π z cos z Š J 1 z . - H L 2 2

Other Bessel functions can also be expressed through cosine functions for similar values of the parameter: H L H L

Π ä z Π z 1 cos z Š I 1 ä z cos z Š - Y 1 z cos z Š ä z K 1 ä z + -ä z K 1 -ä z . 2 - 2 2 2 2 Π 2 2

StruveH L functions canH alsoL degenerateH L into theH L cosineH L function for similarH L values of theH parameter:L

Π z Π ä z cos z Š 1 - H 1 z cos z Š 1 + L 1 ä z . 2 2 2 2

But the function cos z is also a degenerate case of the doubly periodic Jacobi elliptic functions when their second H L H L H L H L parameter is equal to 0 or 1:

cos z Š cd z 0 Š cnHzL 0 cos z Š nc ä z 1 Š nd ä z 1 .

Finally,H L theH functionÈ L HcosÈ Lz is the particular case of another class of functions—the Mathieu functions: H L H È L H È L cos z Š Ce 1, 0, z . H L

H L H L http://functions.wolfram.com 9

Definition of the cosine function for a complex argument

In the complex z-plane, the function cos z is defined using the ãw in the points w = ä z and w = -ä z through the formula:

ãä z + ã-ä z H L cos z Š . 2

The key role in this definition of cos z belongs to the famous Euler formula that connects the exponential, the sine, H L and the cosine functions:

ãä z Š cos z + ä sin z . H L

Changing z to -z, the Euler formula can be converted into the following modification: H L H L ã-ä z Š cos z - ä sin z .

Adding the preceding formulas gives the following result: H L H L ãä z + ã-ä z cos z Š . 2

Here are two graphics showing the real and imaginary parts of the cosine function over the . H L

10 10 5 5 Re Im 0 0 -5 2 -5 2 -10 1 -10 1 -2 Π 0 - Π 0 y 2 y -Π -1 -Π -1 0 0 -2 -2 x Π x Π 2 Π 2 Π

The best-known properties and formulas for the cosine function

Values in points

Students usually learn the following basic table of cosine function values for special points of the circle:

3 cos 0 Š 1 cos Π Š cos Π Š 1 cos Π Š 1 6 2 4 3 2 2

3 cos Π Š 0 cos 2 Π Š - 1 cos 3 Π Š - 1 cos 5 Π Š - 2 3 2 4 6 2 H L J N I M 2 J N

3 cos Π Š -1 cos 7 Π Š - cos 5 Π Š - 1 cos 4 Π Š - 1 6 2 4 3 2 I M J N J N 2 J N

3 cos 3 Π Š 0 cos 5 Π Š 1 cos 7 Π Š 1 cos 11 Π Š 2 3 2 4 6 2 H L J N J N 2 J N

J N J N J N J N http://functions.wolfram.com 10

1 cos 2 Π Š 1 cos Π m Š -1 m ; m Î Z cos Π + m Š 0 ; m Î Z . 2

General characteristics H L H L H L  J J NN  For real values of argument z, the values of cos z are real.

In the points z = 2 Π n m ; n Î Z m Î Z, the values of cos z are algebraic. In several cases they can even be rational numbers, 0, or 1. Here are some examples:H L

cos 0 Š 1 cos Π Š 1 cos Π Š 0. ì H L 3 2 2

The values of cos n Π can be expressed using only square roots if n Î Z and m is a product of a power of 2 and H L J N m I M distinct Fermat primes {3, 5, 17, 257, …}.

The function cos zI isM an entire analytical function of z that is defined over the whole complex z-plane and does not Ž have branch cuts and branch points. It has an essential singular point at z = ¥. It is a periodic function with the real period 2 Π: H L cos z + 2 Π Š cos z

cos z Š cos z + 2 Π k ; k Î Z cos z Š -1 k cos z + Π k ; k Î Z . H L H L The function cos z is an even function with mirror symmetry: H L H L  H L H L H L   cos -z Š cos z cos z Š cos z . H L Differentiation H L H L H L H L The derivatives of cos z have simple representations using either the sin z function or the cos z function:

n ¶cos z Š -sin z ¶ cos z Š cos z + Π n ; n Î N+ . ¶z ¶zn 2 H L H L H L OrdinaryH L differentialH L equation H L I M  The function cos z satisfies the simplest possible linear differential equation with constant coefficients:

w¢¢ z + w z Š 0 ; w z Š cos z w 0 Š 1 w¢ 0 Š 0. H L The complete solution of this equation can be represented as a linear combination of sin z and cos z with arbitrary H L H L  H L H L ì H L ì H L constant coefficients c1 and c2:

¢¢ w z + w z Š 0 ; w z Š c1 cos z + c2 sin z . H L H L

The function cos z also satisfies first-order nonlinear differential equations: H L H L  H L H L H L Π w¢ z - 1 - w z 2 Š 0 ; w z Š cos z w 0 Š 1 Re z < . H L 2 Series representation H L H H LL  H L H L í H L í H L The function cos z has a simple series expansion at the origin that converges in the whole complex z-plane:

H L http://functions.wolfram.com 11

z2 z4 ¥ -1 k z2 k cos z Š 1 - + - ¼ Š . 2 24 k=0 2 k !

H L ä x ForH realL z Š x this series canâ be interpreted as the real part of the series expansion for the exponential function ã : H L z2 z4 ä x 2 ä x 3 ¥ ä x k cos z Š 1 - + - ¼ Š Re 1 + ä x + + + ¼ Š Re Š Re ãä x . 2 24 2! 3! k=0 k! H L H L H L ProductH L representation â I M The following famous infinite product representation for cos z clearly illustrates that cos z Š 0 at z Š Π k - Π k Î Z: 2 H L H L ¥ 4 z2 cos z Š 1 - . í 2 2 k=1 Π 2 k - 1

IndefiniteH L ä integration H L Indefinite of expressions involving the cosine function can sometimes be expressed using elementary functions. However, special functions are frequently needed to express the results even when the integrands have a simple form (if they can be evaluated in closed form). Here are some examples:

cos z â z Š sin z

z cosH L z â z Š H2LE 2 à 2

2-v 1 - v mod 2 v Α-1 v Α à z cosH L a z â z ŠK Ì O z v - Α 2 v-1 H L à H 2 L v 2-v zΑ G Α, ä a 2 j - v z ä a 2 j - v z -Α + G Α, ä a v - 2 j z ä a v - 2 j z -Α ; Α ¹ 0 v Î N+. j fj=0v

The last integralâ cannotH H be HevaluatedL L H in Hclosed LformL usingH theH knownL classicalL H H specialL L L functions ì for arbitrary values of parameters Α and v.

Definite integration

Definite integrals that contain the cosine function are sometimes simple. For example, the famous Dirichlet type and Fresnel integrals have the following values:

¥ cos t - 1 ât Š -ý 0 t ¥ 1 Π H2L à cos t ât Š , 0 2 2

where ý is the Euler-Mascheroni constant ý Š 0.577216 ¼. à I M http://functions.wolfram.com 12

Some special functions can be used to evaluate more complicated definite integrals. For example, elliptic integrals and gamma functions are needed to express the following integrals:

Π 1 cos 2 z â z Š 2 E 2 0 Π Π Α zΑ-1 cos z â z Š cos G Α ; 0 < Re Α < 1. à0 H L H L 2

Integral transforms à H L H L  H L transforms of expressions involving the cosine function may not be classically convergent but can be interpreted in a generalized functions (distributions) sense. For example, the exponential Fourier transform of the cosine function cos z does not exist in the classical sense but can be expressed using the Dirac delta function.

Π Π Ft cos t z Š ∆ z - 1 + ∆ z + 1 . 2 H L 2

Among other integral transforms of the cosine function, the best known are the Fourier cosine and sine transforms, @ H LD H L H L H L and the Laplace, Mellin, Hilbert, and Hankel transforms:

Π Fct cos a t z Š ∆ a - z + ∆ a + z ; a Î R 2

@ H LD H L 2H H z L H LL  Fst cos a t z Š - ; a Î R Π a2 - z2 z Lt cos@ tH LzD HŠL  1 + z2 Π z M@t cosH LtD H zL Š G z cos ; 0 < Re z < 1 2

Ht cos t x Š -sin x @ H LD H L H L  H L Α-1 Ht;Ν t cos t z Š @ H1LD H L 1H L 1 1 1 1 -Ν Ν+ 2 2 z 2 cos Π 2 Α + 2 Ν + 1 G Α + Ν + 2F1 2 Α + 2 Ν + 1 , 2 Α + 2 Ν + 3 ; Ν + 1; z ; G Ν + 1 4 2 4 4 A H LE H L 1 Re Α + Ν > - Re Α < 1. 2 H L H L H L  H L Finite summation H L í H L The following finite sums from the cosine can be expressed using the trigonometric functions:

n a a n + 1 a n cos a k Š csc sin cos k=0 2 2 2

n H L â H L K O 1 K O a 1 -1 k cos a k Š cos a + n a + Π sec cos n a + Π k=0 2 2 2

âH L H L H H LL K O H L http://functions.wolfram.com 13

n a 1 a n cos a k + z Š csc sin a n + 1 cos + z k=0 2 2 2

n â H L K O 1 H L K a O 1 -1 k cos a k + z Š cos a + n a + Π sec cos n a + Π + z k=0 2 2 2

n+1 n ân H L H z cosL a n z H - cosH n a +LLa z -K zO+ cos a H L zk cos k a Š . 2 k=1 z - 2 cos a z + 1 I H L H L H LM âInfinite HsummationL H L The following infinite sums can be expressed using elementary functions:

¥ cos a k 1 1 Š log ; 0 < Re a < 2 Π k=1 k 2 2 1 - cos a

H k-1L ⥠-1 cos a k a  H L Š logH 2 cosH LL ; Re a < Π k=1 k 2

¥ H L H L â cos a k K K OO  H L¤ Š ãcos a cos sin a k=0 k! H L ¥ k H L â z cos a k H H LL Š ãz cos a cos z sin a k=0 k! H L ¥ H L â 1 - z cosH a H LL zk cos a k Š ; z < 1. 2 k=0 z - 2 cos a z + 1 H L âFinite productsH L  ¤ H L The following finite products from the cosine can be expressed using trigonometric functions:

2 n-1 k Π cos Š 21-2 n -1 n - 1 ; n Î N+ k=1 n

än-1 HH L L  2 Π k 1-n 1 1 n n + cos Š 2 2 1 - -1 + 1 + -1 n ; n Î N fk=1v n 2 2

nä-1 Π k 21-n H H L L Π H H L L  cos + z Š sin n z + ; n Î N+ k=1 n cos z 2

än-1 2 Π k  n Π cos + z Š -H2L1-n sec z cos n z - cos ; n Î N+. k=1 n 2

äInfinite products H L H L H L  The following infinite product that contains the cosine function can be expressed using the sine function: http://functions.wolfram.com 14

¥ z sin z cos Š . k k=1 2 z H L äAddition formulas The cosine of a sum can be represented by the rule: "the cosine of a sum is equal to the product of the cosines minus the product of the ." A similar rule is valid for the cosine of the difference:

cos a + b Š cos a cos b - sin a sin b cos a - b Š cos a cos b + sin a sin b .

MultipleH L argumentsH L H L H L H L H L H L H L H L H L In the case of multiple arguments z, 2 z, 3 z, …, the function cos z can be represented as the finite sum of terms that include powers of the sine and the cosine:

cos 2 z Š cos2 z - sin2 z H L

cos 3 z Š 4 cos3 z - 3 cos z H L H L H L n 2 n cosHn zL Š -1H Lk sinH L2 k z cosn-2 k z ; n Î N+. 2 k kf=0v

TheH functionL âH cosL n z can alsoH Lbe representedH L  as the finite sum including only the cosine of z:

n 2 -1 k n - k - 1 ! 2n-2 k-1 cos n z Š n H L cosn-2 k z ; n Î N+. kf=0v k! n - 2 k ! H L H L HalfH -angleL âformulas H L  H L The cosine of the half-angle can be represented by the following simple formula that is valid in some vertical strips:

z 1 + cos z cos Š ; Re z < Π Re z Š -Π Im z ³ 0 Re z Š Π Im z £ 0. 2 2

To make this formulaH L correct for all complex z, a complicated prefactor is needed: K O  H L¤ Þ H L ß H L Þ H L ß H L

Re z +Π Re z +Π Re z +Π z 1 + cos z + - cos Š c z ; c z Š -1 2 Π 1 - 1 + -1 2 Π 2 Π Θ -Im z , 2 2 H L H L H L f v f v f v where c z contains theH unitL step, real part, imaginary part, and the floor functions. K O H L  H L H L H L H H LL Sums of two direct functions H L The sum of two cosine functions can be described by the rule: "the sum of the cosines is equal to two times the cosine of the half-difference multiplied by the cosine of the half-sum." A similar rule is valid for the difference of two cosines: http://functions.wolfram.com 15

a - b a + b cos a + cos b Š 2 cos cos 2 2 a + b a - b cos a - cos b Š -2 sin sin . H L H L 2 2

Products involving the direct function H L H L The product of two cosine functions and the product of the cosine and sine have the following representations:

1 cos a cos b Š cos a - b + cos a + b 2 1 cos a sin b Š sin b - a + sin a + b . H L H L 2 H H L H LL

Powers of the direct function H L H L H H L H LL The integer powers of the cosine functions can be expanded as finite sums of cosine functions with multiple arguments. These sums include binomial coefficients:

n-1 n 2 n -n 1-n n + cos z Š 2 n 1 - n mod 2 + 2 cos n - 2 k z ; n Î N . k 2 fk=0v

IneqHuLalities H L â HH L L  The best-known inequalities for cosine functions are the following:

cos x £ 1 ; x Î R

sin x cos x < ; 0 < x < 4.493409. H L¤ x

Relations withH L its inverse function H L  There are simple relations between the function cos z and its inverse function cos-1 z :

cos-1 cos z Š z cos-1 cos z Š z ; 0 < Re z < Π Re z Š 0 Im z ³ 0 Re z Š Π Im z £ 0. H L H L The second formula is valid at least in the vertical strip 0 < Re z < Π. Outside of this strip, a much more compli- catedH relationH LL (that containsH H LtheL unit step, HrealL part,Þ andH L the floorß H functions)L Þ H holds:L ß H L

Re z Re z Re z Re z Π - - + - H L Re z cos-1 cos z Š 1 - -1 Π + -1 Π 1 + -1 Π Π Θ Im z - 1 z + Π - . 2 H L H L H L H L Π f v f v f v f v Representations through other trigonometric functions H L H H LL H L H L H L H H LL Cosine and sine functions are connected by a very simple formula including the linear function in the argument:

Π cos z Š sin - z . 2

Another famous formula, connecting cos z and sin z , is shown in the well-known Pythagorean theorem: H L

H L H L http://functions.wolfram.com 16

cos2 z Š 1 - sin2 z

Π Π Π cos z Š 1 - sin2 z ; Re z < Re z Š - Im z ³ 0 Re z Š Im z £ 0. H L H L 2 2 2

The last restriction on z can be removed, but the formula will get a complicated coefficient c z with c z Š 1, that H L H L  H L¤ ë H L í H L ë H L í H L contains the unit step, real part, imaginary part, and the floor function:

1 Re z Re z 1 1 Re z 2 - - + - H L H L¤ cos z Š c z 1 - sin z ; c z Š -1 2 Π 1 - 1 + -1 Π 2 2 Π Θ Im z . H L H L H L f v f v f v The cosine function can also be represented using other trigonometric functions by the following formulas: H L H L H L  H L H L H L H H LL

z z 1-tan2 cot2 -1 2 2 cos z Š z cos z Š z 1+tan2 cot2 +1 2 2 J N J N 1 1 J N J N cos z Š Π cos z Š . H L csc -z H L sec z 2

Representations through hyperbolicH L functions H L J N H L The cosine function has representations using the :

cos z Š cosh ä z cos ä z Š cosh z cos z Š -ä sinh Π ä - ä z 2

z ä ä z 1+tanh2 coth2 +1 2 2 ä 1 cosHzL Š H zLä cosH zL Š Hä z L cosH L z Š - J Π ä Ncos z Š . 1-tanh2 coth2 -1 csch -ä z sech ä z 2 2 2 J N J N H L ApplicationsH L J N H L J N H L J N H L The cosine function is used throughout mathematics, the exact sciences, and engineering.

Introduction to the Trigonometric Functions in Mathematica

Overview

The following shows how the six trigonometric functions are realized in Mathematica. Examples of evaluating Mathematica functions applied to various numeric and exact expressions that involve the trigonometric functions or return them are shown. These involve numeric and symbolic calculations and plots.

Notations

Mathematica forms of notations

All six trigonometric functions are represented as built-in functions in Mathematica. Following Mathematica's general naming convention, the StandardForm function names are simply capitalized versions of the traditional mathematics names. Here is a list trigFunctions of the six trigonometric functions in StandardForm.

trigFunctions = Sin z , Cos z , Tan z , Cot z , Sec z , Cos z

Sin z , Cos z , Tan z , Cot z , Sec z , Cos z 8 @ D @ D @ D @ D @ D @ D<

8 @ D @ D @ D @ D @ D @ D< http://functions.wolfram.com 17

Here is a list trigFunctions of the six trigonometric functions in TraditionalForm.

trigFunctions TraditionalForm

sin z , cos z , tan z , cot z , sec z , cos z  Additional forms of notations 8 H L H L H L H L H L H L< Mathematica also knows the most popular forms of notations for the trigonometric functions that are used in other programming languages. Here are three examples: CForm, TeXForm, and FortranForm.

trigFunctions . z ® 2 Π z CForm ž ð &

Sin 2 * Pi * z , Cos 2 * Pi * z , Tan 2 * Pi * z , Cot 2 * Pi * z , Sec8 2 * Pi<*z ,H Cos 2* Pi L* z

8trigFunctionsH L . z ®H 2 Π z L TeXFormH ž ð L& H L H L H L< \ sin 2 \, \ pi \, z , \ cos 2 \, \ pi \, z , \ tan 2 \, \ pi \, z , \ cot 2 \, \ pi \, z ,8 \ sec 2<\, \Hpi \, z ,\ cosL 2 \, \ pi \, z

8trigFunctionsH . z ®L 2 Π z H FortranFormL ž ð &H L H L H L H L< Sin 2 * Pi * z , Cos 2 * Pi * z , Tan 2 * Pi * z , Cot 2 * Pi * z , Sec8 2 * Pi<*z ,H Cos 2 * Pi * z L

8 H L H L H L Automatic evaluations and transformations H L H L H L< Evaluation for exact, machine-number, and high-precision arguments

For a simple exact argument, Mathematica returns exact results. For instance, for the argument Π 6, the Sin function evaluates to 1 2.

Π Sin  6  1 B F 2

Π Sin z , Cos z , Tan z , Cot z , Csc z , Sec z . z ® 6

1 3 1 2 8 , @ D , @ ,D 3 ,@2,D @ D @ D @ D<  2 2 3 3

For: a generic machine-number argument> (a numerical argument with a decimal point and not too many digits), a machine number is returned.

Cos 3.

-0.989992 @ D Sin z , Cos z , Tan z , Cot z , Csc z , Sec z . z ® 2.

0.909297, -0.416147, -2.18504, -0.457658, 1.09975, -2.403 8 @ D @ D @ D @ D @ D @ D< 

8 < http://functions.wolfram.com 18

The next inputs calculate 100-digit approximations of the six trigonometric functions at z = 1.

N Tan 1 , 40

1.557407724654902230506974807458360173087 @ @ D D Cot 1 N ð, 50 &

0.64209261593433070300641998659426562023027811391817 @ D  @ D N Sin z , Cos z , Tan z , Cot z , Csc z , Sec z . z ® 1, 100

0.841470984807896506652502321630298999622563060798371065672751709991910404391239668„ @89486397435430526959@ D @ D ,@ D @ D @ D @ D<  D 0.540302305868139717400936607442976603732310420617922227670097255381100394774471764„ 8 5179518560871830893, 1.557407724654902230506974807458360173087250772381520038383946605698861397151727289„ 555099965202242984, 0.642092615934330703006419986594265620230278113918171379101162280426276856839164672„ 1984829197601968047, 1.188395105778121216261599452374551003527829834097962625265253666359184367357190487„ 913663568030853023, 1.850815717680925617911753241398650193470396655094009298835158277858815411261596705„ 921841413287306671

Within a second, it is possible to calculate thousands of digits for the trigonometric functions. The next input calculates 10000 digits for sin< 1 , cos 1 , tan 1 , cot 1 , sec 1 , and csc 1 and analyzes the frequency of the occur- rence of the digit k in the resulting decimal number.

Map Function w, FirstH ðL , LengthH L H ðL &H žL SplitH L Sort FirstH L RealDigits w , N Sin z , Cos z , Tan z , Cot z , Csc z , Sec z . z ® 1, 10 000

0@, 983 , @1, 10698 , @2,D1019 , 3@,D983< , 4, 972@ , 5@, 994 @, @ DDDDD @86, 994@ D, 7, @988D , 8@, 988D , @9,D 1010@ ,D 0,@998D< , 1, 1034 , 2D,D982 , 3, 1015 , 4, 1013 , 5, 963 , 6, 1034 , 7, 966 , 8, 991 , 9, 1004 , 8880, 1024< ,8 1, 1025< ,8 2, 1000< ,8 3, 969< ,8 4, 1026< 8, 5, 944< , 6, 999 , 87, 1001< ,8 8, 1008< 8, 9, 1004< 8 , 0,<1006< 88 , 1, 1030< 8 , 2, 986< 8 , < 83, 954 ,< 48, 1003 ,< 58, 1034<, 86, 999 ,< 78, 998 ,< 8, 1009<, 89, 981 <,< 880, 1031<, 81, 976 ,< 28, 1045 ,< 38, 917 ,< 48, 1001 ,< 58, 996 ,< 68, 964 ,< 87, 1012<, 88, 982 ,< 98, 1076 <,< 808, 978 ,< 1,8 1034 ,< 2,8 1016 ,< 83, 974<, 84, 987 ,< 58, 1067 ,< 68, 943 ,< 78, 1006<, 88, 1027<, 89, 968<< 88 < 8 < 8 < 8 < 8 < 8 < 8 < Here8 are 50-digit< 8approximations< 8 to the

0.0019019704237010899966700172963208058404592525121712743108017196953928700340468202„ @96847410109982878354@ D D + 0.013341591397996678721837322466473194390132347157253190972075437462485814431570118„ 67262664488519840339 ä

N Sin z , Cos z , Tan z , Cot z , Csc z , Sec z . z ® 3 + 5 ä, 50

@8 @ D @ D @ D @ D @ D @ D<  D http://functions.wolfram.com 19

10.472508533940392276673322536853503271126419950388- 73.460621695673676366791192505081750407213922814475ä, -73.467292212645262467746454594833950830814859165299- 8 10.471557674805574377394464224329537808548330651734ä, -0.000025368676207676032417806136707426288195560702602478+ 0.99991282015135380828209263013972954140566020462086ä, -0.000025373100044545977383763346789469656754050037355986- 1.0000871868058967743285316881045218577131612831891ä, 0.0019019704237010899966700172963208058404592525121713+ 0.013341591397996678721837322466473194390132347157253ä, -0.013340476530549737487361100811100839468470481725038+ 0.0019014661516951513089519270013254277867588978133499ä

Mathematica always evaluates mathematical functions with machine precision, if the arguments are machine numbers. In this case, only six digits after the decimal point are shown in the< results. The remaining digits are suppressed, but can be displayed using the function InputForm.

Sin 2. , N Sin 2 , N Sin 2 , 16 , N Sin 2 , 5 , N Sin 2 , 20

0.909297, 0.909297, 0.909297, 0.909297, 0.90929742682568169540 8 @ D @ @ DD @ @ D D @ @ D D @ @ D D< % InputForm 8 < {0.9092974268256817, 0.9092974268256817, 0.9092974268256817, 0.9092974268256817, 0.909297426825681695396019865911745`20}

Precision %%

16 @ D Simplification of the argument

Mathematica uses symmetries and periodicities of all the trigonometric functions to simplify expressions. Here are some examples.

Sin -z

-Sin z @ D Sin z + Π @ D -Sin z @ D Sin z + 2 Π @ D Sin z @ D Sin z + 34 Π @ D Sin z @ D Sin -z , Cos -z , Tan -z , Cot -z , Csc -z , Sec -z @ D -Sin z , Cos z , -Tan z , -Cot z , -Csc z , Sec z 8 @ D @ D @ D @ D @ D @ D<

8 @ D @ D @ D @ D @ D @ D< http://functions.wolfram.com 20

Sin z + Π , Cos z + Π , Tan z + Π , Cot z + Π , Csc z + Π , Sec z + Π

-Sin z , -Cos z , Tan z , Cot z , -Csc z , -Sec z 8 @ D @ D @ D @ D @ D @ D< Sin z + 2 Π , Cos z + 2 Π , Tan z + 2 Π , Cot z + 2 Π , Csc z + 2 Π , Sec z + 2 Π 8 @ D @ D @ D @ D @ D @ D< Sin z , Cos z , Tan z , Cot z , Csc z , Sec z 8 @ D @ D @ D @ D @ D @ D< Sin z + 342 Π , Cos z + 342 Π , Tan z + 342 Π , Cot z + 342 Π , Csc z + 342 Π , Sec z + 342 Π 8 @ D @ D @ D @ D @ D @ D< Sin z , Cos z , Tan z , Cot z , Csc z , Sec z 8 @ D @ D @ D @ D @ D @ D< Mathematica automatically simplifies the composition of the direct and the inverse trigonometric functions into the a8rgum@entD. @ D @ D @ D @ D @ D<

Sin ArcSin z , Cos ArcCos z , Tan ArcTan z , Cot ArcCot z , Csc ArcCsc z , Sec ArcSec z

8z, z@, z, z, @z,DzD @ @ DD @ @ DD @ @ DD @ @ DD @ @ DD< Mathematica also automatically simplifies the composition of the direct and any of the inverse trigonometric functions8 into algebraic< functions of the argument.

Sin ArcSin z , Sin ArcCos z , Sin ArcTan z , Sin ArcCot z , Sin ArcCsc z , Sin ArcSec z

8 @ @ DD z @ 1@ DD 1 @ 1 @ DD z, 1 - z2 , , , , 1 - @ @ DD @ @ DD @ 2 @ DD< 2 z z 1 + z 1 + 1 z z2 : > Cos ArcSin z , Cos ArcCos z , Cos ArcTan z , Cos ArcCot z , Cos ArcCsc z , Cos ArcSec z

8 @ @ DD 1 @ 1 @ DD @1 1 @ DD 1 - z2 , z, , , 1 - , @ @ DD @ @ DD @ 2 @ DD< 2 z z 1 + z 1 + 1 z2 : > Tan ArcSin z , Tan ArcCos z , Tan ArcTan z , Tan ArcCot z , Tan ArcCsc z , Tan ArcSec z

8 @z @1D-Dz2 @ 1 @ D1D @ 1@ DD @ , @ DD , z@, , @ DD , @ 1 - @ zDD< 2 2 z z z 1 - z 1 - 1 z z2 : > Cot ArcSin z , Cot ArcCos z , Cot ArcTan z , Cot ArcCot z , Cot ArcCsc z , Cot ArcSec z

8 1@- z2 @ DzD 1@ @ DD1 @ 1 @ DD @ , @ DD , @ , z, @1 -DD z, @ @ DD< 2 z 2 z z 1 - z 1 - 1 z z2 : > http://functions.wolfram.com 21

Csc ArcSin z , Csc ArcCos z , Csc ArcTan z , Csc ArcCot z , Csc ArcCsc z , Csc ArcSec z

8 1 @ 1 @ DD 1 + z2@ @ 1DD @ 1 @ DD , @ @, DD @ , 1 +@ DDz, z, @ @ DD< 2 z 2 z z 1 - z 1 - 1 z2 : > Sec ArcSin z , Sec ArcCos z , Sec ArcTan z , Sec ArcCot z , Sec ArcCsc z , Sec ArcSec z

8 @1 1@ DD @ @1 DD 1@ @ DD , , 1 + z2 , 1 + , , z @ @ DD @ @ 2DD @ @ DD< 2 z z 1 - z 1 - 1 z2 : > In cases where the argument has the structure Π k 2 + z or Π k 2 - z, and Π k 2 + ä z or Π k 2 - ä z with integer k, trigonometric functions can be automatically transformed into other trigonometric or hyperbolic functions. Here are some examples.     Π Tan - z 2 Cot z B F Csc ä z @ D -ä Csch z @ D Π Π Π Π Π Π Sin - z , Cos - z , Tan - z , Cot - z , Csc - z , Sec - z 2@ D 2 2 2 2 2 Cos z , Sin z , Cot z , Tan z , Sec z , Csc z : B F B F B F B F B F B F> Sin ä z , Cos ä z , Tan ä z , Cot ä z , Csc ä z , Sec ä z 8 @ D @ D @ D @ D @ D @ D< ä Sinh z , Cosh z , ä Tanh z , -ä Coth z , -ä Csch z , Sech z 8 @ D @ D @ D @ D @ D @ D< Simplification of simple expressions containing trigonometric functions 8 @ D @ D @ D @ D @ D @ D< Sometimes simple arithmetic operations containing trigonometric functions can automatically produce other trigonometric functions.

1 Sec z

Cos z  @ D 1 Sin z , 1 Cos z , 1 Tan z , 1 Cot z , 1 Csc z , 1 Sec z , Sin@ zD Cos z , Cos z Sin z , Sin z Sin Π 2 - z , Cos z Sin z ^2

9Csc‘ z @, SecD z , Cot@ D z ,Tan @z D, Sin z @, CosD z , Tan@ Dz ,Cot @z D, Tan z , Cot z Csc z @ D ‘ @ D @ D ‘ @ D @ D ‘ @  D @ D ‘ @ D = Trigonometric functions arising as special cases from more general functions 8 @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D< http://functions.wolfram.com 22

All trigonometric functions can be treated as particular cases of some more advanced special functions. For exam- ple, sin z and cos z are sometimes the results of auto-simplifications from Bessel, Mathieu, Jacobi, hypergeomet- ric, and Meijer functions (for appropriate values of their parameters).

1 BesselJH L , z H L 2

2 SinB z F Π

z @ D MathieuC 1, 0, z

Cos z @ D JacobiSC z, 0 @ D Tan z @ D 1 In[14]:= BesselJ , z , MathieuS 1, 0, z , JacobiSN z, 0 , @ D 2 3 z2 1 z2 HypergeometricPFQ , , - , MeijerG , , , 0 , : B F @2 4 D @ D 2 4

2 Sin z B8< : > F 2 B88< 8<< :: > 8 <> F> Π Sin z z2 Sin z Out[14]= , Sin z , Sin z , , z z2 Π z @ D B F @ D : 1 @ D @ D > In[15]:= BesselJ - , z , MathieuC 1, 0, z , JacobiCD z, 0 , 2 1 z2 1 z2 Hypergeometric0F1 , - , MeijerG , , 0 , , : B F 2 4@ D @ D 2 4

2 Cos z B F B88< 8<< :8 < : >> F> Π Cos z 2 Out[15]= , Cos z , Cos z , Cos z , z Π @ D @ D In[16]:= :JacobiSC z, 0 , JacobiCS@ D @zD, 0 , JacobiDSB F z, 0 ,>JacobiDC z, 0

Out[16]= Tan z , Cot z , Csc z , Sec z 8 @ D @ D @ D @ D< Equivalence transformations carried out by specialized Mathematica functions 8 @ D @ D @ D @ D< General remarks http://functions.wolfram.com 23

Almost everybody prefers using sin z 2 instead of cos Π 2 - z sin Π 6 . Mathematica automatically transforms the second expression into the first one. The automatic application of transformation rules to mathematical expres- sions can give overly complicated results. Compact expressions like sin 2 z sin Π 16 should not be automatically H L  H  L H  L 1 2 1 2 expanded into the more complicated expression sin z cos z 2 - 2 + 21 2 . Mathematica has special com-

mands that produce these types of expansions. Some of them are demonstratedH L inH the nextL section.   TrigExpand H L H L J I M N

The function TrigExpand expands out trigonometric and hyperbolic functions. In more detail, it splits up sums and integer multiples that appear in the arguments of trigonometric and hyperbolic functions, and then expands out the products of the trigonometric and hyperbolic functions into sums of powers, using the trigonometric and hyperbolic identities where possible. Here are some examples.

TrigExpand Sin x - y

Cos y Sin x - Cos x Sin y @ @ DD Cos 4 z TrigExpand @ D @ D @ D @ D Cos z 4 - 6 Cos z 2 Sin z 2 + Sin z 4 @ D  TrigExpand Sin x + y , Sin 3 z , @ D @CosD x + y@ ,D Cos 3@z D , Tan x + y , Tan 3 z , @88 Cot@ x + yD , Cot@ 3 zD< , 8Csc@x + yD, Csc@3 zD<, 8Sec@x + yD, Sec@3 zD< 8 @ D @ D< Cos y Sin 8x + Cos@ xD Sin y@ , D3 , Cos y Sin x + Cos x Sin y Cos y Sin x + Cos x Sin y @ D @ D @ D @ D @ D @ D 3 2 Cos@ Dz @ D 3 Cos z Sin@ Dz @ D : - , 3 Cos@ Dz 2 Sin@ D z - Sin@ D z 3 @ 3D Cos z@2 DSin z@ D- Sin z@ 3D @ D @ 1D @ D 1@ D , > , Cos y Sin x + Cos x Sin y 2 3 @ D @ D @ D 3 @CosD z @SinD z -@SinD z 1 1 : , > Cos x Cos y - Sin x Sin y 3 2 @ D @ D @ D @ D Cos z@ D- 3 Cos@ Dz Sin@zD

TableForm: ð == TrigExpand ð & ž >> Flatten@ D @SinD x + y@ ,DSin @3 zD , Cos@ D x + y , Cos@ D 3 z @ ,D Tan x + y , Tan 3 z , Cot x + y , Cot 3 z , Csc x + y , Csc 3 z , Sec x + y , Sec 3 z @H @ DL  @88 @ D @ D< 8 @ D @ D< 8 @ D @ D< 8 @ D @ D< 8 @ D @ D< 8 @ D @ D<

Sin x + y == Cos y Sin x + Cos x Sin y Sin 3 z == 3 Cos z 2 Sin z - Sin z 3 Cos x + y == Cos x Cos y - Sin x Sin y @ D @ D @ D @ D @ D Cos 3 z == Cos z 3 - 3 Cos z Sin z 2 @ D @ CosD y Sin@ Dx @ D Cos x Sin y Tan x + y == + @ D Cos @x CosD y -@SinD x Sin y@ D Cos @x CosD y -Sin x Sin y 2 3 Tan@3 zD == @3 CosD z @SinD z @ DD - @ D Sin z @ D @ D 3 2 3 2 Cos z@ D-3 Cos@ Dz Sin@ zD @ CosD z -3@ CosD z@ SinD z @ D @ D @ D Cos x Cos y Sin x Sin y Cot x + y == @ D @ D - @ D Cos y Sin x +Cos x Sin y Cos y Sin x +Cos x Sin y @ D @ D @ D @ D @ D @ D @ D 3 2 Cot 3 z == Cos @z D @ D - 3 Cos z Sin@zD @ D 2 3 2 3 3 Cos @z D Sin@ zD -Sin@ zD @ 3DCos z @SinD z @-SinD z @ D @ D @ D 1 Csc x + y == @ D @ D @ D Cos y Sin x +Cos x Sin y @ D @ D @ D @ D @ D @ D @ D 1 Csc 3 z == 3 Cos z 2 Sin z -Sin z 3 @ D @ D @ D @ D @ D 1 Sec x + y == Cos x Cos y -Sin x Sin y @ D @ D @ D @ D 1 Sec 3 z == Cos z 3-3 Cos z Sin z 2 @ D @ D @ D @ D @ D TrigFactor @ D @ D @ D @ D The function TrigFactor factors trigonometric and hyperbolic functions. In more detail, it splits up sums and integer multiples that appear in the arguments of trigonometric and hyperbolic functions, and then factors the resulting polynomials in the trigonometric and hyperbolic functions, using the corresponding identities where possible. Here are some examples.

TrigFactor Sin x + Cos y x y x y x y x y Cos - + Sin - Cos + + Sin + 2 2 @ @ D2 2 @ DD 2 2 2 2

Tan x - Cot y TrigFactor B F B F B F B F -Cos x + y Csc y Sec x @ D @ D  TrigFactor Sin x + Sin y , @ D Cos@ Dx + Cos@ D y , Tan x + Tan y , @8Cot@xD + Cot@yD, Csc@xD + Csc@yD, Sec@xD + Sec@yD @ D @ D x y x y x y x y 2 Cos - Sin@ D + @, 2DCos - Cos + , Sec x Sec y Sin x + y , 2 2 @ D2 2 @ D I A E A EM I A E A EM I A E A EM I A E A EM http://functions.wolfram.com 25

The function TrigReduce rewrites products and powers of trigonometric and hyperbolic functions in terms of those functions with combined arguments. In more detail, it typically yields a linear expression involving trigono- metric and hyperbolic functions with more complicated arguments. TrigReduce is approximately inverse to TrigExpand and TrigFactor. Here are some examples.

TrigReduce Sin z ^3

1 3 Sin z - Sin 3 z 4 @ @ D D

Sin x Cos y TrigReduce H @ D @ DL 1 Sin x - y + Sin x + y 2 @ D @ D 

TrigReduce Sin z ^2, Cos z ^2, Tan z ^2, Cot z ^2, Csc z ^2, Sec z ^2 H @ D @ DL 1 1 1 - Cos 2 z -1 - Cos 2 z 2 2 1 - Cos 2 z , 1 + Cos 2 z , , , - , 2 @8 @ D2 @ D 1 +@CosD 2 z @-1D+ Cos 2 z@ D -1 + Cos@ D2 z

TrigReduce TrigExpand Sin x y , Sin 3@z ,D Sin x Sin@ y D, : H @ DL H @ D+L > Cos x + y , Cos @3 z D, Cos x Cos@ yD , @ D @ D Tan x + y , Tan 3 z , Tan x Tan y , @ @88 Cot@ x + yD , Cot@ 3 zD , Cot@ xD Cot@ yD< , 8Csc@x + yD, Csc@3 zD, Csc@xD Csc@yD<, 8Sec@x + yD, Sec@3 zD, Sec@xD Sec@yD< 8 @ D @ D @ D @ D< 1 Sin x + y , Sin 3 z , 8Cos @x - y D- Cos@x +Dy , @ D @ D< 2 8 @ D @ D @ D @ D<

Cos x - y - Cos x + y Tan x + y , Tan 3 z , , : @ D @ D CosH x -@y + DCos x +@y DL> Cos x - y + Cos x + y Cot x + y , Cot 3 z , @ D @ D , : @ D @ D Cos x - y - Cos x + y > @ D @ D 2 Csc x + y , Csc 3 z , @ D @ D , : @ D @ D Cos x - y - Cos x + y > @ D @ D 2 Sec x + y , Sec 3 z , : @ D @ D Cos x - y + Cos x + y > @ D @ D TrigReduce TrigFactor Sin x Sin y , Cos x Cos y , : @ D @ D + >> + Tan x + Tan y , Cot x @+ Cot Dy , Csc@ x D+ Csc y , Sec x + Sec y 2 Sin x + y Sin x + Sin@ y , Cos x@8+ Cos@ Dy , @ D @ D @ D, @ D @ D @ D @ DCos x@- Dy + Cos@ Dx + y @ D @ D
@ D @ D @ D @ D @ D @ D http://functions.wolfram.com 26

The function TrigToExp converts direct and inverse trigonometric and hyperbolic functions to exponential or logarithmic functions. It tries, where possible, to give results that do not involve explicit complex numbers. Here are some examples.

TrigToExp Sin 2 z

1 1 ä ã-2 ä z - ä ã2 ä z 2 @2 @ DD

Sin z Tan 2 z TrigToExp

ã-ä z - ãä z ã-2 ä z - ã2 ä z - @ D @ D  2 ã-2 ä z + ã2 ä z I M I M TrigToExp Sin z , Cos z , Tan z , Cot z , Csc z , Sec z I M 1 1 ã-ä z ãä z ä ã-ä z - ãä z ä ã-ä z + ãä z 2 ä 2 -ä z ä z ä ã -@8 ä ã@ D, @+ D , @ D @ D , - @ D @ D<,D- , 2 2 2 2 ã-ä z + ãä z ã-ä z - ãä z ã-ä z - ãä z ã-ä z + ãä z I M I M E:xpToTrig > The function ExpToTrig converts exponentials to trigonometric or hyperbolic functions. It tries, where possible, to give results that do not involve explicit complex numbers. It is approximately inverse to TrigToExp. Here are some examples.

ExpToTrig ãä x Β

Cos x Β + ä Sin x Β A E ãä x Α - ãä x Β @ D ExpToTrig@ D ãä x Γ + ãä x ∆ Cos x Α - Cos x Β + ä Sin x Α - ä Sin x Β  Cos x Γ + Cos x ∆ + ä Sin x Γ + ä Sin x ∆

ExpToTrig@ D TrigToExp@ D Sin@ z D, Cos z@, TanD z , Cot z , Csc z , Sec z @ D @ D @ D @ D Sin z , Cos z , Tan z , Cot z , Csc z , Sec z @ @8 @ D @ D @ D @ D @ D @ D

ComplexExpand Sin x + ä y Cos x - ä y

@ @ D @ DD http://functions.wolfram.com 27

Cos x Cosh y 2 Sin x - Cos x Sin x Sinh y 2 + ä Cos x 2 Cosh y Sinh y + Cosh y Sin x 2 Sinh y

Csc@xD+ ä y @SecD x - ä@yD ComplexExpand@ D @ D @ D I @ D @ D @ D @ D @ D @ DM 4 Cos x Cosh y 2 Sin x 4 Cos x Sin x Sinh y 2 - + + Cos@ 2 x D- Cosh@ 2 y D Cos 2 x + Cosh 2 y Cos 2 x - Cosh 2 y Cos 2 x + Cosh 2 y

2 4 Cos@ Dx Cosh@ D y Sinh@ D y @ D @ D @ D ä + H Cos@ 2D x - Cosh@ 2DLyH Cos@ 2D x + Cosh@ 2DLy H @ D @ DL H @ D @ DL 4 Cosh@ Dy Sin @x D2 Sinh@ yD H Cos@ 2 xD - Cosh@ 2 yDL H Cos@ 2 xD + Cosh@ 2 yDL

@ D @ D @ D In[17]:= li1 = Sin x + ä y , Cos x + ä y , Tan x + ä y , Cot x + ä y , Csc x + ä y , Sec x + ä y H @ D @ DL H @ D @ DL Out[17]= Sin x + ä y , Cos x + ä y , Tan x + ä y , Cot x + ä y , Csc x + ä y , Sec x + ä y 8 @ D @ D @ D @ D @ D @ D< In[18]:= ComplexExpand li1 8 @ D @ D @ D @ D @ D @ D< Out[18]= Cosh y Sin x + ä Cos x Sinh y , Cos x Cosh y - ä Sin x Sinh y , @ D Sin 2 x ä Sinh 2 y Sin 2 x ä Sinh 2 y + , - + , : Cos @2 xD + Cosh@ D 2 y @CosD 2 x @+DCosh 2@ yD Cos@ D2 x - Cosh@ D 2 y @ DCos 2 x - Cosh 2 y 2 Cosh y Sin x 2 ä Cos x Sinh y 2 Cos x Cosh y 2 ä Sin x Sinh y - @ D + @ D , @ D + @ D Cos 2 x - Cosh 2 y Cos 2 x - Cosh 2 y Cos 2 x + Cosh 2 y Cos 2 x + Cosh 2 y @ D @ D @ D @ D @ D @ D @ D @ D ComplexExpand@ D Re@ D & li1, TargetFunctions@ D @ D Re@, ImD @ D @ D @ D In[19]:= ð ž ® > @ D @ D @ D @ D @ D @ D @ D @ D Sin 2 x Out[19]= Cosh y Sin x , Cos x Cosh y , , @ @ D  Cos 2 x + Cosh 82 y @ D @ D @ D @ D @ D @ D Sinh 2 y Out[20]= Cos x Sinh y , -Sin x Sinh y , , @ @ D  Cos 2 x + Cosh8 2 y @ D @ D @ D @ D @ D @ D

@ @ D  8

2 2 2 2 2 2 2 2 Out[21]= Cosh y Sin x + Cos x Sinh y , Cos x Cosh y + Sin x Sinh y ,

Sin 2 x 2 Sinh 2 y 2 : @ D @ D @ +D @ D @ D , @ D @ D @ D Cos 2 x + Cosh 2 y 2 Cos 2 x + Cosh 2 y 2 @ D @ D Sin 2 x 2 Sinh 2 y 2 H @ D @ DL + H @ D @ DL , Cos 2 x - Cosh 2 y 2 Cos 2 x - Cosh 2 y 2 @ D @ D 4 Cosh y 2 Sin x 2 4 Cos x 2 Sinh y 2 H @ D @ DL + H @ D @ DL , Cos 2 x - Cosh 2 y 2 Cos 2 x - Cosh 2 y 2 @ D @ D @ D @ D 4 Cos x 2 Cosh y 2 4 Sin x 2 Sinh y 2 H @ D @ DL + H @ D @ DL Cos 2 x + Cosh 2 y 2 Cos 2 x + Cosh 2 y 2 @ D @ D @ D @ D In[22]:= % Simplify ð, x, y Î Reals & > H @ D @ DL H @ D @ DL -Cos 2 x + Cosh 2 y Cos 2 x + Cosh 2 y Sin 2 x 2 + Sinh 2 y 2 Out[22]=  @ 8 < , D , , 2 2 Cos 2 x + Cosh 2 y @ D @ D @ D @ D @ D @ D : Cos 2 x + Cosh 2 y 2 2 - , , @ D @ D Cos 2 x - Cosh 2 y -Cos 2 x + Cosh 2 y Cos 2 x + Cosh 2 y @ D @ D In[23]:= ComplexExpand Arg ð & ž li1, TargetFunctions ® Re, Im > @ D @ D @ D @ D @ D @ D Out[23]= ArcTan Cosh y Sin x , Cos x Sinh y , ArcTan Cos x Cosh y , -Sin x Sinh y , @Sin @2 xD  Sinh 2 y 8 ® @ D @ D @ D @ D Out[24]= Cosh y Sin x - ä Cos x Sinh y , Cos x Cosh y + ä Sin x Sinh y , @ @ D  8

Simplify > @ D @ D @ D @ D @ D @ D @ D @ D http://functions.wolfram.com 29

The function Simplify performs a of algebraic transformations on its argument, and returns the simplest form it finds. Here are two examples.

Simplify Sin 2 z Sin z

2 Cos z A @ D ‘ @ DE Sin 2 z Cos z Simplify @ D 2 Sin z @ D ‘ @ D  Here is a large collection of trigonometric identities. All are written as one large logical conjunction. @ D

2 Simplify ð & ž Cos z 2 + Sin z == 1

2 @ D1 - Cos 2 z@ D @ D 1 +íCos 2 z Sin z == Cos z 2 == 2 2 1 - Cos 2 z 1 + Cos 2 z Tan z 2 == @ D Cot z 2 == @ D @ D 1 + Cos 2 z í @ D 1 - Cos 2 z í 2 2 2 Sin 2 z Š 2 Sin z@ CosD z Cos 2 z Š Cos@z D- Sin z Š 2 Cos z - 1 @ D í @ D í Sin a + b Š Sin a@ CosD b + Cos a Sin b @ SinD a - b Š Sin a Cos b - Cos a Sin b Cos@a +Db Š Cos@aD Cos@bD -íSin a@ SinD b @ CosD a - b@ DŠ Cos a Cos@ D b +íSin a Sin b @ D @ D @ aD+ b @ D a - b@ D í @ D @ D @a +Db @ Da - b @ D í Sin a + Sin b Š 2 Sin Cos Sin a - Sin b Š 2 Cos Sin @ D @ D @ D2 @ D 2 @ D í @ D @ D @ 2D @ D 2 @ D í a + b a - b a + b b - a Cos a + Cos b Š 2 Cos Cos Cos a - Cos b Š 2 Sin Sin @ D @ D B 2 F B 2 F í @ D @ D B 2 F B 2 F í Sin a + b Sin a - b Tan a + Tan b Š Tan a - Tan b Š @ D @ D Cos aB CosFb B F í @ D Cos@ Da Cos b B F B F í

@ D2 @ D @ D @ D B í @ D @B D í A Sin z + B Cos z Š A@ D 1 + @ DSin z + ArcTan @ D @ D A2 A Cos a - b - Cos a + b Sin a@ SinD b Š@ D B B FF í 2 Cos a - b + Cos a + b Sin a + b + Sin a - b Cos a Cos b Š @ D @ D Sin a Cos b Š @ D @ D 2 í 2 z 2 1 - Cos z z 2 1 + Cos z Sin Š @Cos D Š @ D @ D @ D 2 @ D @ 2D 2 2 í @ D @ D í

z 1 - Cos @z D Sin z z@ D Sin z 1 + Cos z TanB F Š Ší B F Cot Ší Š 2 Sin z 1 + Cos z 2 1 - Cos z Sin z

@ D @ D @ D @ D TrueB F í B F @ D @ D @ D @ D The function Simplify has the Assumption option. For example, Mathematica knows that -1 £ sin x £ 1 for all real x, and uses the periodicity of trigonometric functions for the symbolic integer coefficient k of k Π.

H L http://functions.wolfram.com 30

Simplify Abs Sin x £ 1, x Î Reals

True @ @ @ DD D Abs Sin x £ 1 Simplify ð, x Î Reals &

True @ @ DD  @ D Simplify Sin z + 2 k Π , Cos z + 2 k Π , Tan z + k Π , Cot z + k Π , Csc z + 2 k Π , Sec z + 2 k Π , k Î Integers

Sin z ,@Cos8 z@ , Tan zD , Cot@ z , CscD z , Sec@ z D @ D @ D @ D< D Simplify Sin z + k Π Sin z , Cos z + k Π Cos z , Tan z + k Π Tan z , 8 Cot@ zD + k Π @ DCot z @, DCsc z @+ kDΠ Csc@ Dz , Sec@ Dz< + k Π Sec z , k Î Integers

-1 k, A-91 k,@1, 1, D-‘1 k,@ -D1 k @ D  @ D @ D  @ D @ D  @ D @ D  @ D @ D  @ D= E Mathematica also knows that the composition of inverse and direct trigonometric functions produces the value of the9H innerL argumentH L under theH appropriateL H L restriction.= Here are some examples.

Simplify ArcSin Sin z , ArcTan Tan z , ArcCot Cot z , ArcCsc Csc z , -Π 2 < Re z < Π 2

z, z, z,@z8 @ @ DD @ @ DD @ @ DD @ @ DD<  @ D  D Simplify ArcCos Cos z , ArcSec Sec z , 0 < Re z < Π 8 < z, z @8 @ @ DD @ @ DD< @ D D FunctionExpand (and Together) 8 < While the trigonometric functions auto-evaluate for simple fractions of Π, for more complicated cases they stay as trigonometric functions to avoid the build up of large expressions. Using the function FunctionExpand, such expressions can be transformed into explicit radicals.

Π Cos 32 Π Cos B 32 F

Π FunctionExpandB F Cos 32

1 B B FF 2 + 2 + 2 + 2 2

Π Cot FunctionExpand 24

B F  http://functions.wolfram.com 31

2- 2 + 1 3 2 + 2 4 4

2 2 1 J + N - 3 2 - 2 + 4 4

Π Π Π Π Π Π Sin J , CosN , Tan , Cot , Csc , Sec 16 16 16 16 16 16 Π Π Π Π Π Π Sin , Cos , Tan , Cot , Csc , Sec : B 16 F B16 F B16 F B16 F 16B F 16B F>

FunctionExpand[%] : B F B F B F B F B F B F>

1 1 2 - 2 + 2 2 - 2 + 2 , 2 + 2 + 2 , , 2 2 2 + 2 + 2

: 2 + 2 + 2 2 2 , , 2 - 2 + 2 2 - 2 + 2 2 + 2 + 2 > Π Π Π Π Π Π Sin , Cos , Tan , Cot , Csc , Sec 60 60 60 60 60 60 Π Π Π Π Π Π Sin , Cos , Tan , Cot , Csc , Sec : B 60 F B60 F B60 F B60 F 60B F 60B F>

Together FunctionExpand % : B F B F B F B F B F B F>

@ @ DD http://functions.wolfram.com 32

1 - 2 - 6 + 10 + 30 + 2 5 + 5 - 2 3 5 + 5 , 16

1 : 2 - 6 - 10 + 30 + 2 5 + 5 + 2 3 5J + 5 N , 16

-1 - 3 + 5 + 15 + 2 5 + 5 - 6 5 + J5 N ,

1 - 3 - 5 + 15 + 2 J5 + 5 N + 6 J5 + 5 N

-1 + 3 + 5 - 15 - 2J 5 + 5N - 6J 5 + 5N ,

1 + 3 - 5 - 15 - 2 J5 + 5 N + 6 J5 + 5 N

16 J N J N ,

- 2 - 6 + 10 + 30 + 2 5 + 5 - 2 3 5 + 5

16 J N 2 - 6 - 10 + 30 + 2 5 + 5 + 2 3 5 + 5 >

If the denominator contains squares of integers other thanJ 2, theN results always contain complex numbers (meaning that the imaginary number ä = -1 appears unavoidably).

Π Π Π Π Π Π Sin , Cos , Tan , Cot , Csc , Sec 9 9 9 9 9 9 Π Π Π Π Π Π Sin , Cos , Tan , Cot , Csc , Sec : B 9 F B9 F B9 F B9 F 9B F 9B F>

FunctionExpand[%] // Together : B F B F B F B F B F B F> http://functions.wolfram.com 33

1 1 3 -ä 22 3 -1 - ä 3 + 8 ‘ ‘ 1 3 1 3 1 3 22 3 3 -1 - ä 3 + ä 22 3 -1 + ä 3 + 22 3 3 -1 + ä 3 , : J N ‘ ‘ ‘ 1 ‘ 1 3 ‘ 1 3 ‘ 1 3 22 3 -1 - ä 3 + ä 22 3 3 -1 - ä 3 + 22 3 -1 + ä 3 - 8 J N J N J N ‘ ‘ ‘ ‘ 1 3‘ ‘ ä 22 3 3 -1 + ä 3 , J N J N J N ‘ ‘ 1 3 1 3 1 3 1 3 - -1 - ä 3 - ä 3 -1 - ä 3 + -1 + ä 3 - ä 3 -1 + ä 3 J N , ‘1 3 1‘3 ‘1 3 1‘3 -ä -1 - ä 3 + 3 -1 - ä 3 - ä -1 + ä 3 - 3 -1 + ä 3 J N J N J N J N ‘ ‘ ‘ ‘ 1 3 1 3 1 3 1 3 -1 - ä 3 + ä 3 -1 - ä 3 + -1 + ä 3 - ä 3 -1 + ä 3 J N J N J N J N , ‘ 1 3 1‘ 3 ‘ 1 3 1‘ 3 -ä -1 - ä 3 + 3 -1 - ä 3 + ä -1 + ä 3 + 3 -1 + ä 3 J N J N J N J N ‘ 1 3 ‘ 1 3 ‘ ‘ 8 -ä 22 3 -1 - ä 3 + 22 3 3 -1 - ä 3 + J N J N J N J N 1 3 ‘ 1 3 ‘ ä 22 3 ‘-1 + ä 3 + 22 3 ‘ 3 -1 + ä 3 , “ J N J N ‘ 1 3 ‘ 1 3 - 8 ä ‘ -ä 22 3 -1 - ä 3 ‘ + 22 3 3 -1 - ä 3 - J N J N 1 3 ‘ 1 3 ‘ ä 22 3 -1 +‘ ä 3 - 22 3 3 ‘-1 + ä 3 H L “ J N J N ‘ ‘ ‘ ‘ Here the function RootReduce is used to express the previous algebraic numbers as numbered roots of polynomial J N J N > equations.

RootReduce Simplify %

Root -3 + 36 ð12 - 96 ð14 + 64 ð16 &, 4 , Root -1 - 6 ð1 + 8 ð13 &, 3 , Root -3 + 27@ ð12 - 33@ð1D4D+ ð16 &, 4 , Root -1 + 33 ð12 - 27 ð14 + 3 ð16 &, 6 , Root 64 96 12 36 14 3 16 &, 6 , Root 8 6 12 13 &, 3 9 A- + ð - ð + ð E A- + ð + ð E A E A E The function FunctionExpand also reduces trigonometric expressions with compound arguments or composi- tions, includingA hyperbolic functions, to simplerE ones. AHere are some examples.E=

FunctionExpand Cot -z2

-z Coth z - B B FF z @ D Tan ä z2 FunctionExpand

-1 3 4 - -1 3 4 z -1 3 4 z Tan -1 1 4 z B F  - ‘ ‘ z ‘ ‘ H L H L H L BH L F http://functions.wolfram.com 34

Sin z2 , Cos z2 , Tan z2 , Cot z2 , Csc z2 , Sec z2 FunctionExpand

-ä z ä z Sin z -ä z ä z Tan z : B F B , CosF z B, F B F , B F B F>  z z -ä z ä z Cot z -ä z ä z Csc z @ D , , Sec@ zD : z @ D z

Applying Simplify to@ theD last expression gives@ a Dmore compact result. @ D> Simplify %

z2 Sin z z2 Tan z z2 Cot z z2 Csc z @ D , Cos z , , , , Sec z z z z z

Here are some@ similarD examples. @ D @ D @ D : @ D @ D> Sin 2 ArcTan z FunctionExpand

2 z

1 + @z2 @ DD 

ArcCot z Cos FunctionExpand 2

z z@ D 1B+ - F  -1-z2

2

Sin 2 ArcSin z , Cos 2 ArcCos z , Tan 2 ArcTan z , Cot 2 ArcCot z , Csc 2 ArcCsc z , Sec 2 ArcSec z FunctionExpand 2 z 82 1@ - z z 1@+DzD, -1 +@2 z2, - @ DD @ , @ DD @ @ DD @ -1@+DzD 1 + @z @ DD<  1 1 1 z2 -ä z ä z z z2 : 1 + z - , , 2 z2 -1 - z2 -1 - z2 H 2 L-H1 + z L 1 + z 2 - z2

ArcSin z ArcCos z ArcTan z > Sin , Cos , Tan , 2 2 H L H2 L ArcCot z ArcCsc z ArcSec z Cot @ D , Csc @ D , Sec @ D FunctionExpand : B 2 F B 2 F B 2 F

@ D @ D @ D B F B F B F>  http://functions.wolfram.com 35

z 1 - 1 - z 1 + z 1 + z z , , , 2 -ä z ä z 2 1 + ä -ä + z -ä ä + z

: 2 - ä ä z -1 - z2 z z H2 -zL H L z 1 + , , -z z -1 - z -1+z 1+z 1 - -ä z ä z > H L H L Simplify %

1 2 2 z z 1 1 z 2 - @ D- 1 + z z z -1 - z2 z 2 , , , z + , , 2 2 2 -z 2 z 1 + 1 + z 2 2 1 z -1+z 1 + 1 - z z2 : > FullSimplify

The function FullSimplify tries a wider range of transformations than Simplify and returns the simplest form it finds. Here are some examples that contrast the results of applying these functions to the same expressions.

1 1 Cos ä Log 1 - ä z - ä Log 1 + ä z Simplify 2 2 1 CoshB Log@ 1 - ä zD - Log 1 +@ä z DF  2

1 1 Cos B äHLog @1 - ä z D- ä Log@ 1 +DäLzF FullSimplify 2 2 1 B @ D @ DF  1 + z2

Sin -ä Log ä z + 1 - z2 , Cos -ä Log ä z + 1 - z2 ,

Tan -ä Log ä z + 1 - z2 , Cot -ä Log ä z + 1 - z2 , : B B FF B B FF Csc -ä Log ä z + 1 - z2 , Sec -ä Log ä z + 1 - z2 Simplify B B FF B B FF

z z - ä 1 - z2 2 ä z + 1 - z2 1B- z2 + ä Bz 1 - z2 FF B B 1 - z2 + ä FzF> 1- z2 1 z, , , , , 2 2 2 2 2 2 z ä z + 1 - z -ä + ä z + z 1 - z ä z + z 1 - z 1 + ä z + 1 - z2 : > Sin -ä Log ä z + 1 - z2 , Cos -ä Log ä z + 1 - z2 ,

Tan -ä Log ä z + 1 - z2 , Cot -ä Log ä z + 1 - z2 , : B B FF B B FF Csc -ä Log ä z + 1 - z2 , Sec -ä Log ä z + 1 - z2 FullSimplify B B FF B B FF

B B FF B B FF>  http://functions.wolfram.com 36

z 1 - z2 1 1 z, 1 - z2 , , , , z z 1 - z2 1 - z2

: > Operations carried out by specialized Mathematica functions

Series expansions

Calculating the series expansion of trigonometric functions to hundreds of terms can be done in seconds. Here are some examples.

Series Sin z , z, 0, 5

z3 z5 z - + + O z 6 6 @ 120@ D 8

Normal % @ D z3 z5 z - + 6 @ 120D

Series Sin z , Cos z , Tan z , Cot z , Csc z , Sec z , z, 0, 3

z3 z2 z3 z - + O z 4, 1 - + O z 4, z + + O z 4, 6 @8 @ D 2@ D @ D 3 @ D @ D @ D< 8

Series Cot z , z, 0, 100 Timing @ D @ D @ D > 1 z z3 2 z5 z7 2 z9 1382 z11 1.442 Second, ------@ @ D z8 3 45

- http://functions.wolfram.com 37

207 461 256 206 578 143 748 856 z45 - 7 670 102 214 448 301 053 033 358 480 610 212 529 462 890 625 11 218 806 737 995 635 372 498 255 094 z47 - 4 093 648 603 384 274 996 519 698 921 478 879 580 162 286 669 921 875 79 209 152 838 572 743 713 996 404 z49 - 285 258 771 457 546 764 463 363 635 252 374 414 183 254 365 234 375 246 512 528 657 073 833 030 130 766 724 z51 - 8 761 982 491 474 419 367 550 817 114 626 909 562 924 278 968 505 859 375 233 199 709 079 078 899 371 344 990 501 528 z53 - 81 807 125 729 900 063 867 074 959 072 425 603 825 198 823 017 351 806 640 625 1 416 795 959 607 558 144 963 094 708 378 988 z55 - 4 905 352 087 939 496 310 826 487 207 538 302 184 255 342 959 123 162 841 796 875 23 305 824 372 104 839 134 357 731 308 699 592 z57 - 796 392 368 980 577 121 745 974 726 570 063 253 238 310 542 073 919 837 646 484 375 9 721 865 123 870 044 576 322 439 952 638 561 968 331 928 z59 - 3 278 777 586 273 629 598 615 520 165 380 455 583 231 003 564 645 636 125 000 418 914 794 921 875 6 348 689 256 302 894 731 330 601 216 724 328 336 z61 - 21 132 271 510 899 613 925 529 439 369 536 628 424 678 570 233 931 462 891 949 462 890 625 106 783 830 147 866 529 886 385 444 979 142 647 942 017 z63 - 3 508 062 732 166 890 409 707 514 582 539 928 001 638 766 051 683 792 497 378 070 587 158 203 125 267 745 458 568 424 664 373 021 714 282 169 516 771 254 382 z65 86 812 790 293 146 213 360 651 966 604 262 937 105 495 141 563 588 806 888 204 273 501 373 291 015 „ 625 - 250 471 004 320 250 327 955 196 022 920 428 000 776 938 z67 I M ‘ 801 528 196 428 242 695 121 010 267 455 843 804 062 822 357 897 831 858 125 102 407 684 326 171 875 - 172 043 582 552 384 800 434 637 321 986 040 823 829 878 646 884 z69 I M ‘ 5 433 748 964 547 053 581 149 916 185 708 338 218 048 392 402 830 337 634 114 958 370 880 742 156 „ 982 421 875 - 11 655 909 923 339 888 220 876 554 489 282 134 730 564 976 603 688 520 858 z71 I M ‘ 3 633 348 205 269 879 230 856 840 004 304 821 536 968 049 780 112 803 650 817 771 432 558 560 793 „ 458 452 606 201 171 875 - I M ‘ 3 692 153 220 456 342 488 035 683 646 645 690 290 452 790 030 604 z73 11 359 005 221 796 317 918 049 302 062 760 294 302 183 889 391 189 419 445 133 951 612 582 060 536 „ 346 435 546 875 - 5 190 545 015 986 394 254 249 936 008 544 252 611 445 319 542 919 116 z75 I M ‘ 157 606 197 452 423 911 112 934 066 120 799 083 442 801 465 302 753 194 801 233 578 624 576 089 „ 941 806 793 212 890 625 - 255 290 071 123 323I586 643 187 098 799 718 199 072 122 692 536 861 835 992z77 M ‘ 76 505 736 228 426 953 173 738 238 352 183 101 801 688 392 812 244 485 181 277 127 930 109 049 138 „ 257 655 704 498 291 015 625 - I M ‘ 9 207 568 598 958 915 293 871 149 938 038 093 699 588 515 745 502 577 839 313 734z79 27 233 582 984 369 795 892 070 228 410 001 578 355 986 013 571 390 071 723 225 259 349 721 067 988 „ 068 852 863 296 604 156 494 140 625 - I M ‘ 163 611 136 505 867 886 519 332 147 296 221 453 678 803 514 884 902 772 183 572z81 4 776 089 171 877 348 057 451 105 924 101 750 653 118 402 745 283 825 543 113 171 217 116 857 704 „ 024 700 607 798 175 811 767 578 125 - I M ‘ 8 098 304 783 741 161 440 924 524 640 446 924 039 959 669 564 792 363 509 124 335 729 908z83 2 333 207 846 470 426 678 843 707 227 616 712 214 909 162 634 745 895 349 325 948 586 531 533 393 „ - I M ‘ http://functions.wolfram.com 38

8 098 304 783 741 161 440 924 524 640 446 924 039 959 669 564 792 363 509 124 335 729 908z83 2 333 207 846 470 426 678 843 707 227 616 712 214 909 162 634 745 895 349 325 948 586 531 533 393 „ 530 725 143 500 144 033 328 342 437 744 140 625 - I M ‘ 122 923 650 124 219 284 385 832 157 660 699 813 260 991 755 656 444 452 420 836 648z85 349 538 086 043 843 717 584 559 187 055 386 621 548 470 304 913 596 772 372 737 435 524 697 231 „ 069 047 713 981 709 496 784 210 205 078 125 - I M ‘ 476 882 359 517 824 548 362 004 154 188 840 670 307 545 554 753 464 961 562 516 323 845 108z87 13 383 510 964 174 348 021 497 060 628 653 950 829 663 288 548 327 870 152 944 013 988 358 928 114 „ 528 962 242 087 062 453 152 690 410 614 013 671 875 - I1 886 491 646 433 732 479 814 597 361 998 744 134 040 407 919 471 435 385 970 472 345 164 676 056M ‘ z89 522 532 651 330 971 490 226 753 590 247 329 744 050 384 290 675 644 135 735 656 667 608 610 471 „ I 400 391 047 234 539 824 350 830 981 313 610 076 904 296 875 - 450 638M ‘590 680 882 618 431 105 331 665 591 912 924 988 342 163 281 788 877 675 244 114 763 912 z91 1 231 931 818 039 911 948 327 467 370 123 161 265 684 460 571 086 659 079 080 437 659 781 065 743 „ I 269 173 212 919 832 661 978 537 311 246 395 111 083 984 375 - 415 596M ‘189 473 955 564 121 634 614 268 323 814 113 534 779 643 471 190 276 158 333 713 923 216 z93 11 213 200 675 690 943 223 287 032 785 929 540 201 272 600 687 465 377 745 332 153 847 964 679 254 „ I 692 602 138 023 498 144 562 090 675 557 613 372 802 734 375 - M ‘ 423 200 899 194 533 026 195 195 456 219 648 467 346 087 908 778 120 468 301 277 466 840 101 336 „ 699 974 518 z95 112 694 926 530 960 148 011 367 752 417 874 063 473 378 698 369 880 587 800 838 274 234 349 237 „ I 591 647 453 413 782 021 538 312 594 164 677 406 144 702 434 539 794 921 875- M ‘ 5 543 531 483 502 489 438 698 050 411 951 314 743 456 505 773 755 468 368 087 670 306 121 873 229 „ 244 z97 14 569 479 835 935 377 894 165 191 004 250 040 526 616 509 162 234 077 285 176 247 476 968 227 225 „ I 810 918 346 966 001 491 701 692 846 112 140 419 483 184 814 453 125- M ‘ 378 392 151 276 488 501 180 909 732 277 974 887 490 811 366 132 267 744 533 542 784 817 245 581 „ 660 788 990 844 z99 9 815 205 420 757 514 710 108 178 059 369 553 458 327 392 260 750 404 049 930 407 987 933 582 359 „ I 080 767 225 644 716 670 683 512 153 512 547 802 166 033 089 160 919 189 453 125+ O z 101 M ‘

Mathematica comes with the add-on package DiscreteMath`RSolve` that allows finding the general terms of @ D > series for many functions. After loading this package, and using the package function SeriesTerm, the following nth term for odd trigonometric functions can be evaluated.

<< DiscreteMath`RSolve`

SeriesTerm Sin z , Tan z , Cot z , Csc z , Cos z , Sec z , z, 0, n

@8 @ D @ D @ D @ D @ D @ D< 8

ä-1+n KroneckerDelta Mod -1 + n, 2 UnitStep -1 + n , Gamma 1 + n -1+n 1+n 1+n ä 2 @ -1 +@2 BernoulliBDD 1 +@n D ä än 21+n BernoulliB 1 + n :If Odd n , , 0 , , @1 + nD ! 1 + n ! 1 ä än 21+n BernoulliB 1I+ n, M n @ D n 2 ä KroneckerDelta Mod n, 2 ä EulerE n@ D B @ D , F , 1 + n ! H L Gamma 1 + n H nL!

B F @ @ DD @ D Differentiation > H L @ D Mathematica can evaluate derivatives of trigonometric functions of an arbitrary positive integer order.

D Sin z , z

Cos z @ @ D D Sin z D ð, z & @ D Cos z @ D  @ D ¶z Sin z , Cos z , Tan z , Cot z , Csc z , Sec z @ D Cos z , -Sin z , Sec z 2, -Csc z 2, -Cot z Csc z , Sec z Tan z 8 @ D @ D @ D @ D @ D @ D<

¶ z,2 Sin z , Cos z , Tan z , Cot z , Csc z , Sec z 9 @ D @ D @ D @ D @ D @ D @ D @ D= -Sin z , -Cos z , 2 Sec z 2 Tan z , 2 Cot z Csc z 2, 8 < Cot 8z 2 Csc@ D z + Csc@ D z 3,@SecD z 3 +@ SecD z @TanD z 2 @ D<

9 @ D @ D @ D @ D @ D @ D Table D Sin z , Cos z , Tan z , Cot z , Csc z , Sec z , z, n , n, 4 @ D @ D @ D @ D @ D @ D = Cos z , -Sin z , Sec z 2, -Csc z 2, -Cot z Csc z , Sec z Tan z , -Sin z , -Cos z , 2 Sec@ @z8 2 Tan@ Dz , 2 @CotD z Csc@ Dz 2, Cot@ D z 2 Csc@ D z + Csc@ D

Finite summation@ D @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D == Mathematica can calculate finite sums that contain trigonometric functions. Here are two examples.

Sum Sin a k , k, 0, n

1 a a a Cos - Cos + a n Csc 2 @ @2 D 8 2

n -1 Bk SinF a kB F B F k=0

â H L @ D http://functions.wolfram.com 40

1 a a a Sec -Sin + Sin + a n + n Π 2 2 2 2

Infinite summation B F B F B F Mathematica can calculate infinite sums that contain trigonometric functions. Here are some examples.

¥ zk Sin k x k=1

2 ä x â ä -1@+ ãD z 2 ãä x - z -1 + ãä x z I M ¥ Sin k x I M I M k k=1 ! @ D 1 -ä x ä x âä ãã - ãã 2

¥ Cos k x J N k k=1 1 @ D â -Log 1 - ã-ä x - Log 1 - ãä x 2

Finite products I A E A EM Mathematica can calculate some finite symbolic products that contain the trigonometric functions. Here are two examples.

Π k Product Sin , k, 1, n - 1 n

21-n n B B F 8

Infinite products H L @ D B H LF Mathematica can calculate infinite products that contain trigonometric functions. Here are some examples.

¥ k In[2]:= Exp z Sin k x k=1

ä -1+ã2 ä x z ä A @ DE 2 ä x ä x 2 ã 2 z+ã z-ã 1+z Out[2]= J N

J J NN http://functions.wolfram.com 41

¥ Cos k x In[3]:= Exp k k=1 !

1 -ä x @ä x D -2+ãã +ãã Out[3]= ãä2 B F

IndefiniteJ integrationN

Mathematica can calculate a huge number of doable indefinite integrals that contain trigonometric functions. Here are some examples.

Sin 7 z âz

1 - Cos@ 7Dz à 7

a Sin@ z D, Sin z , Cos z , Cos z a , Tan z , Tan z a ,

Cot z , Cot z a , Csc z , Csc z a , Sec z , Sec z a âz

à 99 @ D @ D = 8 @ D @ D < 8 @ D @ D < 1 1 1 - a 3 -1-a -Cos z , -Cos z Hypergeometric2F1 , , , Cos z 2 Sin z 1+a Sin z 2 2 , 8 @ D @ D < 8 @ D @ D <2 8 2 @ D2 @ D <= H L Cos z 1+a Hypergeometric2F1 1+a , 1 , 3+a , Cos z 2 Sin z 2 2 2 ::Sin z@ ,D - @ D B @ D F @ D ,I @ D M > 1 + a Sin z 2 @ D B @ D F @ D : @ D Hypergeometric2F1 1+a , 1, 1 + 1+a , -Tan z 2 Tan z 1>+a 2 2 -Log Cos z , , H L 1 +@aD

Cot z 1+a Hypergeometric2F1B 1+a , 1, 1 +@1+aD,F-Cot@ zD 2 2 2 :Log Sin@ z@ D,D - >, 1 + a z z -Log Cos + Log@ SinD , B @ D F : @ @ D2D 2 > 1 1 1 + a 3 -1+a -Cos z Csc z -1+a Hypergeometric2F1 , , , Cos z 2 Sin z 2 2 , : B B FF B B FF 2 2 2 z z z z H L -Log Cos - Sin + Log Cos + Sin , @ D 2@ D 2 2 B 2 @ D F I @ D M > Hypergeometric2F1 1-a , 1 , 3-a , Cos z 2 Sec z -1+a Sin z 2 2 2 :- B B F B FF B B F B FF 1 - a Sin z 2 B @ D F @ D @ D Definite integration >> H L @ D Mathematica can calculate wide classes of definite integrals that contain trigonometric functions. Here are some examples.

Π 2 3 Sin z âz 0 ‘

à @ D http://functions.wolfram.com 42

Π Gamma 2 3

2 Gamma 7 6 B F Π 2 SinB Fz , Cos z , Tan z , Cot z , Csc z , Sec z âz 0 ‘ 2 Π Gamma 5 2 Π Gamma 5 Π Π Π Π 4 4 à2 EllipticE: @ D , 2 , 2@EllipticED @ D, 2 , @ ,D , @ D @ D,> 4 4 2 2 Gamma 3 Gamma 3 4 4 A E A E : Π B F B F > 2 Sin z , Sin z a , Cos z , Cos z a , Tan z , Tan z a B, F B F 0 Cot z , Cot z a , Csc z , Csc z a , Sec z , Sec z a âz à 99 @ D @ D = 8 @ D @ D < 8 @ D @ D < Π Gamma 1+a Π Gamma 1+a 2 2 18, @ D @ D <, 81, @ D @ D < 8, @ D @ D <= a Gamma a a Gamma a 2 2

Π B F B F Π 2 1 a Π 2 :: Tan z âz, If Re> a: < 1, Π Sec >, Tan z a âz , 0 A E 2 A E2 0

Π Π 1 a Π 2 Cot z z, If Re a 1, Sec , 2 Cot z a z , :à @ D â B @ D < Π B F à @ D â F> 0 2 2 0

Π Π Gamma 1 - a Π Π Gamma 1 - a 2 2 2 2 2 2 :à Csc@zD âz, B @ D , B SecF àz âz,@ D F> a a 0 2 Gamma 1 - 0 2 Gamma 1 - 2 2 B F B F :à operation@ D > :à @ D >> A E A E Mathematica can calculate limits that contain trigonometric functions.

Sin z Limit + Cos z 3, z ® 0 z

2 @ D B @ D F

1 Tan x x2 Limit , x ® 0 x

ã1 3 @ D B F

Solving‘ equations

The next input solves equations that contain trigonometric functions. The message indicates that the multivalued functions are used to express the result and that some solutions might be absent.

Solve Tan z 2 + 3 Sin z + Pi 6 Š 4, z

Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found. A @ D A ‘ E E http://functions.wolfram.com 43

z ® ArcCos Root 4 - 40 ð12 + 12 ð13 + 73 ð14 - 60 ð15 + 36 ð16 &, 1 , z ® -ArcCos Root 4 - 40 ð12 + 12 ð13 + 73 ð14 - 60 ð15 + 36 ð16 &, 2 , 2 3 4 5 6 99z ® -ArcCosA RootA 4 - 40 ð1 + 12 ð1 + 73 ð1 - 60 ð1 + 36 ð1 &, E3E= , 2 3 4 5 6 9z ® ArcCos RootA 4A - 40 ð1 + 12 ð1 + 73 ð1 - 60 ð1 + 36 ð1 &, 4 EE,= 2 3 4 5 6 9z ® ArcCos RootA 4A - 40 ð1 + 12 ð1 + 73 ð1 - 60 ð1 + 36 ð1 &, 5 EE,= 2 3 4 5 6 9z ® ArcCosARootA4 - 40 ð1 + 12 ð1 + 73 ð1 - 60 ð1 + 36 ð1 &, 6EE= 9 A A EE= Complete solutions can be obtained by using the function Reduce. 9 A A EE== Reduce Sin x Š a, x TraditionalForm

InputForm = C 1 Î@Integers@ D && xD ŠPi - ArcSin a + 2 * Pi * C 1 x Š ArcSin a + 2 * Pi * C 1

Reduce Cos x Š a, x TraditionalForm @ D H @ D @ D ÈÈ @ D @ DL InputForm = C 1 Î Integers && x Š -ArcCos a + 2 * Pi * C 1 x Š ArcCos a + 2 * Pi * C 1 @ @ D D  Reduce Tan x Š a, x TraditionalForm  @ D H @ D @ D ÈÈ @ D @ DL InputForm = C 1 Î Integers && 1 + a^2 ¹ 0 && x Š ArcTan a + Pi * C 1 @ @ D D  Reduce Cot x Š a, x TraditionalForm  @ D @ D @ D InputForm = C 1 Î Integers && 1 + a^2 ¹ 0 && x Š ArcCot a + Pi * C 1 @ @ D D  Reduce Csc x Š a, x TraditionalForm  @ D @ D @ D -1 1 -1 1 c1 Î Z a ¹ 0 x Š -sin + 2 Π c1 + Π x Š sin + 2 Π c1 @ @ D D a a

Reduce Sec x Š a, x TraditionalForm í í ë InputForm = C 1 Î Integers && a ¹ 0 && x Š@-ArcCos@ D a^ -D1 + 2 * Pi * C 1 x Š ArcCos a^ -1 + 2 * Pi * C 1

Solving differential @equationsD H @ H LD @ D ÈÈ @ H LD @ DL Here are differential equations whose linear-independent solutions are trigonometric functions. The solutions of the simplest second-order linear ordinary differential equation with constant coefficients can be represented through sin z and cos z .

DSolve w '' z + w z Š 0, w z , z

HwL z ® C H1L Cos z + C 2 Sin z @ @ D @ D @ D D dsol1 = DSolve 2 w z + 3 w¢¢ z + w 4 z == 0, w z , z 88 @ D @ D @ D @ D @ D<< w z ® C 3 Cos z + C 1 Cos 2H Lz + C 4 Sin z + C 2 Sin 2 z A @ D @ D @ D @ D E In the last input, the differential equation was solved for w z . If the argument is suppressed, the result is returned :: @ D @ D @ D @ D B F @ D @ D @ D B F>> as a pure function (in the sense of the Λ-).

H L http://functions.wolfram.com 44

dsol2 = DSolve 2 w z + 3 w¢¢ z + w 4 z == 0, w, z

w ® Function z , C 3 Cos z +HCL1 Cos 2 z + C 4 Sin z + C 2 Sin 2 z A @ D @ D @ D E The advantage of such a pure function is that it can be used for different arguments, derivatives, and more. :: B8 < @ D @ D @ D B F @ D @ D @ D B FF>> w ' Ζ . dsol1

w¢ Ζ @ D  w ' Ζ . dsol2 8 @ D< C 4 Cos Ζ + 2 C 2 Cos 2 Ζ - C 3 Sin Ζ - 2 C 1 Sin 2 Ζ @ D  All trigonometric functions satisfy first-order nonlinear differential equations. In carrying out the algorithm to solve : @ D @ D @ D B F @ D @ D @ D B F> the nonlinear differential equation, Mathematica has to solve a transcendental equation. In doing so, the generically multivariate inverse of a function is encountered, and a message is issued that a solution branch is potentially missed.

DSolve w¢ z Š 1 - w z 2 , w 0 Š 0 , w z , z

Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found. B: @ D @ D @ D > @ D F w z ® Sin z

DSolve w¢ z 1 w z 2 , w 0 1 , w z , z 88 @ D @ ŠD<< - Š

Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found. B: @ D @ D @ D > @ D F w z ® Cos z

DSolve w ' z - w z 2 - 1 Š 0, w 0 Š 0 , w z , z 88 @ D @ D<< Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found. A9 @ D @ D @ D = @ D E w z ® Tan z

Π DSolve w¢ z + w z 2 + 1 Š 0, w Š 0 , w z , z 88 @ D @ D<< 2 Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found. B: @ D @ D B F > @ D F w z ® Cot z

DSolve w¢ z w z 4 w z 2 , 1 w 0 0 , w z , z Simplify , 0 z Pi 2 & 88 @ D @ ŠD<< - Š ð < <

Solve::verif : Potential solution C 1 ® Indeterminate possibly discarded by verifier should be checked by hand. May require use of limits. B: @ D @ D @ D  @ D > @ D F  A ‘ E Solve::ifun : Inverse functions are8 @beingD used by Solve<,Hso some solutions may not be found. L Solve::verif : Potential solution C 1 ® Indeterminate possibly discarded by verifier should be checked by hand. May require use of limits.

Solve::ifun : Inverse functions are8 @beingD used by Solve<,Hso some solutions may not be found. L http://functions.wolfram.com 45

w z ® -Csc z , w z ® Csc z

Π DSolve w¢ z Š w z 4 - w z 2 , 1 w Š 0 , w z , z Simplify ð, 0 < z < Pi 2 & 88 @ D @ D< 8 @ D @ D<< 2

Solve::verif : Potential solution C 1 ® Indeterminate possibly discardedB: @byDverifier@ Dshould@beD checked“ byB handF . May> require@ D useF of limits. A ‘ E

Solve::ifun : Inverse functions are8 @beingD used by Solve<,Hso some solutions may not be found. L Solve::verif : Potential solution C 1 ® Indeterminate possibly discarded by verifier should be checked by hand. May require use of limits.

Solve::ifun : Inverse functions are8 @beingD used by Solve<,Hso some solutions may not be found. L w z ® -Sec z , w z ® Sec z

Integral transforms 88 @ D @ D< 8 @ D @ D<< Mathematica supports the main integral transforms like direct and inverse Fourier, Laplace, and Z transforms that can give results that contain classical or generalized functions. Here are some transforms of trigonometric functions.

LaplaceTransform Sin t , t, s

1

1 + s2 @ @ D D

FourierTransform Sin t , t, s

Π Π ä DiracDelta -1 + s - ä DiracDelta 1 + s 2 @ @ D D2

FourierSinTransform Sin t , t, s @ D @ D

Π Π DiracDelta -1 + s - DiracDelta 1 + s 2 @ @ D2 D

FourierCosTransform Sin t , t, s @ D @ D 1 1 - + 2 Π -1 + s 2 Π@ 1 @+ sD D

ZTransform Sin Π t , t, s H L H L 0 @ @ D D Plotting

Mathematica has built-in functions for 2D and 3D graphics. Here are some examples.

5 2 Π 2 Π Plot Sin zk , z, - , ; 3 3 k=0

B Bâ F : >F http://functions.wolfram.com 46

1

0.5

-2 -1 1 2

-0.5

-1

Plot3D Re Tan x + ä y , x, -Π, Π , y, 0, Π , PlotPoints ® 240, PlotRange ® -5, 5 , ClipFill ® None, Mesh ® False, AxesLabel ® "x", "y", None ; @ @ @ DD 8 < 8 < 8 < 8

1 1 1 1 1 ContourPlot Arg Sec , x, - , , y, - , , x + ä y 2 2 2 2 PlotPoints ® 400, PlotRange ® -Π, Π , FrameLabel ® "x", "y", None, None , ColorFunctionB B® HueB, ContourLinesFF : ® False> ,:Contours >® 200 ;

8 < 8 < F http://functions.wolfram.com 47

Introduction to the Cosine Function in Mathematica

Overview

The following shows how the cosine function is realized in Mathematica. Examples of evaluating Mathematica functions applied to various numeric and exact expressions that involve the cosine function or return it are shown. These involve numeric and symbolic calculations and plots.

Notations

Mathematica forms of notations

Following Mathematica's general naming convention, function names in StandardForm are just the capitalized versions of their traditional mathematics names. This shows the cosine function in StandardForm.

Cos z

Cos z @ D This shows the cosine function in TraditionalForm. @ D % TraditionalForm

cos z  Additional forms of notations H L Mathematica also knows the most popular forms of notations for the cosine function that are used in other program- ming languages. Here are three examples: CForm, TeXForm, and FortranForm.

CForm Cos 2 Π z , FortranForm Cos 2 Π z , TeXForm Cos 2 Π z

Cos 2 * Pi * z , Cos 2 * Pi * z , \ cos 2 \, \ pi \, z 8 @ @ DD @ @ DD @ @ DD< Automatic evaluations and transformations 8 H L H L H L< http://functions.wolfram.com 48

Evaluation for exact, machine-number, and high-precision arguments

For the exact argument z = Π 4, Mathematica returns an exact result.

Π Cos 4  1 B F 2

Π Cos z . z ® 4 1 @ D  2

For a machine-number argument (a numerical argument with a decimal point and not too many digits), a machine number is also returned.

Cos 5.

0.283662 @ D Cos z . z ® 3.

-0.989992 @ D  The next inputs calculate 100-digit approximations at z = 1 and z = 2.

N Cos z . z ® 1, 100

0.5403023058681397174009366074429766037323104206179222276700972553811003947744717645„ @179518560871830893@ D  D

N Cos 2 , 100

-0.416146836547142386997568229500762189766000771075544890755149973781964936124079169„ @0745317778601691404@ D D

Cos 2 N ð, 100 &

-0.416146836547142386997568229500762189766000771075544890755149973781964936124079169„ 0745317778601691404@ D  @ D

Within a second, it is possible to calculate thousands of digits for the cosine function. The next input calculates 10000 digits for cos 1 and analyzes the frequency of the digit k in the resulting decimal number.

Map Function w, First ð , Length ð & ž Split Sort First RealDigits w , N Cos z . zH ®L 1, 10 000 0@, 998 , @1, 10348 , @2,D982 , 3,@ 1015D< , @ @ @ @ DDDDD @84, 1013@ D<, 5, 963 , 6, 1034DD , 7, 966 , 8, 991 , 9, 1004

Here888 is a 50-

N Cos 3 + 2 ä , 50

-3.7245455049153225654739707032559725286749657732153- @0.51182256998738460883446384980187563424555660949074@ D D ä

N Cos z . z ® 3 + 2 ä, 50 , Cos 3 + 2 ä N ð, 50 &

-3.7245455049153225654739707032559725286749657732153- 8 @0.51182256998738460883446384980187563424555660949074@ D  D @ D  @ D < ä, -3.7245455049153225654739707032559725286749657732153- 8 0.51182256998738460883446384980187563424555660949074ä

Mathematica automatically evaluates mathematical functions with machine precision, if the arguments of the function are machine-number elements. In this case, only six digits after the< decimal point are shown in the results. The remaining digits are suppressed, but can be displayed using the function InputForm.

Cos 2. , N Cos 2 , N Cos 2 , 16 , N Cos 2 , 5 , N Cos 2 , 20

-0.416147, -0.416147, -0.416147, -0.416147, -0.41614683654714238700 8 @ D @ @ DD @ @ D D @ @ D D @ @ D D< % InputForm 8 < {-0.4161468365471424, -0.4161468365471424, -0.4161468365471424, -0.4161468365471424, -0.416146836547142386997568229500762`20}

Simplification of the argument

Mathematica knows the symmetry and periodicity of the cosine function. Here are some examples:

Cos -3

Cos 3 @ D Cos -z , Cos z + Π , Cos z + 2 Π , Cos z + 342 Π , Cos -z + 21 Π @ D Cos z , -Cos z , Cos z , Cos z , -Cos z 8 @ D @ D @ D @ D @ D< Mathematica automatically simplifies the composition of the direct and the inverse cosine functions into its a8rgum@entD. @ D @ D @ D @ D<

Cos ArcCos z

z @ @ DD Mathematica also automatically simplifies the composition of the direct and any of the inverse trigonometric functions into algebraic functions of the argument.

In[1]:= Cos ArcSin z , Cos ArcCos z , Cos ArcTan z , Cos ArcCot z , Cos ArcCsc z , Cos ArcSec z

1 1 1 1 8 @ 2 @ DD @ @ DD @ @ DD Out[1]= 1 - z , z, , , 1 - , @ @ DD @ @ DD @ 2 @ DD< 2 z z 1 + z 1 + 1 z2 : > http://functions.wolfram.com 50

If the argument has the structure Π k 2 + z or Π k 2 - z, and Π k 2 + ä z or Π k 2 - ä z with integer k, the cosine function can be automatically transformed into trigonometric or hyperbolic sine or cosine functions.

Π Cos - 4     2 Sin 4 B F Π Π Π Π Cos - z , Cos + z , Cos - - z , Cos - + z , Cos Π - z , Cos Π + z @ D2 2 2 2 Sin z , -Sin z , -Sin z , Sin z , -Cos z , -Cos z : B F B F B F B F @ D @ D> Cos ä 5 8 @ D @ D @ D @ D @ D @ D< Cosh 5 @ D Π Π Cos ä z , Cos - ä z , Cos + ä z , Cos Π - ä z , Cos Π + ä z @ D 2 2 Cosh z , ä Sinh z , -ä Sinh z , -Cosh z , -Cosh z : @ D B F B F @ D @ D> Simplification of simple expressions containing the cosine function 8 @ D @ D @ D @ D @ D< Sometimes simple arithmetic operations containing the cosine function can automatically produce other trigonomet- ric functions.

1 Cos 4

Sec 4  @ D 1 Cos z , 1 Cos Π 2 - z , Cos Π 2 - z Cos z , Cos@ zD Cos Π 2 - z , 1 Cos Π 2 - z , Cos Π 2 - z Cos z ^2

8Sec z @, CscD z , Tan@ z , CotD z ,@ Csc z D,Sec @z DTan z @ D  @  D  @  D @  D  @ D < The cosine function arising as special cases from more general functions 8 @ D @ D @ D @ D @ D @ D @ D< The cosine function can be treated as a particular case of some more general special functions. For example, cos z can appear automatically from Bessel, Mathieu, Jacobi, hypergeometric, and Meijer functions for appropriate values of their parameters. H L 1 BesselJ - , z , MathieuC 1, 0, z , JacobiCD z, 0 , 2 1 z2 1 z2 Hypergeometric0F1 , - , MeijerG , , 0 , , : B F 2 4@ D @ D 2 4

2 Cos z B F B88< 8<< :8 < : >> F> Π Cos z , Cos z , Cos z , Cos z2 , z Π @ D @ D Equivalence: transformations@ D @ D carriedB outF by specialized> Mathematica functions

General remarks http://functions.wolfram.com 51

Almost everybody prefers using cos z 2 instead of sin Π 2 - z cos Π 3 . Mathematica automatically transforms the second expression into the first one. The automatic application of transformation rules to mathematical expres- sions can give overly complicated results. Compact expressions like cos 2 z cos Π 16 should not be automatically H L  H  L H  L 1 2 1 2 expanded into the more complicated expression cos2 z - 1 2 + 2 + 21 2 . Mathematica has special func- 2 tions that produce such expansions. Some are demonstrated in the next section.H L H  L   TrigExpand I H L M J I M N

The function TrigExpand expands out trigonometric and hyperbolic functions. In more detail, it splits up sums and integer multiples that appear in arguments of trigonometric and hyperbolic functions, and then expands out products of trigonometric and hyperbolic functions into sums of powers, using trigonometric and hyperbolic identities where possible. Here are some examples.

TrigExpand Cos x - y

Cos x Cos y + Sin x Sin y @ @ DD Cos 4 z TrigExpand @ D @ D @ D @ D Cos z 4 - 6 Cos z 2 Sin z 2 + Sin z 4 @ D  Cos 2 z 2 TrigExpand @ D @ D @ D @ D 1 Cos z 4 Sin z 4 + - 3 Cos z 2 Sin z 2 + 2 @ D2  2

TrigExpand@ D Cos x + y + z , Cos 3 z @ D @ D @ D Cos x Cos y Cos z - Cos z Sin x Sin y - Cos y Sin x Sin z - Cos x Sin y Sin z , Cos z 3 - 3@8Cos @z Sin zD2 @ D

9 @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D @ D TrigFactor @ D @ D @ D = The function TrigFactor factors trigonometric and hyperbolic functions. In more detail, it splits up sums and integer multiples that appear in the arguments of trigonometric and hyperbolic functions, and then factors the resulting polynomials into trigonometric and hyperbolic functions, using trigonometric and hyperbolic identities where possible. Here are some examples.

TrigFactor Cos x + Cos y x y x y 2 Cos - Cos + 2 2@ @ D2 2 @ DD

Cos x + Sin y TrigFactor B F B F x y x y x y x y Cos - - Sin - Cos + + Sin + @ D2 2 @ D  2 2 2 2 2 2

TrigReduce B F B F B F B F http://functions.wolfram.com 52

The function TrigReduce rewrites the products and powers of trigonometric and hyperbolic functions in terms of trigonometric and hyperbolic functions with combined arguments. In more detail, it typically yields a linear expression involving trigonometric and hyperbolic functions with more complicated arguments. TrigReduce is approximately inverse to TrigExpand and TrigFactor. Here are some examples.

TrigReduce Cos x Cos y

1 Cos x - y + Cos x + y 2 @ @ D @ DD

Sin x Cos y TrigReduce H @ D @ DL 1 Sin x - y + Sin x + y 2 @ D @ D 

Table TrigReduce Cos z ^n , n, 2, 5 H @ D @ DL 1 1 1 + Cos 2 z , 3 Cos z + Cos 3 z , 2 @ @4 @ D D 8

TrigReduce TrigExpand Cos x + y + z , Cos 3 z , Cos x Cos y H @ D @ DL H @ D @ D @ DL> 1 Cos x + y + z , Cos 3 z , Cos x - y + Cos x + y @ @8 2 @ D @ D @ D @ D

TrigFactor Cos x + Cos y TrigReduce : @ D @ D H @ D @ DL> Cos x + Cos y @ @ D @ DD  TrigToExp @ D @ D The function TrigToExp converts trigonometric and hyperbolic functions to exponentials. It tries, where possible, to give results that do not involve explicit complex numbers. Here are some examples.

TrigToExp Cos z

ã-ä z ãä z + 2 2 @ @ DD

Cos a z + Cos b z TrigToExp

1 1 1 1 ã-ä a z + ãä a z + ã-ä b z + ãä b z 2 @ D 2 @ D2 2

ExpToTrig

The function ExpToTrig converts exponentials to trigonometric and hyperbolic functions. It is approximately inverse to TrigToExp. Here are some examples.

ExpToTrig TrigToExp Cos z

Cos z @ @ @ DDD

@ D http://functions.wolfram.com 53

Α ã-ä x Β + Α ãä x Β, Α ã-ä x Β + Γ ãä x Β ExpToTrig

2 Α Cos x Β , Α Cos x Β + Γ Cos x Β - ä Α Sin x Β + ä Γ Sin x Β 9 =  ComplexExpand 8 @ D @ D @ D @ D @ D< The function ComplexExpand expands expressions assuming that all the variables are real. The value option TargetFunctions is a list of functions from the set {Re, Im, Abs, Arg, Conjugate, Sign}. ComplexExpand tries to give results in terms of the functions specified. Here are some examples.

ComplexExpand Cos x + ä y

Cos x Cosh y - ä Sin x Sinh y @ @ DD Cos x + ä y + Cos x - ä y ComplexExpand @ D @ D @ D @ D 2 Cos x Cosh y @ D @ D  ComplexExpand Re Cos x + ä y , TargetFunctions ® Re, Im @ D @ D Cos x Cosh y @ @ @ DD 8

Cos 2 x + Cosh@ 2@y @ DD 8

Cos x Cosh y - Sin x Sinh y @ @ @ DD @ @ DD 8

ArcTan Cos x @Cosh@ y ,@-Sin xDD Sinh y 8

The function Simplify performs a sequence of algebraic transformations on its argument, and returns the simplest form it finds. Here are some examples.

Cos 2 ArcCos z -1 + 2 z2 Simplify

1 @ @ DD ‘ I M  2 Simplify Cos 2 z - Cos z 2 , Cos 2 z + Sin z Simplify

-Sin z 2, Cos z 2 : A @ D @ D E @ D @ D  > Here is a large collection of trigonometric identities. All are written as one large logical conjunction. 9 @ D @ D =

2 Simplify ð & ž Cos z 2 + Sin z == 1

@ D1 + Cos 2 z@ D @ D í Cos z 2 == 2 Cos 2 z Cos z 2 Sin z 2 2 Cos z 2 1 Š @- D Š - @ D í Cos a + b Š Cos a Cos b - Sin a Sin b Cos@ Da - b Š@ CosD a Cos@ Db + Sin @a D Sin bí @ D @ D @ D @ D @ D í a + b a - b a + b b - a Cos a @+ CosDb Š 2 @CosD @ D Cos @ D @ CosD í a - Cos b Š 2 Sin Sin 2 2 2 2

B2 B A Sin@ Dz + B Cos@ D z Š A B 1 + F SinB z + FArcTaní @ D @ D B F B F í A2 A Cos a - b + Cos a + b Cos a@ CosD b Š@ D B B FF í 2

Sin@ aD+ b + Sin@ aD- b z 2 1 + Cos z Sin@ D a Cos@ D b Š í Cos Š 2 2 2

@ D @ D @ D True @ D @ D í B F

The function Simplify has the Assumption option. For example, Mathematica knows that -1 £ cos x £ 1 for all real x, and knows about the periodicity of trigonometric functions for the symbolic integer coefficient k of k Π.

Simplify Abs Cos x £ 1, x Î Reals H L

True @ @ @ DD D Abs Cos x £ 1 Simplify ð, x Î Reals &

True @ @ DD  @ D Simplify Cos z + 2 k Π , Cos z + k Π Cos z , k Î Integers

Cos z , -1 k @8 @ D @ D  @ D< D

9 @ D H L = http://functions.wolfram.com 55

Mathematica also knows that the composition of the inverse and direct trigonometric functions produces the value of the internal argument under the corresponding restriction.

ArcCos Cos z

ArcCos Cos z @ @ DD Simplify ArcCos Cos z , 0 < Re z < Π @ @ DD z @ @ @ DD @ D D FunctionExpand (and Together)

While the cosine function auto-evaluates for simple fractions of Π, for more complicated cases it stays as a cosine function to avoid the build up of large expressions. Using the function FunctionExpand, the cosine function can sometimes be transformed into explicit radicals. Here are some examples.

Π Π Cos , Cos 16 60 Π Π Cos , Cos : B 16 F B 60 F>

FunctionExpand[%] : B F B F>

- 1 3 -1 + 5 - 1 1 5 + 5 1 -1 + 5 - 1 3 5 + 5 1 8 4 2 8 4 2 2 + 2 + 2 , - - 2 2 2 J N J N J N J N :Together % >

1 1 2 + @ 2D+ 2 , 2 - 6 - 10 + 30 + 2 5 + 5 + 2 3 5 + 5 2 16

If: the denominator contains squares of integers other than 2, the results always containJ complexN > numbers (meaning that the imaginary number ä = -1 appears unavoidably).

Π Cos 9 Π Cos : B 9 F>

FunctionExpand[%] // Together : B F>

1 1 3 22 3 -1 - ä 3 + 8 ‘ ‘ 1 3 1 3 1 3 ä 22 3 3 -1 - ä 3 + 22 3 -1 + ä 3 - ä 22 3 3 -1 + ä 3 : J N ‘ ‘ ‘ ‘ ‘ ‘ The function RootReduce allows for writing the last algebraic numbers as roots of polynomial equations. J N J N J N > RootReduce Simplify %

@ @ DD http://functions.wolfram.com 56

Root -1 - 6 ð1 + 8 ð13 &, 3

The function FunctionExpand also reduces trigonometric expressions with compound arguments or composi- tions,9 includingA inverse trigonometricE= functions, to simpler ones. Here are some examples.

ArcCos z Cos z2 , Cos , Cos 3 ArcCos z FunctionExpand 2

1 + z @ D :CosBz , F B, z3 - 3 z 1 F- z2 @ @ DD>  2

Applying: @ D Simplify to the last expressionI M> gives a more compact result.

Simplify %

1 z + 2 Cos z ,@ D , z -3 + 4 z 2

F:ullSi@mpDlify I M>

The function FullSimplify tries a wider range of transformations than Simplify and returns the simplest form it finds. Here are some examples that contrast the results of applying the functions Simplify and FullSimplify to the same expressions.

Π set1 = Cos -ä Log ä z + 1 - z2 , Cos + ä Log ä z + 1 - z2 , 2 1 1 1 ä 1 ä Cos ä Log 1 - ä z - ä Log 1 + ä z , Cos ä Log 1 - - ä Log 1 + , :2 B B 2 FF B 2 B z 2FF z

1 ä Π 1 ä CosB-ä Log @ 1 - D + , Cos@ +DäF Log B 1 - B+ F B FF z2 z 2 z2 z

2 2 B B FF B 2 B FF> 1 + ä z + 1 - z2 ä -1 + ä z + 1 - z 1 1 , - , Cosh Log 1 - ä z - Log 1 + ä z , 2 2 2 ä z + 1 - z2 2 ä z + 1 - z2

: B @ D @ DF 2 2 1 1 ä ä -1 + 1 - + ä 1 + 1 - + 2 2 z z z 1 ä 1 ä z Cosh Log 1 - - Log 1 + , , - 2 z 2 z 2 1 - 1 + ä 2 1 - 1 + ä z2 z z2 z B B F B FF > set1 Simplify

 http://functions.wolfram.com 57

1 - z2 + ä z 1 - z2 1 , z, Cosh Log 1 - ä z - Log 1 + ä z , 2 ä z + 1 - z2

: B H @ D @ DLF -1 + ä 1 - 1 z + z2 1 -ä + z ä + z z2 1 Cosh Log - Log , , 2 z z z z ä + 1 - 1 z z2 B B F B F F > set1 FullSimplify

1 1 1 1 1 - z2 , z, , , 1 - ,  2 2 z z 1 + z 1 + 1 z2 : > Operations carried out by specialized Mathematica functions

Series expansions

Calculating the series expansion of a cosine function to hundreds of terms can be done in seconds.

Series Cos z , z, 0, 3

z2 1 - + O z 4 2 @ @ D 8

Normal % @ D z2 1 - 2 @ D

Series Cos z , z, 0, 100 Timing

z2 z4 z6 z8 z10 8.53484 ´ 10-16 Second, 1 - + - + - + @ @ D 8

+ http://functions.wolfram.com 58

z38 + 523 022 617 466 601 111 760 007 224 100 074 291 200 000 000 z40 - 815 915 283 247 897 734 345 611 269 596 115 894 272 000 000 000 z42 + 1 405 006 117 752 879 898 543 142 606 244 511 569 936 384 000 000 000 z44 - 2 658 271 574 788 448 768 043 625 811 014 615 890 319 638 528 000 000 000 z46 + 5 502 622 159 812 088 949 850 305 428 800 254 892 961 651 752 960 000 000 000 z48 - 12 413 915 592 536 072 670 862 289 047 373 375 038 521 486 354 677 760 000 000 000 z50 + 30 414 093 201 713 378 043 612 608 166 064 768 844 377 641 568 960 512 000 000 000 000 z52 - 80 658 175 170 943 878 571 660 636 856 403 766 975 289 505 440 883 277 824 000 000 000 000 z54 + 230 843 697 339 241 380 472 092 742 683 027 581 083 278 564 571 807 941 132 288 000 000 000 000 z56 710 998 587 804 863 451 854 045 647 463 724 949 736 497 978 881 168 458 687 447 040 000 000 000 000 - z58 ‘ 2 350 561 331 282 878 571 829 474 910 515 074 683 828 862 318 181 142 924 420 699 914 240 000 000 „ 000 000 + z60 ‘ 8 320 987 112 741 390 144 276 341 183 223 364 380 754 172 606 361 245 952 449 277 696 409 600 000 „ 000 000 000 - z62 ‘ 31 469 973 260 387 937 525 653 122 354 950 764 088 012 280 797 258 232 192 163 168 247 821 107 200 „ 000 000 000 000 + z64 ‘ 126 886 932 185 884 164 103 433 389 335 161 480 802 865 516 174 545 192 198 801 894 375 214 704 „ 230 400 000 000 000 000 - z66 ‘ 544 344 939 077 443 064 003 729 240 247 842 752 644 293 064 388 798 874 532 860 126 869 671 081 „ 148 416 000 000 000 000 000 + z68 ‘ 2 480 035 542 436 830 599 600 990 418 569 171 581 047 399 201 355 367 672 371 710 738 018 221 445 „ 712 183 296 000 000 000 000 000 - z70 ‘ 11 978 571 669 969 891 796 072 783 721 689 098 736 458 938 142 546 425 857 555 362 864 628 009 582 „ 789 845 319 680 000 000 000 000 000 + z72 ‘ 61 234 458 376 886 086 861 524 070 385 274 672 740 778 091 784 697 328 983 823 014 963 978 384 987 „ 221 689 274 204 160 000 000 000 000 000 - z74 ‘ 330 788 544 151 938 641 225 953 028 221 253 782 145 683 251 820 934 971 170 611 926 835 411 235 „ 700 971 565 459 250 872 320 000 000 000 000 000 + z76 ‘ 1 885 494 701 666 050 254 987 932 260 861 146 558 230 394 535 379 329 335 672 487 982 961 844 043 „ 495 537 923 117 729 972 224 000 000 000 000 000 000 - z78 ‘ 11 324 281 178 206 297 831 457 521 158 732 046 228 731 749 579 488 251 990 048 962 825 668 835 325 „ + ‘ http://functions.wolfram.com 59

11 324 281 178 206 297 831 457 521 158 732 046 228 731 749 579 488 251 990 048 962 825 668 835 325 „ 234 200 766 245 086 213 177 344 000 000 000 000 000 000 + z80 71 569 457 046 263 802 294 811 533 723 186 532 165 584 657 342 365 752 577 109 445 058 227 039 255 „ 480 148 842 668 944 867 280 814 080 000 000 000 000 000 000 - z82 ‘ 475 364 333 701 284 174 842 138 206 989 404 946 643 813 294 067 993 328 617 160 934 076 743 994 „ 734 899 148 613 007 131 808 479 167 119 360 000 000 000 000 000 000+ z84 ‘ 3 314 240 134 565 353 266 999 387 579 130 131 288 000 666 286 242 049 487 118 846 032 383 059 131 „ 291 716 864 129 885 722 968 716 753 156 177 920 000 000 000 000 000 000- z86 ‘ 24 227 095 383 672 732 381 765 523 203 441 259 715 284 870 552 429 381 750 838 764 496 720 162 249 „ 742 450 276 789 464 634 901 319 465 571 660 595 200 000 000 000 000 000 000+ z88 ‘ 185 482 642 257 398 439 114 796 845 645 546 284 380 220 968 949 399 346 684 421 580 986 889 562 „ 184 028 199 319 100 141 244 804 501 828 416 633 516 851 200 000 000 000 000 000 000- z90 ‘ 1 485 715 964 481 761 497 309 522 733 620 825 737 885 569 961 284 688 766 942 216 863 704 985 393 „ 094 065 876 545 992 131 370 884 059 645 617 234 469 978 112 000 000 000 000 000 000 000+ z92 ‘ 12 438 414 054 641 307 255 475 324 325 873 553 077 577 991 715 875 414 356 840 239 582 938 137 710 „ 983 519 518 443 046 123 837 041 347 353 107 486 982 656 753 664 000 000 000 000 000 000 000- z94 ‘ 108 736 615 665 674 308 027 365 285 256 786 601 004 186 803 580 182 872 307 497 374 434 045 199 „ 869 417 927 630 229 109 214 583 415 458 560 865 651 202 385 340 530 688 000 000 000 000 000 000 „ ‘ 000 + z96 991 677 934 870 949 689 209 571 401 541 893 801 158 183 648 651 267 795 444 376 054 838 492 222 „ 809 091 499 987 689 476 037 000 748 982 075 094 738 965 754 305 639 874 560 000 000 000 000 000 „ ‘ 000 000 - z98 9 426 890 448 883 247 745 626 185 743 057 242 473 809 693 764 078 951 663 494 238 777 294 707 070 „ 023 223 798 882 976 159 207 729 119 823 605 850 588 608 460 429 412 647 567 360 000 000 000 000 „ ‘ 000 000 000 + z100 93 326 215 443 944 152 681 699 238 856 266 700 490 715 968 264 381 621 468 592 963 895 217 599 993 „ 229 915 608 941 463 976 156 518 286 253 697 920 827 223 758 251 185 210 916 864 000 000 000 000 „ ‘ 000 000 000 000 + O z 101

Mathematica comes with the add-on package DiscreteMath`RSolve` that allows finding the general terms of @ D > the series for many functions. After loading this package, and using the package function SeriesTerm, the follow- ing nth term of cos z can be evaluated.

In[2]:= << DiscreteMath`RSolve` H L In[3]:= SeriesTerm Cos z , z, 0, n z^n

än zn KroneckerDelta Mod n, 2 Out[3]= Gamma@ @ 1D+ n8

This result can be checked@ by the@ followingDD process. @ D ¥ In[4]:= FunctionExpand Evaluate % n=0

Cos z Out[4]= Bâ @ DF

Differentiation @ D http://functions.wolfram.com 60

Mathematica can evaluate derivatives of the cosine function of an arbitrary positive integer order.

¶z Cos z

-Sin z @ D ¶ z,2 Cos z @ D -Cos z 8 < @ D Table D Cos z , z, n , n, 10 @ D -Sin z , -Cos z , Sin z , Cos z , -Sin z , -Cos z , Sin z , Cos z , -Sin z , -Cos z @ @ @ D 8

n Cos a k k=1 a n a a a n -â1 + Cos@ D Csc Sin + 2 2 2 2

n -1 kBCosFa k B F B F k=1 a n n Π a a n n Π a -â1 H+ CosL @+ D Cos + + Sec 2 2 2 2 2 2

Infinite summation B F B F B F Mathematica can calculate infinite sums including the cosine function. Here are some examples.

¥ zk Cos k x k=1

2 ä x ä x â z 1 + @ã D- 2 ã z - 2 ãä x - z -1 + ãä x z I M ¥ Cos k x I M I M k k=1 ! @ D 1 -ä x ä x â -2 + ãã + ãã 2

¥ Cos k x J N k k=1 1 @ D â -Log 1 - ã-ä x - Log 1 - ãä x 2

Finite products I A E A EM http://functions.wolfram.com 61

Mathematica can calculate some finite symbolic products that contain the cosine function. Here is an example.

n-1 Π k Cos z + n k=1 1 -ä-1 nB21-n SecF z Sin n Π - 2 z 2

Indefinite integration H L @ D B H LF Mathematica can calculate a huge number of doable indefinite integrals that contain the cosine function. Here are some examples.

Cos z âz

Sin z à @ D

Cos z a âz @ D

Cos z 1+a Hypergeometric2F1 1+a , 1 , 3+a , Cos z 2 Sin z @ D 2 2 2 à- 1 + a Sin z 2 @ D B @ D F @ D Definite integration H L @ D Mathematica can calculate wide classes of definite integrals that contain the cosine function. Here are some examples.

Π 2 Cos z âz 0 ‘ Π 2 EllipticE@ D , 2 à 4

Π 2 Cos z a âBz F 0

Π Gamma 1+a à @ D 2 a Gamma a 2 B F Limit operation A E Mathematica can calculate limits that contain the cosine function. Here are some examples.

Cos 2 z - 1 Limit , z ® 0 z2 -2 @ D B F http://functions.wolfram.com 62

Cos z2 - 1 Limit , z ® 0 z2 1 B F - B F 2

1 4 Cos z2 - 1 In[573]:= Limit , z ® 0, Direction ® 1 z ‘ 1 BI M F Out[573]= B F 2

1 4 Cos z2 - 1 In[574]:= Limit , z ® 0, Direction ® -1 z ‘ 1 BI M F Out[574]= - B F 2

Solving equations

The next inputs solve two equations that contain the cosine function. Because of the multivalued nature of the inverse cosine function, a printed message indicates that only some of the possible solutions are returned.

Solve Cos z 2 + 4 Cos z - Pi 6 Š 4, z

Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found. A @ D A ‘ E E 1 20 1 1 3 2 1 3 z ® ArcCos - 3 - + 22 112 - 288 85 + 22 3 691 + 9 85 - 2 3 3 3 ‘ ‘ ‘ :: B J N J N 1 40 1 1 3 2 1 3 - 22 112 - 288 85 - 22 3 691 + 9 85 - 2 3 3 3 ‘ ‘ ‘ J N J N

16 , 1 3 1 3 1 20 + 1 22 112 - 288 85 + 2 22 3 691 + 9 85 3 3 3 3

‘ ‘ F> ‘ 1 20 1 1 3 2 1 3 z ® ArcCos - 3 - J + 22 112 N- 288 85 J + 22 3 691N + 9 85 + 2 3 3 3 ‘ ‘ ‘ : B J N J N 1 40 1 1 3 2 1 3 - 22 112 - 288 85 - 22 3 691 + 9 85 - 2 3 3 3 ‘ ‘ ‘ J N J N

,

F> http://functions.wolfram.com 63

16 , 1 3 1 3 1 20 + 1 22 112 - 288 85 + 2 22 3 691 + 9 85 3 3 3 3

‘ ‘ F> ‘ 1 20 1 1 3 2 1 3 z ® ArcCos - 3 + J + 22 112 N- 288 85 J + 22 3 691N + 9 85 - 2 3 3 3 ‘ ‘ ‘ : B J N J N 1 40 1 1 3 2 1 3 - 22 112 - 288 85 - 22 3 691 + 9 85 + 2 3 3 3 ‘ ‘ ‘ J N J N

16 , 1 3 1 3 1 20 + 1 22 112 - 288 85 + 2 22 3 691 + 9 85 3 3 3 3

‘ ‘ F> ‘ 1 20 1 1 3 2 1 3 z ® -ArcCos - 3 + J + 22 112N- 288 85 J + 22 3 N691 + 9 85 + 2 3 3 3 ‘ ‘ ‘ : B J N J N 1 40 1 1 3 2 1 3 - 22 112 - 288 85 - 22 3 691 + 9 85 + 2 3 3 3 ‘ ‘ ‘ J N J N

16

1 3 1 3 1 20 + 1 22 112 - 288 85 + 2 22 3 691 + 9 85 3 3 3 3

‘ ‘ F>> ‘ Solve Cos x Š a, x J N J N Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found. @ @ D D x ® -ArcCos a , x ® ArcCos a

A complete solution of the previous equation can be obtained using the function Reduce. 88 @ D< 8 @ D<< Reduce Cos x Š a, x InputForm

InputForm = C 1 Î Integers && x Š -ArcCos a + 2 * Pi * C 1 x Š ArcCos a + 2 * Pi * C 1 @ @ D D 

Solving differential @equationsD H @ D @ D ÈÈ @ D @ DL

Here are differential equations whose linear independent solutions include the cosine function. The solutions of the simplest second-order linear ordinary differential equation with constant coefficients can be represented using sin z and cos z .

H L H L http://functions.wolfram.com 64

DSolve w '' z + w z Š 0, w z , z

w z ® C 1 Cos z + C 2 Sin z @ @ D @ D @ D D ¢¢ 4 In[9]:= dsol1 = DSolve 2 w z + 3 w z + w z == 0, w z , z 88 @ D @ D @ D @ D @ D<< H L Out[9]= w z ® C 3 Cos z + C 1 Cos 2 z + C 4 Sin z + C 2 Sin 2 z A @ D @ D @ D @ D E In the last input, the differential equation was solved for w z . If the argument is suppressed, the result is returned :: @ D @ D @ D @ D B F @ D @ D @ D B F>> as a pure function (in the sense of the Λ-calculus).

¢¢ 4 In[10]:= dsol2 = DSolve 2 w z + 3 w z + w z == 0, w,HzL

H L Out[10]= w ® Function z , C 3 Cos z + C 1 Cos 2 z + C 4 Sin z + C 2 Sin 2 z A @ D @ D @ D E The advantage of such a pure function is that it can be used for different arguments, derivatives, and more. :: B8 < @ D @ D @ D B F @ D @ D @ D B FF>>

In[11]:= w ' Ζ . dsol1

¢ Out[11]= w Ζ @ D  In[12]:= w ' Ζ . dsol2 8 @ D< Out[12]= C 4 Cos Ζ + 2 C 2 Cos 2 Ζ - C 3 Sin Ζ - 2 C 1 Sin 2 Ζ @ D  In carrying out the algorithm to solve the following nonlinear differential equation, Mathematica has to solve a : @ D @ D @ D B F @ D @ D @ D B F> transcendental equation. In doing so, the generically multivariate inverse of a function is encountered, and a message is issued that a solution branch is potentially missed.

¢ 2 In[13]:= DSolve w z == 1 - w z , w 0 Š 1 , w z , z

Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found. B: @ D @ D @ D > @ D F Out[13]= w z ® Cos z

Integral transforms 88 @ D @ D<< Mathematica supports the main integral transforms like direct and inverse Fourier, Laplace, and Z transforms that can give results that contain classical or generalized functions.

LaplaceTransform Cos t , t, s s

1 + s2 @ @ D D

FourierTransform Cos t , t, s

Π Π DiracDelta -1 + s + DiracDelta 1 + s 2 @ @ D 2 D

FourierSinTransform Cos t , t, s @ D @ D

@ @ D D http://functions.wolfram.com 65

1 1 + 2 Π -1 + s 2 Π 1 + s

FourierCosTransform Cos t , t, s H L H L Π Π DiracDelta -1 + s + DiracDelta 1 + s 2 @ @ D2 D

ZTransform Cos t , t, s @Π D @ D s 1 + s @ @ D D

Plotting

Mathematica has built-in functions for 2D and 3D graphics. Here are some examples.

5 2 Π 2 Π Plot Cos zk , z, - , ; 3 3 k=0

Plot3DB ReBâCos Fx +:ä y , x, -Π>,FΠ , y, 0, Π , PlotPoints ® 240, PlotRange ® -5, 5 , ClipFill ® None, Mesh ® False, AxesLabel ® "x", "y", None ; @ @ @ DD 8 < 8 < 1 8 1 < 1 1 1 ContourPlot Arg Cos , x, - , , y, - , , x + ä y 2 2 8 2 2 ,:Contours >® 200 ;

8 < 8 < F http://functions.wolfram.com 66

Copyright

This document was downloaded from functions.wolfram.com, a comprehensive online compendium of formulas involving the special functions of mathematics. For a key to the notations used here, see http://functions.wolfram.com/Notations/.

Please cite this document by referring to the functions.wolfram.com page from which it was downloaded, for example: http://functions.wolfram.com/Constants/E/

To refer to a particular formula, cite functions.wolfram.com followed by the citation number. e.g.: http://functions.wolfram.com/01.03.03.0001.01

This document is currently in a preliminary form. If you have comments or suggestions, please email [email protected].

© 2001-2008, Wolfram Research, Inc.