Free preview

82 lessons

Mathematical Foundations for ML

Free preview

Mathematical Foundations for ML · 82 lessons

Build the maths foundations that make ML click

No surprise gaps

Actually remember it

Skip what you know

One subscription. All learning paths included.

Our content is best on a larger screen

Graphs of sine and cosine

The sine graph

Explanation

On the unit circle, the yy-coordinate of the terminal point is sinθ\sin\theta. As θ\theta increases from 00 to 2π2\pi, that yy-coordinate rises to 11, falls back through zero to 1-1, and returns to zero, tracing out a smooth wave. The graph of y=sinθy = \sin\theta records this motion on a standard set of axes.

θ
0
π2
π
3π2
2π
1
1
θ
sinθ

Drag the purple point around the unit circle. The right-hand graph is y=sinθ: θ on the x-axis, sinθ on the y-axis.

Five key points mark out one complete cycle:

θ\theta00π2\dfrac{\pi}{2}π\pi3π2\dfrac{3\pi}{2}2π2\pi
sinθ\sin\theta0011001-100

Two numbers measure the wave itself: how long one full cycle takes, and how far it reaches above and below the centre line. We call these the period and the amplitude.

Period and amplitude

Definition

The period of sinθ\sin\theta is 2π2\pi, the length of one complete cycle. The amplitude is 11, the distance from the centre line (y=0y = 0) to a peak or trough.

Because the unit circle has no start or end, the wave repeats identically in both directions. The portion from 00 to 2π2\pi is one copy of a pattern that extends forever in each direction.

Practice questions

4 questions

What is the value of sin ⁣(3π2)\sin\!\left(\dfrac{3\pi}{2}\right)?

Select the correct answer:

+ 3 more questions

The cosine graph

Explanation

The sine graph tracks the yy-coordinate of the unit-circle point. The cosine graph tracks the xx-coordinate instead. As θ\theta increases from 00 to 2π2\pi, cosθ\cos\theta starts at 11, falls through zero, reaches 1-1, and returns to 11. The result is a wave with the same shape as sine, shifted along the horizontal axis.

θ\theta00π2\dfrac{\pi}{2}π\pi3π2\dfrac{3\pi}{2}2π2\pi
cosθ\cos\theta11001-10011

Cosine starts at its maximum (11), crosses zero at π2\dfrac{\pi}{2}, hits its minimum (1-1) at π\pi, crosses zero again at 3π2\dfrac{3\pi}{2}, and returns to 11 at 2π2\pi. Like sine, it has period 2π2\pi and amplitude 11.

0
π2
π
3π2
2π
1
1
θ
sinθ
cosθ

Comparing the two curves, every feature of cosine appears π2\dfrac{\pi}{2} earlier than the same feature of sine. The cosine peak is at 00 while the sine peak is at π2\dfrac{\pi}{2}; cosine crosses zero at π2\dfrac{\pi}{2} while sine crosses zero at π\pi; and so on. This relationship is captured by the identity:

Shift relationship

Definition

cosθ=sin ⁣(θ+π2)\cos\theta = \sin\!\left(\theta + \dfrac{\pi}{2}\right)

Cosine is sine shifted left by π2\dfrac{\pi}{2}. Equivalently, cosine "leads" sine - it reaches every landmark earlier.

Practice questions

4 questions

What is cos(π)\cos(\pi)?

Select the correct answer:

+ 3 more questions

Domain and range

Explanation

Sine and cosine accept any real number as input - the wave keeps oscillating no matter how large or negative θ\theta becomes. Their outputs, however, are tightly bounded: a unit-circle point has coordinates (cosθ,sinθ)(\cos\theta, \sin\theta) on a circle of radius 11, so neither coordinate can exceed 11 in size or fall below 1-1.

Domain and range

Definition

Both sinθ\sin\theta and cosθ\cos\theta have domain R\mathbb{R} (equivalently (,)(-\infty, \infty)) and range [1,1][-1, 1].

To tell the curves apart without labels, check the starting value: sin(0)=0\sin(0) = 0 (the curve starts on the axis), while cos(0)=1\cos(0) = 1 (the curve starts at the top).

Practice questions

4 questions

What are the domain and range of f(θ)=cosθf(\theta) = \cos\theta?

Select the correct answer:

+ 3 more questions

Number of solutions to sinθ=c\sin\theta = c and cosθ=c\cos\theta = c

Explanation

Suppose we want to find every θ\theta in [0,2π][0, 2\pi] that satisfies sinθ=c\sin\theta = c for some target value cc. The number of solutions is determined entirely by where cc sits relative to the range [1,1][-1, 1].

Visually, each value of cc corresponds to a horizontal line y=cy = c. The number of solutions is the number of places that line meets the sine curve.

0
π2
π
3π2
2π
1
1
θ

Choose an equation, then drag the slider to change c and watch how many θ in [0,2π] satisfy it.

c= 0.50

2 solutions in [0,2π]

The same three cases apply equally to both functions. Switching the toggle changes where the solutions sit, not how many there are.

Number of solutions in [0,2π][0, 2\pi]

Definition

For both sinθ=c\sin\theta = c and cosθ=c\cos\theta = c:

  • c>1|c| > 1: no solutions - the line y=cy = c sits entirely above or below the curve.
  • c=1|c| = 1: one solution - the line is tangent to the curve at its single peak (when c=1c = 1) or single trough (when c=1c = -1) within the period.
  • c<1|c| < 1: two solutions - the line crosses the curve once on the way up and once on the way down.
Why this matters for inverse trigonometric functions

Advanced

Practice questions

4 questions

How many values of θ\theta in [0,2π][0, 2\pi] satisfy sinθ=1.5\sin\theta = 1.5?

Select the correct answer:

+ 3 more questions