Trigonometry

Define sin(θ) and cos(θ) as the side lengths of the above triangle. Note that these values are defined for all real values of θ, for example with τ4<θ<τ2, sin(θ) is positive but cos(θ) is negative.

In the above graph, the red line is sin while the blue line is cos.

Observe that sin(θ)=cos(θτ4) and sin(θ)=sin(θ+τ2). Since sin and cos are odd and even functions respectively, we have sin(θ)=sin(θ) and cos(θ)=cos(θ). Since both functions are τ-periodic, we also have sin(θ)=sin(θ+τ) and cos(θ)=cos(θ+τ).

By the Pythagorean theorem, we also have sin2(θ)+cos2(θ)=1. Note that sina(θ) is shorthand for (sin(θ))a for positive a. sin1(θ) means something else entirely.

We also define the function tan(θ)=sin(θ)cos(θ). Intuitively, it is the gradient of the line with angle θ. Below is the graph of tan.

Along with those three functions, we also have csc(θ)=1sin(θ), sec(θ)=1cos(θ) and cot(θ)=1cot(θ). They exist for historical reasons because of function tables. We really only need sin and cos.

Sine Rule

sin(α)A=sin(b)B

Proof:
Drop the red perpendicular line. The length of the perpendicular line is Asin(β) or Bsin(α).
Since we have Asin(β)=Bsin(α), sin(α)A=sin(b)B follows.

Addition of Trigonometric Functions

sin(α+β)=sin(α)cos(β)+cos(α)sin(β)

Proof:

In the above diagram, we have A+Bsin(α+β)=Lsin(θ) by sine rule and A=Lsin(α) by the definition of sin.

A+Bsin(α+β)=Lsin(θ)=Asin(α)sin(θ)=Asin(α)sin(τ4β)=Asin(α)cos(β)

Therefore, (A+B)(sin(α)cos(β))=A(sin(α+β))
By symmetry, we also have (A+B)(sin(β)cos(α))=B(sin(α+β))
Adding both equations, we obtain (A+B)(sin(α)cos(β)+sin(β)cos(α))=(A+B)(sin(α+β))
Therefore, sin(α+β)=sin(α)cos(β)+cos(α)sin(β)

Corollary: sin(α±β)=sin(α)cos(β)±cos(α)sin(β)

Corollary: cos(α±β)=cos(α)cos(β)sin(α)sin(β)
Proof: cos(α±β)=sin((α+τ4)±β)=sin(α+τ4)cos(β)±cos(α+τ4)sin(β)=cos(α)cos(β)sin(α)cos(β)

Corollary: sin(2θ)=2sin(θ)cos(θ) and cos(2θ)=cos2(θ)sin2(θ)=2cos2(θ)1=1sin2(θ)

Product to Sum

2sin(α)cos(β)=sin(α+β)+sin(αβ)
2cos(α)sin(β)=sin(α+β)sin(αβ)
2cos(α)cos(β)=cos(α+β)+cos(αβ)
2sin(α)sin(β)=cos(α+β)+cos(αβ)

Proofs: expand right side

Sum to Product

If we write u=α+β and v=αβ above, then α=u+v2 and β=uv2.

Inverse Trigonometric Functions

arcsin(θ) is defined as the functional inverse of the function sin(θ). However, sin is not injective as sin(0)=sin(τ2)=0. Therefore, we restrict the domain of sin into sin:[τ4,τ4][1,1], so that we have arcsin:[1,1][τ4,τ4].

Similarly, we have arccos:[1,1][0,τ2] and arctan:R[τ4,τ4].

The graphs in green, purple and red are respectively arcsin, arccos and arctan.

csc, sec and cot also have their analogous inverse functions.

Note that most people write arcsin as sin1.

Differentiation of Trigonometric Functions

By definition, ddxf(x)=limh0f(x+h)f(x)h

