Two slopes at 0
Every rule in this lesson grows from two numbers: the slopes of sine and cosine at 0. Both come from chord slopes (lesson 2.2.1), with the gap in radians.
Sine at 0. Since , the chord slope of from 0 to is , the limit of lesson 2.1.1.
| gap | |||
|---|---|---|---|
| chord slope | 0.998334 | 0.999983 | 1.0 |
Both sides give the same numbers, because (lesson 1.7.1). So the slope at 0 is 1, and near 0 sine hugs the line : .
Cosine at 0. Cosine is at the top of its wave at 0, where . So its chord slope is .
| gap | 0.1 | 0.01 | 0.001 |
|---|---|---|---|
| from the right, | |||
| from the left, | 0.049958 | 0.005 | 0.0005 |
The chords slope down to the right and up to the left, and both shrink to 0. The tangent at the top is flat.
Rule: Two limits at 0
With in radians, these are the slopes of sine and cosine at 0. This lesson takes them from the tables; the Proof Gym proves them.
In degrees the slope is not 1
Measure the gap in degrees and the chord slope becomes . One degree is only radians, so the slope shrinks by that factor.
| gap in degrees | 1 | 0.1 | 0.01 |
|---|---|---|---|
| chord slope per degree | 0.017452 | 0.017453 | 0.017453 |
In degrees, every rule below would carry that factor. Radians make the slope at 0 exactly 1, as makes the slope of its exponential 1 at 0 (lesson 2.3.4).
Try it
The first loop prints the chord slope of sine at 0, from the right and from the left. The second does the same for cosine, whose two sides have opposite signs.
The last loop measures the gap in degrees, converted by math.radians (lesson 1.7.1).
The slope of sine is cosine
Read the slope of off its graph and you trace out .
- At 0, sine crosses zero going up, at its steepest: slope 1.
- At it is at its top: slope 0.
- At it crosses zero going down, at its steepest: slope .
- At it is at its bottom: slope 0. At the wave starts again.
These slopes, 1, 0, , 0, are the values of at the same points. Sine is steepest where it crosses zero, which is where cosine peaks.
Tangents to where it crosses zero and at its top and bottom. Plotted at the same , their slopes 1, 0, , 0, 1 sit on .
Between those points the match holds too. Central differences (lesson 2.2.2) with give:
| 0 | |||||
|---|---|---|---|---|---|
| slope of | 1.0 | 0.866025 | 0.5 | 0.0 | |
| 1 | 0.866025 | 0.5 | 0 |
Rule: Derivative of sine
With in radians. Sine rises where , falls where , and is flat where , at its tops and bottoms.
The slope stays between and 1, and sine has no corners or jumps (lesson 2.2.2). Negative inputs work the same way: at the slope is .
Slide the point along and watch the slope graph underneath trace the cosine wave. Jump to , where the tangent is flat, and to , where it falls most steeply.
Explore
Slide the point along the curve. Its tangent shows the slope there, and the lower graph plots that slope for every x: the derivative.
The slope of y = sin x, which is cos x
- Point
- (0.159π, 0.4794)
- Slope there
- 0.8776
- The curve is
- rising: the slope is positive, so the slope graph is above zero
Try it
central is the central difference of lesson 2.2.2. Each line prints , the estimated slope of , and .
Adding 0.0 turns a -0.0 into 0.0, as in lesson 1.7.3.
The slope of cosine is minus sine
Read the cosine wave the same way: at 0 it is at its top, and flat (the second limit). It falls most steeply as it crosses zero at , with slope . It is flat again at its bottom, , and climbs most steeply at , with slope 1.
These slopes, 0, , 0, 1, are the values of . Central differences agree: at they give , which is .
Rule: Derivative of cosine
With in radians. The minus sign matters: cosine falls while sine is positive, from 0 to , and rises while sine is negative.
One picture for both rules
Lesson 1.7.1 put the point on the unit circle, an arc round from . In radians the arc grows as fast as the angle, so the point moves at speed 1.
It moves at right angles to the radius (lesson 1.7.3): in the direction of the radius turned a quarter turn. That turn takes to (lesson 1.7.2), giving .
Per unit of angle the point moves 1 along the circle. Its height changes by : up at , down at .
So the height changes at the rate , and the across coordinate at the rate . In degrees the point moves only of a unit per degree.
Try it
The loop prints , the central difference of , and .
The last loop moves the point round the circle from by an arc . Its rise and its change across, per unit of , head for and .
Differentiating again: a cycle of four
Each rule turns sine into cosine, or cosine into minus sine. So repeated differentiation goes round a cycle of four.
| times differentiated | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| becomes |
The fifth derivative is the first again, . Starting from , the same cycle begins one step along. Compare (lesson 2.3.4), which comes back after one step.
The second derivative pulls the wave back
Differentiating twice gives the second derivative , the slope of the slope; lesson 2.4.2 studies it. For it is : the function itself, with its sign flipped.
So above the axis the slope is falling and the wave bends back down; below the axis it bends back up. The bend always pulls the wave towards 0, so it overshoots and swings for ever.
Module 6.2 solves differential equations such as , whose solutions are waves like these.
Try it
SymPy differentiates eight times, round the cycle twice. sp.diff(f, x, 2) differentiates twice.
The last line checks a rule from the end of this lesson: has slope .
Tangent, by the quotient rule
(lesson 1.7.1), so the quotient rule of lesson 2.3.2, , applies with and :
The last step is the identity (lesson 1.7.1). Dividing it by gives a second form, .
Rule: Derivative of tangent
The slope is never below 1, so every branch of tangent rises. Where tangent has no value, at and every half turn from it, it has no slope.
At , , so the slope is 2. Central differences agree:
| gap | 0.1 | 0.01 | 0.001 |
|---|---|---|---|
| central difference at | 2.0271 | 2.000267 | 2.000003 |
The slope is 1 at 0 and 4 at . Near it blows up: 199.85 at 1.5 and about 1.58 million at 1.57, where tangent itself shoots off (lesson 1.7.1).
Try it
The loop prints central differences of at , then at 0, , , 1.5 and 1.57.
SymPy gives the slope as . Simplified, the quotient-rule form is cos(x)**(-2), the same function.
With the chain rule: rates and periods
With sine or cosine outside, the chain rule of lesson 2.3.3 keeps the inside as it is and multiplies by its slope.
Rule: Sine and cosine of a function
Here is the inside. The outer slope is taken at , then multiplied by the slope of the inside.
A linear inside. has inside , with slope 3, so its derivative is : 3 at . Central differences agree:
| gap | 0.1 | 0.01 | 0.001 |
|---|---|---|---|
| central difference at 0 | 2.955202 | 2.99955 | 2.999996 |
runs through its wave three times as fast, with period . Squeezed sideways by 3, the wave is 3 times as steep.
Frequency and phase
A wave in time is written , with in seconds. The angular frequency (omega) is in radians per second; the phase (phi) shifts the wave along. The inside has slope , so
The period is seconds, and the slope swings between and , in units of per second. A frequency makes slopes times larger; the phase only moves the wave.
For , the slope at is , and the period is . One cycle per second is , with slopes up to per second.
Curved insides, powers and degrees
A curved inside. has inside , with slope , so its derivative is . At that is . Central differences give 1.056644, 1.080364 and 1.080602 for gaps 0.1, 0.01 and 0.001.
A power of sine. means : the outer function is and the inside is . Its slope is , which is 1 at .
Degrees. Sine in degrees is . Its slope, , carries the factor at every point.
Try it
The loop prints central differences of at 0 and of at 1. SymPy then differentiates each example of this section.
SymPy writes as pi*cos(pi*x/180)/180.
Reading the rules backwards
The rules also answer the reverse question: which function has a given slope? has slope . Since has slope , the function with slope is , not .
Lesson 2.5.2 calls such a function an antiderivative, and lists both rules backwards. Lesson 2.6.2 uses both rules to integrate .
Common mistakes
- Use radians. In degrees every slope has an extra factor . The slope of sine at 0 is then 0.017453 per degree.
- The minus sign belongs to cosine. , but .
- Keep the chain factor, and leave the inside alone. gives , not or . gives .
- is not . Their slopes are and .
- Tangent has no slope at its gaps. At there is no and no slope. Close by, the slope is huge.
- Backwards, mind the sign. The function with slope is .
Derivatives of sine and cosine
0 of 12 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
How to type answers
- Powers with
^:x^7,2^(1/3),a^-2. - Multiply with
*or by writing side by side:3x^2,2(x+1). ln(x)is the natural log,log(x, 2)is log base 2,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for sin²x.- Your first answer to each question is saved: it counts towards your score and brings the question back for review.
- Exact answers like
ln(20)/ln(3)are best. Decimals need about 4 significant figures.
Summary card
- In radians, and : the slopes of sine and cosine at 0. In degrees the slope of sine at 0 is .
- and . Sine is steepest where it crosses zero and flat at its tops and bottoms.
- Derivatives cycle every four steps: , , , . The second derivative of is .
- , where .
- Chain rule: . has slope , period and slopes up to .
- The function with slope is .