DSPy a system for AI to Write Prompts and Do Fine Tuning
Lesson 9: The Product and Quotient Rules (slides)
1. Sec on 2.4
The Product and Quo ent Rules
V63.0121.011: Calculus I
Professor Ma hew Leingang
New York University
February 23, 2011
.
2. Announcements
Quiz 2 next week on
§§1.5, 1.6, 2.1, 2.2
Midterm March 7 on all
sec ons in class (covers
all sec ons up to 2.5)
3. Help!
Free resources:
Math Tutoring Center
(CIWW 524)
College Learning Center
(schedule on Blackboard)
TAs’ office hours
my office hours
each other!
4. Objectives
Understand and be able
to use the Product Rule
for the deriva ve of the
product of two func ons.
Understand and be able
to use the Quo ent Rule
for the deriva ve of the
quo ent of two
func ons.
5. Outline
Deriva ve of a Product
Deriva on
Examples
The Quo ent Rule
Deriva on
Examples
More deriva ves of trigonometric func ons
Deriva ve of Tangent and Cotangent
Deriva ve of Secant and Cosecant
More on the Power Rule
Power Rule for Nega ve Integers
6. Recollection and extension
We have shown that if u and v are func ons, that
(u + v)′ = u′ + v′
(u − v)′ = u′ − v′
What about uv?
7. Is the derivative of a product the
product of the derivatives?
(uv)′ = u′ v′ ?
.
8. Is the derivative of a product the
product of the derivatives?
(uv)′ = u′ v′ !
.
Try this with u = x and v = x2 .
9. Is the derivative of a product the
product of the derivatives?
(uv)′ = u′ v′ !
.
Try this with u = x and v = x2 .
Then uv = x3 =⇒ (uv)′ = 3x2 .
10. Is the derivative of a product the
product of the derivatives?
(uv)′ = u′ v′ !
.
Try this with u = x and v = x2 .
Then uv = x3 =⇒ (uv)′ = 3x2 .
But u′ v′ = 1 · 2x = 2x.
11. Is the derivative of a product the
product of the derivatives?
(uv)′ = u′ v′ !
.
Try this with u = x and v = x2 .
Then uv = x3 =⇒ (uv)′ = 3x2 .
But u′ v′ = 1 · 2x = 2x.
So we have to be more careful.
12. Mmm...burgers
Say you work in a fast-food joint. You want to make more money.
What are your choices?
.
13. Mmm...burgers
Say you work in a fast-food joint. You want to make more money.
What are your choices?
Work longer hours.
.
14. Mmm...burgers
Say you work in a fast-food joint. You want to make more money.
What are your choices?
Work longer hours.
Get a raise.
.
15. Mmm...burgers
Say you work in a fast-food joint. You want to make more money.
What are your choices?
Work longer hours.
Get a raise.
Say you get a 25 cent raise in
your hourly wages and work 5
hours more per week. How
much extra money do you
make?
.
16. Mmm...burgers
Say you work in a fast-food joint. You want to make more money.
What are your choices?
Work longer hours.
Get a raise.
Say you get a 25 cent raise in
your hourly wages and work 5
hours more per week. How
much extra money do you
make?
.
∆I = 5 × $0.25 = $1.25?
17. Mmm...burgers
Say you work in a fast-food joint. You want to make more money.
What are your choices?
Work longer hours.
Get a raise.
Say you get a 25 cent raise in
your hourly wages and work 5
hours more per week. How
much extra money do you
make?
.
∆I = 5 × $0.25 = $1.25?
18. Money money money money
The answer depends on how much you work already and your
current wage. Suppose you work h hours and are paid w. You get a
me increase of ∆h and a wage increase of ∆w. Income is wages
mes hours, so
∆I = (w + ∆w)(h + ∆h) − wh
FOIL
= w · h + w · ∆h + ∆w · h + ∆w · ∆h − wh
= w · ∆h + ∆w · h + ∆w · ∆h
20. A geometric argument
Draw a box:
∆h w ∆h ∆w ∆h
h wh ∆w h
.
w ∆w
∆I = w ∆h + h ∆w + ∆w ∆h
21. Cash flow
Supose wages and hours are changing con nuously over me. Over
a me interval ∆t, what is the average rate of change of income?
∆I w ∆h + h ∆w + ∆w ∆h
=
∆t ∆t
∆h ∆w ∆h
=w +h + ∆w
∆t ∆t ∆t
22. Cash flow
Supose wages and hours are changing con nuously over me. Over
a me interval ∆t, what is the average rate of change of income?
∆I w ∆h + h ∆w + ∆w ∆h
=
∆t ∆t
∆h ∆w ∆h
=w +h + ∆w
∆t ∆t ∆t
What is the instantaneous rate of change of income?
dI ∆I dh dw
= lim =w +h +0
dt ∆t→0 ∆t dt dt
23. Eurekamen!
We have discovered
Theorem (The Product Rule)
Let u and v be differen able at x. Then
(uv)′ (x) = u(x)v′ (x) + u′ (x)v(x)
in Leibniz nota on
d du dv
(uv) = ·v+u
dx dx dx
25. Sanity Check
Example
Apply the product rule to u = x and v = x2 .
Solu on
(uv)′ (x) = u(x)v′ (x) + u′ (x)v(x) = x · (2x) + 1 · x2 = 3x2
This is what we get the “normal” way.
26. Which is better?
Example
Find this deriva ve two ways: first by direct mul plica on and then
by the product rule:
d [ ]
(3 − x2 )(x3 − x + 1)
dx
28. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by direct mul plica on:
d [ ] FOIL d [ 5 ]
(3 − x2 )(x3 − x + 1) = −x + 4x3 − x2 − 3x + 3
dx dx
29. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by direct mul plica on:
d [ ] FOIL d [ 5 ]
(3 − x2 )(x3 − x + 1) = −x + 4x3 − x2 − 3x + 3
dx dx
= −5x4 + 12x2 − 2x − 3
30. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by the product rule:
( ) ( )
dy d d 3
= (3 − x ) (x − x + 1) + (3 − x )
2 3 2
(x − x + 1)
dx dx dx
31. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by the product rule:
( ) ( )
dy d d 3
= (3 − x ) (x − x + 1) + (3 − x )
2 3 2
(x − x + 1)
dx dx dx
= (−2x)(x3 − x + 1) + (3 − x2 )(3x2 − 1)
32. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by the product rule:
( ) ( )
dy d d 3
= (3 − x ) (x − x + 1) + (3 − x )
2 3 2
(x − x + 1)
dx dx dx
= (−2x)(x3 − x + 1) + (3 − x2 )(3x2 − 1)
33. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by the product rule:
( ) ( )
dy d d 3
= (3 − x ) (x − x + 1) + (3 − x )
2 3 2
(x − x + 1)
dx dx dx
= (−2x)(x3 − x + 1) + (3 − x2 )(3x2 − 1)
34. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by the product rule:
( ) ( )
dy d d 3
= (3 − x ) (x − x + 1) + (3 − x )
2 3 2
(x − x + 1)
dx dx dx
= (−2x)(x3 − x + 1) + (3 − x2 )(3x2 − 1)
35. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by the product rule:
( ) ( )
dy d d 3
= (3 − x ) (x − x + 1) + (3 − x )
2 3 2
(x − x + 1)
dx dx dx
= (−2x)(x3 − x + 1) + (3 − x2 )(3x2 − 1)
36. Which is better?
Example
d [ ]
(3 − x2 )(x3 − x + 1)
dx
Solu on
by the product rule:
( ) ( )
dy d d 3
= (3 − x ) (x − x + 1) + (3 − x )
2 3 2
(x − x + 1)
dx dx dx
= (−2x)(x3 − x + 1) + (3 − x2 )(3x2 − 1)
= −5x4 + 12x2 − 2x − 3
38. One more
Example
d
Find x sin x.
dx
Solu on
( ) ( )
d d d
x sin x = x sin x + x sin x
dx dx dx
39. One more
Example
d
Find x sin x.
dx
Solu on
( ) ( )
d d d
x sin x = x sin x + x sin x
dx dx dx
= 1 · sin x + x · cos x
40. One more
Example
d
Find x sin x.
dx
Solu on
( ) ( )
d d d
x sin x = x sin x + x sin x
dx dx dx
= 1 · sin x + x · cos x
= sin x + x cos x
41. Mnemonic
Let u = “hi” and v = “ho”. Then
(uv)′ = vu′ + uv′ = “ho dee hi plus hi dee ho”
42. Musical interlude
jazz bandleader and
singer
hit song “Minnie the
Moocher” featuring “hi
de ho” chorus
played Cur s in The Blues
Brothers
Cab Calloway
1907–1994
43. Iterating the Product Rule
Example
Use the product rule to find the deriva ve of a three-fold product uvw.
44. Iterating the Product Rule
Example
Use the product rule to find the deriva ve of a three-fold product uvw.
Solu on
(uvw)′ .
45. Iterating the Product Rule
Example
Use the product rule to find the deriva ve of a three-fold product uvw.
Solu on
(uvw)′ = ((uv)w)′ .
46. Iterating the Product Rule
Example
Apply the product
Use the product rule to find the deriva ve of a three-fold product uvw.
rule to uv and w
Solu on
(uvw)′ = ((uv)w)′ .
47. Iterating the Product Rule
Example
Apply the product
Use the product rule to find the deriva ve of a three-fold product uvw.
rule to uv and w
Solu on
(uvw)′ = ((uv)w)′ . = (uv)′ w + (uv)w′ .
48. Iterating the Product Rule
Example
Use the product rule to find the deriva ve of a three-fold product uvw.product
Apply the
rule to u and v
Solu on
(uvw)′ = ((uv)w)′ . = (uv)′ w + (uv)w′ .
49. Iterating the Product Rule
Example
Use the product rule to find the deriva ve of a three-fold product uvw.product
Apply the
rule to u and v
Solu on
(uvw)′ = ((uv)w)′ . = (uv)′ w + (uv)w′ .
= (u′ v + uv′ )w + (uv)w′
50. Iterating the Product Rule
Example
Use the product rule to find the deriva ve of a three-fold product uvw.
Solu on
(uvw)′ = ((uv)w)′ . = (uv)′ w + (uv)w′ .
= (u′ v + uv′ )w + (uv)w′
= u′ vw + uv′ w + uvw′
51. Iterating the Product Rule
Example
Use the product rule to find the deriva ve of a three-fold product uvw.
Solu on
(uvw)′ = ((uv)w)′ . = (uv)′ w + (uv)w′ .
= (u′ v + uv′ )w + (uv)w′
= u′ vw + uv′ w + uvw′
So we write down the product three mes, taking the deriva ve of each factor
once.
52. Outline
Deriva ve of a Product
Deriva on
Examples
The Quo ent Rule
Deriva on
Examples
More deriva ves of trigonometric func ons
Deriva ve of Tangent and Cotangent
Deriva ve of Secant and Cosecant
More on the Power Rule
Power Rule for Nega ve Integers
54. The Quotient Rule
What about the deriva ve of a quo ent?
u
Let u and v be differen able func ons and let Q = . Then
v
u = Qv
55. The Quotient Rule
What about the deriva ve of a quo ent?
u
Let u and v be differen able func ons and let Q = . Then
v
u = Qv
If Q is differen able, we have
u′ = (Qv)′ = Q′ v + Qv′
56. The Quotient Rule
What about the deriva ve of a quo ent?
u
Let u and v be differen able func ons and let Q = . Then
v
u = Qv
If Q is differen able, we have
u′ = (Qv)′ = Q′ v + Qv′
′ u′ − Qv′ u′ u v′
=⇒ Q = = − ·
v v v v
57. The Quotient Rule
What about the deriva ve of a quo ent?
u
Let u and v be differen able func ons and let Q = . Then
v
u = Qv
If Q is differen able, we have
u′ = (Qv)′ = Q′ v + Qv′
′ u′ − Qv′ u′ u v′
=⇒ Q = = − ·
v v v v
( u )′ u′ v − uv′
=⇒ Q′ = =
v v2
58. The Quotient Rule
What about the deriva ve of a quo ent?
u
Let u and v be differen able func ons and let Q = . Then
v
u = Qv
If Q is differen able, we have
u′ = (Qv)′ = Q′ v + Qv′
′ u′ − Qv′ u′ u v′
=⇒ Q = = − ·
v v v v
( u )′ u′ v − uv′
=⇒ Q′ = =
v v2
This is called the Quo ent Rule.
59. The Quotient Rule
We have discovered
Theorem (The Quo ent Rule)
u
Let u and v be differen able at x, and v(x) ̸= 0. Then is
v
differen able at x, and
( u )′ u′ (x)v(x) − u(x)v′ (x)
(x) =
v v(x)2
60. Verifying Example
Example
( )
d x2 d
Verify the quo ent rule by compu ng and comparing it to (x).
dx x dx
61. Verifying Example
Example
( )
d x2 d
Verify the quo ent rule by compu ng and comparing it to (x).
dx x dx
Solu on
( 2) ( )
d x x dx x2 − x2 dx (x) x · 2x − x2 · 1
d d
= =
dx x x2 x2
x2 d
= 2 =1= (x)
x dx
62. Mnemonic
Let u = “hi” and v = “lo”. Then
( u )′ vu′ − uv′
= = “lo dee hi minus hi dee lo over lo lo”
v v2
63. Examples
Example
d 2x + 5
1.
dx 3x − 2
d sin x
2.
dx x2
d 1
3. 2+t+2
dt t
82. Solution to second example
Solu on
d sin x x2 dx sin x − sin x
d
=
dx x2
83. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2
84. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2 (x2 )2
85. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2 (x2 )2
=
86. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2 (x2 )2
x2
=
87. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2 (x2 )2
x2 cos x
=
88. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2 (x2 )2
x2 cos x − 2x
=
89. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2 (x2 )2
x2 cos x − 2x sin x
=
90. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2 (x2 )2
x2 cos x − 2x sin x
=
x4
91. Solution to second example
Solu on
d sin x x2 dx sin x − sin x dx x2
d d
=
dx x2 (x2 )2
x2 cos x − 2x sin x
=
x4
x cos x − 2 sin x
=
x3
92. Another way to do it
Find the deriva ve with the product rule instead.
Solu on
d sin x d ( )
2
= sin x · x−2
dx x dx
( ) ( )
d −2 d −2
= sin x · x + sin x · x
dx dx
= cos x · x−2 + sin x · (−2x−3 )
= x−3 (x cos x − 2 sin x)
No ce the technique of factoring out the largest nega ve power,
leaving posi ve powers.
93. Examples
Example Answers
d 2x + 5 19
1. 1. −
dx 3x − 2 (3x − 2)2
d sin x x cos x − 2 sin x
2. 2.
dx x2 x3
d 1
3. 2+t+2
dt t
95. Solution to third example
Solu on
d 1 (t2 + t + 2)(0) − (1)(2t + 1)
=
dt t2 + t + 2 (t2 + t + 2)2
96. Solution to third example
Solu on
d 1 (t2 + t + 2)(0) − (1)(2t + 1)
=
dt t2 + t + 2 (t2 + t + 2)2
2t + 1
=− 2
(t + t + 2)2
97. A nice little takeaway
Fact
1
Let v be differen able at x, and v(x) ̸= 0. Then is differen able at
v
0, and ( )′
1 v′
=− 2
v v
Proof.
( )
d 1 v· d
dx (1)−1· d
dx v v · 0 − 1 · v′ v′
= = =− 2
dx v v2 v2 v
98. Examples
Example Answers
d 2x + 5 19
1. 1. −
dx 3x − 2 (3x − 2)2
d sin x x cos x − 2 sin x
2. 2.
dx x2 x3
d 1 2t + 1
3. 3. − 2
dt t2+t+2 (t + t + 2)2
99. Outline
Deriva ve of a Product
Deriva on
Examples
The Quo ent Rule
Deriva on
Examples
More deriva ves of trigonometric func ons
Deriva ve of Tangent and Cotangent
Deriva ve of Secant and Cosecant
More on the Power Rule
Power Rule for Nega ve Integers
101. Derivative of Tangent
Example
d
Find tan x
dx
Solu on
( )
d d sin x
tan x =
dx dx cos x
102. Derivative of Tangent
Example
d
Find tan x
dx
Solu on
( )
d d sin x cos x · cos x − sin x · (− sin x)
tan x = =
dx dx cos x cos2 x
103. Derivative of Tangent
Example
d
Find tan x
dx
Solu on
( )
d d sin x cos x · cos x − sin x · (− sin x)
tan x = =
dx dx cos x cos2 x
cos2 x + sin2 x
=
cos2 x
104. Derivative of Tangent
Example
d
Find tan x
dx
Solu on
( )
d d sin x cos x · cos x − sin x · (− sin x)
tan x = =
dx dx cos x cos2 x
cos2 x + sin2 x 1
= =
cos2 x cos2 x
105. Derivative of Tangent
Example
d
Find tan x
dx
Solu on
( )
d d sin x cos x · cos x − sin x · (− sin x)
tan x = =
dx dx cos x cos2 x
cos2 x + sin2 x 1
= 2x
= 2x
= sec2 x
cos cos
108. Derivative of Cotangent
Example
d
Find cot x
dx
Solu on
d d ( cos x ) sin x · (− sin x) − cos x · cos x
cot x = =
dx dx sin x sin2 x
109. Derivative of Cotangent
Example
d
Find cot x
dx
Solu on
d d ( cos x ) sin x · (− sin x) − cos x · cos x
cot x = =
dx dx sin x sin2 x
− sin2 x − cos2 x
=
sin2 x
110. Derivative of Cotangent
Example
d
Find cot x
dx
Solu on
d d ( cos x ) sin x · (− sin x) − cos x · cos x
cot x = =
dx dx sin x sin2 x
− sin2 x − cos2 x 1
= =− 2
sin2 x sin x
111. Derivative of Cotangent
Example
d
Find cot x
dx
Solu on
d d ( cos x ) sin x · (− sin x) − cos x · cos x
cot x = =
dx dx sin x sin2 x
− sin2 x − cos2 x 1
= = − 2 = − csc2 x
sin2 x sin x
113. Derivative of Secant
Example
d
Find sec x
dx
Solu on
( )
d d 1
sec x =
dx dx cos x
114. Derivative of Secant
Example
d
Find sec x
dx
Solu on
( )
d d 1 cos x · 0 − 1 · (− sin x)
sec x = =
dx dx cos x cos2 x
115. Derivative of Secant
Example
d
Find sec x
dx
Solu on
( )
d d 1 cos x · 0 − 1 · (− sin x)
sec x = =
dx dx cos x cos2 x
sin x
=
cos2 x
116. Derivative of Secant
Example
d
Find sec x
dx
Solu on
( )
d d 1 cos x · 0 − 1 · (− sin x)
sec x = =
dx dx cos x cos2 x
sin x 1 sin x
= = ·
cos2 x cos x cos x
117. Derivative of Secant
Example
d
Find sec x
dx
Solu on
( )
d d 1 cos x · 0 − 1 · (− sin x)
sec x = =
dx dx cos x cos2 x
sin x 1 sin x
= = · = sec x tan x
cos2 x cos x cos x
120. Derivative of Cosecant
Example
d
Find csc x
dx
Solu on
( )
d d 1 sin x · 0 − 1 · (cos x)
csc x = =
dx dx sin x sin2 x
121. Derivative of Cosecant
Example
d
Find csc x
dx
Solu on
( )
d d 1 sin x · 0 − 1 · (cos x)
csc x = =
dx dx sin x sin2 x
cos x
=− 2
sin x
122. Derivative of Cosecant
Example
d
Find csc x
dx
Solu on
( )
d d 1 sin x · 0 − 1 · (cos x)
csc x = =
dx dx sin x sin2 x
cos x 1 cos x
=− 2 =− ·
sin x sin x sin x
123. Derivative of Cosecant
Example
d
Find csc x
dx
Solu on
( )
d d 1 sin x · 0 − 1 · (cos x)
csc x = =
dx dx sin x sin2 x
cos x 1 cos x
=− 2 =− · = − csc x cot x
sin x sin x sin x
124. Recap: Derivatives of
trigonometric functions
y y′
sin x cos x Func ons come in pairs
(sin/cos, tan/cot, sec/csc)
cos x − sin x
Deriva ves of pairs follow
tan x sec2 x similar pa erns, with
cot x − csc2 x func ons and
co-func ons switched
sec x sec x tan x and an extra sign.
csc x − csc x cot x
125. Outline
Deriva ve of a Product
Deriva on
Examples
The Quo ent Rule
Deriva on
Examples
More deriva ves of trigonometric func ons
Deriva ve of Tangent and Cotangent
Deriva ve of Secant and Cosecant
More on the Power Rule
Power Rule for Nega ve Integers
126. Power Rule for Negative Integers
We will use the quo ent rule to prove
Theorem
d −n
x = (−n)x−n−1
dx
for posi ve integers n.
127. Power Rule for Negative Integers
We will use the quo ent rule to prove
Theorem
d −n
x = (−n)x−n−1
dx
for posi ve integers n.
Proof.
128. Power Rule for Negative Integers
We will use the quo ent rule to prove
Theorem
d −n
x = (−n)x−n−1
dx
for posi ve integers n.
Proof.
d −n d 1
x =
dx dx xn
129. Power Rule for Negative Integers
We will use the quo ent rule to prove
Theorem
d −n
x = (−n)x−n−1
dx
for posi ve integers n.
Proof.
d n
d −n d 1 dx x
x = =− n 2
dx dx xn (x )
130. Power Rule for Negative Integers
We will use the quo ent rule to prove
Theorem
d −n
x = (−n)x−n−1
dx
for posi ve integers n.
Proof.
d n
d −n d 1 dx x nxn−1
x = = − n 2 = − 2n
dx dx xn (x ) x
131. Power Rule for Negative Integers
We will use the quo ent rule to prove
Theorem
d −n
x = (−n)x−n−1
dx
for posi ve integers n.
Proof.
d n
d −n d 1 dx x nxn−1
x = n
= − n 2 = − 2n = −nxn−1−2n
dx dx x (x ) x
132. Power Rule for Negative Integers
We will use the quo ent rule to prove
Theorem
d −n
x = (−n)x−n−1
dx
for posi ve integers n.
Proof.
d n
d −n d 1 dx x nxn−1
x = n
= − n 2 = − 2n = −nxn−1−2n = −nx−n−1
dx dx x (x ) x
133. Summary
The Product Rule: (uv)′ = u′ v + uv′
( u )′ vu′ − uv′
The Quo ent Rule: =
v v2
Deriva ves of tangent/cotangent, secant/cosecant
d d
tan x = sec2 x sec x = sec x tan x
dx dx
d d
cot x = − csc2 x csc x = − csc x cot x
dx dx
The Power Rule is true for all whole number powers, including
nega ve powers:
d n
x = nxn−1
dx