ddxsin(x)=limh0sin(x+h)sin(x)h=limh0sin(x)cos(h)+cos(x)sin(h)sin(x)h

Since limh0cos(h)=1, we have ddxsin(x)=limh0sin(x)cos(h)+cos(x)sin(h)sin(x)h=limh0sin(x)(1)+cos(x)sin(h)sin(x)h=cos(x)limh0sin(h)h

Now, we will need to find limh0sin(h)h.

In the above diagram, the area of triangle ABC, sector ABC and triangle ABD are 12sin(x), 12x and 12tan(x) respectively.

So for positive small x, we have sin(x)<x<tan(x). Dividing all sides by sinx, we obtain 1<xsin(x)<1cos(x).

Since limx0+1=1 and limx0+1cos(x)=1, we have limx0+xsin(x)=1.

Since sin is an odd function, limx0xsin(x)=limx0+xsin(x)=limx0xsin(x)=limx0xsin(x)=1.

Therefore, ddxsin(x)=cos(x)limh0sin(h)h=cos(x).

Corollary: ddxcos(x)=ddxsin(x+τ4)=cos(x+τ4)=sin(x+τ2)=sin(x).

The derivative of the other trigonometric functions are easy to derive using derivative rules. In summary:

  • ddxsin(x)=cos(x)
  • ddxcos(x)=sin(x)
  • ddxtan(x)=sec2(x)
  • ddxcsc(x)=csc(x)cot(x)
  • ddxsec(x)=sec(x)tan(x)
  • ddxcot(x)=csc2(x)

Since we have the derivatives of sin and cos, we can write out its Taylor expansion.

sin(x)=x1!x33!+x55!x77!+

cos(x)=10!x22!+x44!x66!+

Their Taylor expansion is very closely related to the Taylor expansion of ex. Indeed, it is the “simplest” functions that satisfy the differential equation d2d2xf(x)=f(x).

Consider the function eix which traces out a circle with radius 1. We have eix=cos(x)+isin(x). Since we have d2dxeix=eix=cos(x)isin(x), it should be clear why sin and cos should satisfy the differential equation d2d2xf(x)=f(x).

Note that using eix=cos(x)+isin(x) we can derive the formulas for addition of trigonometric functions.
cos(a+b)+isin(a+b)=ei(a+b)=eiaeib=(cos(a)+isin(a))(cos(b)+isin(b))=(cos(a)cos(b)sin(a)sin(b))+i(sin(a)cos(b)+cos(a)sin(b))

Differentiation of Inverse Trigonometric Functions

1=ddxx=ddxf(f1(x))=f(f1(x))ddxf1(x)

Therefore, ddxf1(x)=1f(f1(x)).

So, we have ddxarcsin(x)=1cos(arcsin(x)).

In the above diagram, cos(arcsin(x))=cos(θ)=1x2

Therefore, ddxarcsin(x)=11x2.

Similarly, ddxarccos(x)=1sin(arccos(x))=11x2

ddxarctan(x)=cos2(arctan(x))

In the above diagram, cos2(arctan(x))=cos2(θ)=11+x2

Therefore, ddxarctan(x)=11+x2

Hyperbolic Functions

The hyperbolic functions are the analogue of the trigonometric functions. While the trigonometric functions satisfy cos2+sin2=1 and d2d2xf(x)=f(x), the hyperbolic functions satisfy cosh2sinh2=1 and d2d2xf(x)=f(x). They are called hyperbolic functions because x2y2=1 is the graph of the unit hyperbola. Apparently they appear as solutions to Laplace equations.

The definition of sinh and cosh are sinh(x)=exex2 and cosh(x)=ex+ex2. This is similar to the definitions of isin(x)=eixeix2 and cos(x)=eix+eix2.

We can verify that cosh2(x)sinh2(x)=(ex+ex2)2(exex2)2=(e2x+2+e2x)(e2x2e2x)4=1.

Addition of Hyperbolic Functions

sinh(x±y)=sinh(x)cosh(y)±cosh(x)sinh(y)
cosh(x±y)=cosh(x)cosh(y)±sinh(x)sinh(y)

They should be similar to the normal trigonometric function if one inspects how they are written in terms of ex or eix respectively. The only difference are in the signs.

Corollary: sinh(2x)=2sinh(x)cosh(x) and cosh(2x)=cosh2(x)+sinh2(x)=2cosh2(x)1=1+2sinh2(x)

Inverse Hyperbolic Functions

Define arcsinh:RR, arcsinh:[1,)[0,) and arctanh:[1,1]R as the functional inverses of sinh, cosh and tanh respectively.

We can find explicit formulas for these three functions.

Let y=arcsinh(x), then sinh(y)=x
ey=sinh(y)+cosh(y)=sinh(y)+1+sinh2(y)=x+1+x2
arcsinh(x)=ln(x+1+x2)

Let y=arccosh(x), then cosh(y)=x
ey=sinh(y)+cosh(y)=cosh2(y)1+cosh(y)=x21+x
arcsinh(x)=ln(x+x21)

Let y=arctanh(x), then tanh(y)=x
1tanh(y)=1eyeyey+ey=2eyey+ey=2e2y+1
e2y=21x1=1+x1x
arctanh(x)=12ln(1+x1x)

Differentiation of Hyperbolic Functions

ddxsinh(x)=ddxexex2=ex+ex2=cosh(x)
ddxcosh(x)=ddxex+ex2=exex2=sinh(x)
ddxtanh(x)=ddxsinh(x)cosh(x)=cosh2(x)sinh2(x)cosh2(x)=1cosh2(x)

ddxarcsinh(x)=1sinh(arcsinh(x))=1cosh(arcsinh(x))=1x2+1, since cosh(θ)=sinh2(θ)+1
ddxarccosh(x)=1cosh(arccosh(x))=1sinh(arccosh(x))=1x21, since sinh(θ)=cosh2(θ)1
ddxarctanh(x)=1tanh(arctanh(x))=cosh2(arctanh(x))=11x2, since cosh(θ)=11tanh2(θ)

Universal Trigonometric Substitution

Also known as Weierstrass substitution.

If we are integrating a function f(θ) that can be written in terms of sin(θ) and cos(θ), we can just apply the substitution t=tan(θ2).

dθdt=ddt2arctan(t)=21+t2
sin(θ)=2sin(θ2)cos(θ2)=2sin(θ2)cos(θ2)cos(θ2)cos(θ2)cos2(θ2)cos2(θ2)+sin2(θ2)cos2(θ2)=2t1+t2

cos(θ)=cos2(θ2)sin2(θ2)=cos2(θ2)cos2(θ2)sin2(θ2)cos2(θ2)cos2(θ2)cos2(θ2)+sin2(θ2)cos2(θ2)=1t21+t2

15+4cosθdθ=21+t25+4(1t21+t2)dt,t=tan(θ2)=25(1+t2)+4(1t2)dt=29+t2dt=23arctan(t3)=23arctan(tan(θ2)3) sec6(θ)dθ=1(cos2(θ))3dθ=1(cos(2θ)+12)3dθ=11+t2(11+t2)3dt,t=tan(θ)=1+2t2+t4dt=t+23t3+15t5=tan(θ)+23tan3(θ)+15tan5(θ) sec(3θ)sec(θ)dθ=2cos(3θ+θ)+cos(3θθ)dθ=2cos(4θ)+cos(2θ)dθ=21+cos(2θ)2sin2(2θ)dθ=21+t2(21+t2)2(2t1+t2)2dt,t=tan(θ)=1+t213t2dt=13+43113t2dt=13t+233ln|3+3t33t|=13tanθ+233ln|3+3tanθ33tanθ|
<
Previous Post
Some Greedy Problems
>
Next Post
High Dimensional Prefix Sums