generated from jtr13/bookdown-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
03-DifferentiationRules.Rmd
1814 lines (1216 loc) · 82.1 KB
/
03-DifferentiationRules.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# (PART) Differentiation Rules {-}
# 3.1 Derivatives of Polynomials and Exponential Functions {-}
In order to avoid using the limit definition of the derivative each time we want to differentiate a function, we develop some basic rules.
## Power Functions {-}
::: {style="color: blue;"}
**Theorem (Derivative of a Constant):**
Let $c \in \mathbb{R}$. Then $\frac{d}{dx} (c) = 0$.
:::
::: {style="color: blue;"}
**Theorem (Derivative of a Power):** Let $n \in \mathbb{R}$ and $f(x) = x^n$. Then $f^{\prime}(x) = nx^{n-1}$.
:::
::: {style="color: green;"}
**Example:** Let $y = x^6$. Find $y^{\prime}$.
:::
::: {style="color: green;"}
**Solution:** Using the derivative of a power rule, $$y^{\prime} = 6x^{6-1} = 6x^5.$$
:::
::: {style="color: blue;"}
**Theorem (Sum Rule):** Let $f(x)$ and $g(x)$ be differentiable functions. Then \[\frac{d}{dx} \left[ f(x) \pm g(x)\right] = \frac{df}{dx} \pm \frac{dg}{dx}.\]
:::
::: {style="color: green;"}
**Example:** Let $y = x^4 + x^2 - x + 10$. Find $y^{\prime}$.
:::
::: {style="color: green;"}
**Solution:** Using the power rule and the sum rule, \begin{align*} y^{\prime} &= \frac{d}{dx} x^4 + x^2 - x + 10\\
&= 4x^{4-1} + 2x^{2-1} - 1x^{1-1} + 0\\
&= 4x^{3} + 2x - 1.
\end{align*} Therefore, $y^{\prime} = 4x^{3} + 2x - 1$.
:::
::: {style="color: blue;"}
**Theorem (Constant Multiple Rule):** Let $f(x)$ be a differentiable function. Then $\frac{d}{dx} cf(x)= c\frac{d}{dx} f(x)$.
:::
::: {style="color: green;"}
**Example:** Let $y = 5x^3 + 2x^{2.5} - 5x^{6/5} + 4 - 3x^{-1/3}$. Find $\frac{dy}{dx}$.
:::
::: {style="color: green;"}
**Solution:**
Using our differentiation laws, \begin{align*} \dfrac{dy}{dx} &= \frac{d}{dx}5x^3 + 2x^{2.5} - 5x^{6/5} + 4 - 3x^{-1/3}\\
&= 5(3)x^{3-1} + 2(2.5)x^{2.5-1} - 5(6/5)x^{6/5-1} + 0 - 3(-1/3)x^{-1/3-1}\\
&= 15x^{2} + 5x^{1.5} - 6x^{1/5} + x^{-2/3}.
\end{align*} Therefore, $\frac{dy}{dx} = 15x^{2} + 5x^{1.5} - 6x^{1/5} + x^{-2/3}$.
:::
::: {style="color: green;"}
**Example:** Let $y = \frac{1}{3x^3} - \sqrt{x} + \sqrt[3]{x} + x^{\pi} - e^{\pi}$. Find $\frac{dy}{dx}$.
:::
::: {style="color: green;"}
**Solution:** Using our differentiation laws, \begin{align*} \dfrac{dy}{dx} &= \frac{d}{dx}\frac{1}{3x^3} - \sqrt{x} + \sqrt[3]{x} + x^{\pi} - e^{\pi}\\
&= \frac{d}{dx} 3x^{-3} -x^{1/2} + x^{1/3} + x^{\pi} - e^{\pi}\\
&= 3(-3)x^{-3-1} -(1/2)x^{1/2-1} + (1/3)x^{1/3-1} + \pi x^{\pi-1} - 0\\
&= -9x^{-4} -(1/2)x^{-1/2} + (1/3)x^{-2/3} + \pi x^{\pi-1}.
\end{align*} Therefore, $\frac{dy}{dx} = -9x^{-4} -(1/2)x^{-1/2} + (1/3)x^{-2/3} + \pi x^{\pi-1}$.
:::
Practice Problems
A. Find $y^{\prime}$.
* $y = 4x^3 - 2x^2 + x - 10$
* $y = 25x^2 - x^{-3} + x^{-5} + 5$
* $y = x^{-1} + x^{-2/3} + x^{-4/3}$
* $y = x^{4/5} - 3x^{10/7} + x^{3/5}$
B. Find $\frac{dy}{dx}$.
* $y = \sqrt{x} + 4\sqrt[4]{x} - 3\sqrt[5]{x}$
* $y = \dfrac{1}{\sqrt{x}} + 4\sqrt{x}$
* $y = \dfrac{x^3 + x^2 + x + 1}{x}$
* $y = (x^2 + 1)(x^3 - 1)$
## Proof of Differentiation Rules {-}
::: {style="color: blue;"}
**Theorem (Derivative of a Constant):** Let $c \in \mathbb{R}$. Then \[\frac{d}{dx} (c) = 0.\]
:::
::: {style="color: blue;"}
**Proof:** Let $c \in \mathbb{R}$ and $f(x) = c$. Then
\begin{align*} \frac{d}{dx} f(x) &= \lim_{h \rightarrow 0} \dfrac{f(x+h) - f(x)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{c - c}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{0}{h}\\
&= \lim_{h \rightarrow 0} 0\\
&= 0.
\end{align*} Therefore, $\frac{d}{dx} (c) = 0$.
:::
The power rule is true for all $n \in \mathbb{R}$. At this point, we are unable to prove the general case. We can prove the power rule for $n \in \mathbb{Z}^+$.
::: {style="color: blue;"}
**Theorem (Power Rule):** Let $n \in \mathbb{Z}^+$. Then \[\frac{d}{dx} x^n = nx^{n-1}.\]
:::
::: {style="color: blue;"}
**Proof:** Let $n \in \mathbb{Z}^+$ and $f(x) = x^n$. Then
\begin{align*}
\frac{d}{dx} f(x) &= \lim_{h \rightarrow 0} \; \dfrac{f(x+h) - f(x)}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{(x+h)^n - x^n}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{x^n + \frac{n(n-1)}{2}x^{n-1}h + \frac{n(n-1)(n-2)}{3!}x^{n-2}h^2 + \cdots + nxh^{n-1} + h^n- x^n}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{nx^{n-1}h + \frac{n(n-1)}{2!}x^{n-2}h^2 + \cdots + nxh^{n-1} + h^{n}}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{h\left[nx^{n-1} + \frac{n(n-1)}{2!}x^{n-2}h + \cdots + nxh^{n-2} + h^{n-1}\right]}{h}\\
&= \lim_{h \rightarrow 0} \; nx^{n-1} + \frac{n(n-1)}{2!}x^{n-2}h + \cdots + nxh^{n-2} + h^{n-1}\\
&= nx^{n-1}.
\end{align*} Therefore, $\frac{d}{dx} x^n = nx^{n-1}$.
:::
::: {style="color: blue;"}
**Theorem (Sum Rule):** Let $f(x)$ and $g(x)$ be differentiable functions. Then \[\frac{d}{dx} \left[ f(x) \pm g(x)\right] = \frac{df}{dx} \pm \frac{dg}{dx}.\]
:::
::: {style="color: blue;"}
**Proof:** Let $f(x)$ and $g(x)$ be differentiable and take $k(x) = f(x) \pm g(x)$. Then
\begin{align*}
\frac{d}{dx} k(x) &= \lim_{h \rightarrow 0} \; \dfrac{k(x+h) - k(x)}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{f(x+h) \pm g(x+h) - [f(x) \pm g(x)]}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{[f(x+h) - f(x)] \pm [g(x+h) - g(x)]}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{f(x+h) - f(x)}{h} \pm \dfrac{g(x+h) - g(x)}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{f(x+h) - f(x)}{h} \pm \lim_{h \rightarrow 0} \; \dfrac{g(x+h) - g(x)}{h}\\
&= \dfrac{df}{dx} \pm \dfrac{dg}{dx}.
\end{align*} Therefore, $\frac{d}{dx} \left[ f(x) \pm g(x)\right] = \frac{df}{dx} \pm \frac{dg}{dx}$.
:::
::: {style="color: blue;"}
**Theorem (Constant Multiple Rule):** Let $f(x)$ be a differentiable function. Then \[\frac{d}{dx} cf(x)= c\frac{d}{dx} f(x).\]
:::
::: {style="color: blue;"}
**Proof:** Let $f(x)$ be differentiable and $c \in \mathbb{R}$. Then
\begin{align*}
\frac{d}{dx} cf(x) &= \lim_{h \rightarrow 0} \; \dfrac{cf(x+h) - cf(x)}{h}\\
&= \lim_{h \rightarrow 0} \; \dfrac{c\left[f(x+h) - f(x)\right]}{h}\\
&= \lim_{h \rightarrow 0} \; c\dfrac{f(x+h) - f(x)}{h}\\
&= c \; \lim_{h \rightarrow 0} \; \dfrac{f(x+h) - f(x)}{h}\\
&= c \dfrac{d}{dx} f(x).
\end{align*} Therefore, $\frac{d}{dx} cf(x)= c\frac{d}{dx} f(x)$.
:::
## Derivatives of Exponential Functions {-}
::: {style="color: blue;"}
**Theorem (Derivative of Exponential Functions):** Let $a \in \mathbb{R}$. Then \[\dfrac{d}{dx} a^x = a^x \ln(a) \;\;\; \text{ and } \;\;\; \dfrac{d}{dx} e^x = e^x.\]
:::
We will prove this rule later in the book.
|![](Pic42.png)|
|:--:|
::: {style="color: green;"}
**Example:** Let $y = 5e^x - 10^x$. Find $\frac{dy}{dx}$.
:::
::: {style="color: green;"}
**Solution:** Using our differentiation laws, \begin{align*} \dfrac{dy}{dx} &= \frac{d}{dx}\left(5e^x - 10^x\right)\\
&= 5\frac{d}{dx}e^x - \frac{d}{dx}10^x\\
&= 5e^x - 10^x \ln(10).
\end{align*} Therefore, $\frac{dy}{dx} = 5e^x - 10^x \ln(10)$.
:::
::: {style="color: green;"}
**Example:** Let $f(x) = 2^x + 2^{2x} + 2^{3x}$. Find $f^{\prime}(x)$.
:::
::: {style="color: green;"}
**Solution:** Using our differentiation laws, \begin{align*} f^{\prime}(x) &= \frac{d}{dx}\left(2^x + 2^{2x} + 2^{3x}\right)\\
&= \frac{d}{dx}2^x + \frac{d}{dx}2^{2x} + \frac{d}{dx}2^{3x}\\
&= \frac{d}{dx}2^x + \frac{d}{dx}4^{x} + \frac{d}{dx}8^{x}\\
&= 2^x\ln(2) + 4^{x}\ln(4) + 8^{x}\ln(8).
\end{align*} Therefore, $f^{\prime}(x) = 2^x\ln(2) + 4^{x}\ln(4) + 8^{x}\ln(8)$.
:::
Practice Problems
1. Find $y^{\prime}$.
* $y = e^x + 4^x$
* $y = 5 + 3^{3x}$
* $y = 2^x + x^2 - 4$
* $y = (e^x - e^x)(e^x + e^x)$
* $y = e^x + x^e$
* $y = 3e^x + \dfrac{2}{x} - \dfrac{5}{x^2}$
* $y = \sqrt[4]{x} - 4e^x$
* $y = e^{x+1} + 1$
* $y = e^{2x}$
* $y = e^{nx}$, for $n \not = 0$.
2. Find the equation of the tangent line at the indicated point. Sketch the graph and the tangent line.
* $y = e^x$ at $a = 1$
* $y = 2 + 3^{x}$ $a = 0$
* $y = 2^x - 4$ at $a = 2$
* $y = e^x + 2^x$ at $a = 0$
# 3.2 The Product and the Quotient Rule {-}
## The Product Rule {-}
In this section, we deal with finding the derivative of a product of functions.
::: {style="color: blue;"}
**Theorem (Product Rule):** Let $f$ and $g$ be differentiable function. Then \[\dfrac{d}{dx}(f(x)g(x)) = g(x)\dfrac{d}{dx}f(x) + f(x) \dfrac{d}{dx} g(x).\]
:::
Essentially, if you are taking the derivative of a product of two functions, you differentiate the first function, multiply that by the second function, take the derivative of the second function, multiply that by the first function then add the two products together. In other words, \[(uv)^{\prime} = u^{\prime}v+ v^{\prime}u.\]
::: {style="color: green;"}
**Example:** Differentiate $y = x^2e^x$.
:::
::: {style="color: green;"}
**Solution:** Let $u = x^2$ and $v = e^x$. Then, $u^{\prime} = 2x$ and $v^{\prime} = e^x$. By the product rule,
\begin{align*} \dfrac{d}{dx} x^2e^x &= \dfrac{d}{dx} uv\\
&= u^{\prime} v + v^{\prime} u\\
&= 2x(e^x) + e^x(x^2).
\end{align*}
Therefore, $y^{\prime} = 2x(e^x) + e^x(x^2)$.
:::
::: {style="color: green;"}
**Example:** Find the derivative of $f(x) = (x^4 + 5x^3 + 4x^3 + 2x + 1)2^x$.
:::
::: {style="color: green;"}
**Solution:** Let $u = x^4 + 5x^3 + 4x^3 + 2x + 1$ and $v = 2^x$. Then, $u^{\prime} = 4x^3 + 15x^2 + 12x^2 + 2$ and $v^{\prime} = 2^x\ln 2$. By the product rule,
\begin{align*} \dfrac{d}{dx} (x^4 + 5x^3 + &4x^3 + 2x + 1)2^x\\
&= \dfrac{d}{dx} uv\\
&= u^{\prime} v + v^{\prime} u\\
&= 4x^3 + 15x^2 + 12x^2 + 2(2^x) + 2^x\ln 2(x^4 + 5x^3 + 4x^3 + 2x + 1).
\end{align*}
So, $f^{\prime}(x) = 4x^3 + 15x^2 + 12x^2 + 2(2^x) + 2^x\ln 2(x^4 + 5x^3 + 4x^3 + 2x + 1)$.
:::
::: {style="color: green;"}
**Example:** Find $f^{\prime}(x)$ given $f(x) = 2^xe^{x-1}$.
:::
::: {style="color: green;"}
**Solution:** First, note that $e^{x-1} = e^x/e = \frac{1}{e}e^x$. So, $f(x) = \frac{1}{e} 2^xe^x$. Now, let $u = 2^x$ and $v = e^x$. Then, $u^{\prime} = 2^x\ln 2$ and $v^{\prime} = e^x$. By the product rule,
\begin{align*} \dfrac{d}{dx} \dfrac{1}{e}2^xe^x &= \dfrac{1}{e} \dfrac{d}{dx} uv\\
&= \dfrac{1}{e} \left(u^{\prime} v + v^{\prime} u \right)\\
&= \dfrac{1}{e}\left(2^x\ln 2 e^x + 2^xe^x \right).
\end{align*}
Therefore, $f^{\prime}(x) = \dfrac{1}{e}\left(2^x\ln 2 e^x + 2^xe^x \right)$.
:::
Practice Problems
1. Differentiate.
* $y = x^3e^x$
* $y = x 2^x$
* $y = (x^2 + x + 1)e^x$
* $y = 2^x(e^x + e^x)$
* $y = \ln(5)(x^2 + 1)3^x$
* $y = 2^x \left(\dfrac{x^2 + 3x+2}{x+1}\right)$
* $y = e^x\sqrt{x}$
* $y = \ln(2)e^{x+2} 4^{2x}$
* $y = (x^2 + 3x + 1)\sqrt{x}$
* $y = x^{-2}(4+5x^{-3}$
2. If $f(2) = -8$, $f^{\prime}(2) = 5$, $g(2) = 15$ and $g^{\prime}(2) = -3$, find $(fg)^{\prime}(2)$.
3. If $f(x) = x^3g(x)$, $g(7) = 2$ and $g^{\prime}(7) = -9$, find $f^{\prime}(7)$.
4. Find the equation of the tangent line to each of the following functions at the indicated point.
* $y = 2xe^x + 3$ at $a = 0$
* $y = x^22^x$ at $a = 1$
* $y = \sqrt{x}e^x$ at $a = 1$
* $y = (1 + 5\sqrt{x})(4-2x)$ at $a = 9$.
## Proof of the Product Rule {-}
::: {style="color: blue;"}
**Theorem (Product Rule):** Let $f$ and $g$ be differentiable function. Then \[\dfrac{d}{dx}(f(x)g(x)) = g(x)\dfrac{d}{dx}f(x) + f(x) \dfrac{d}{dx} g(x).\]
:::
::: {style="color: blue;"}
**Proof:** Let $f$ and $g$ be differentiable functions. We need to show that \[\dfrac{d}{dx}(f(x)g(x)) = \lim_{h \rightarrow 0} \dfrac{f(x + h)g(x+h) - f(x)g(x)}{h} = g(x)\dfrac{d}{dx}f(x) + f(x) \dfrac{d}{dx} g(x).\] Since $f$ and $g$ are differentiable, we know that \[\dfrac{d}{dx} f(x) = \lim_{h \rightarrow 0} \dfrac{f(x+h) - f(x)}{h} \;\;\; \text{ and } \;\;\; \dfrac{d}{dx} g(x) = \lim_{h \rightarrow 0} \dfrac{g(x+h) - g(x)}{h}\] both exist. Observe that,
\begin{align*}
\dfrac{d}{dx}(f(x)g(x)) &= \lim_{h \rightarrow 0} \dfrac{f(x + h)g(x+h) - f(x)g(x)}{h}\\
&= \mathop {\lim }\limits_{h \to 0} \frac{{f\left( {x + h} \right)g\left( {x + h} \right) - g\left( {x + h} \right)f\left( x \right) + g\left( {x + h} \right)f\left( x \right) - f\left( x \right)g\left( x \right)}}{h}\\
&= \mathop {\lim }\limits_{h \to 0} \frac{{g\left( {x + h} \right)\left( {f\left( {x + h} \right) - f\left( x \right)} \right)}}{h} + \mathop {\lim }\limits_{h \to 0} \frac{{f\left( x \right)\left( {g\left( {x + h} \right) - g\left( x \right)} \right)}}{h}\\
& = \mathop {\lim }\limits_{h \to 0} g\left( {x + h} \right)\frac{{f\left( {x + h} \right) - f\left( x \right)}}{h} + \mathop {\lim }\limits_{h \to 0} f\left( x \right)\frac{{g\left( {x + h} \right) - g\left( x \right)}}{h}\\
& = \mathop {\lim }\limits_{h \to 0} g\left( {x + h} \right) \lim_{h \rightarrow 0}\frac{{f\left( {x + h} \right) - f\left( x \right)}}{h} + \mathop {\lim }\limits_{h \to 0} f\left( x \right) \lim_{h \rightarrow 0} \frac{{g\left( {x + h} \right) - g\left( x \right)}}{h}\\
&= g(x) \dfrac{d}{dx}f(x) + f(x) \dfrac{d}{dx} g(x).
\end{align*}
:::
Practice Problems
1. If $f$, $g$ and $h$ are all differentiable functions, prove that \[\dfrac{d}{dx} f(x)g(x)h(x) = g(x)h(x) \dfrac{d}{dx}f(x) + f(x)h(x) \dfrac{d}{dx}g(x) + f(x)g(x) \dfrac{d}{dx}h(x).\]
2. Calculate $f^{(n)}(x)$ for $f(x) = x^ne^x$ at $x = 0$.
## The Quotient Rule {-}
The quotient rule is a rule that helps find the derivative of the quotient of two functions.
::: {style="color: blue;"}
**Theorem (Quotient Rule):** Let $f$ and $g$ be differentiable function. Then \[\dfrac{d}{dx}\left(\dfrac{f(x)}{g(x)}\right) = \dfrac{g(x)\dfrac{d}{dx}f(x) - f(x) \dfrac{d}{dx} g(x)}{g(x)^2}.\]
:::
If you want to find the derivative of the quotient of two functions, take the function in the denominator square it and put it in the denominator. Take the denominator of the original and put a copy of it in the numerator. Multiply that by the derivative of the numerator and subtract the product of the derivative of the denominator and the original numerator. Essentially, \[\left( \dfrac{u}{v} \right)^{\prime} = \dfrac{u^{\prime}v - v^{\prime}u}{v^2}.\]
::: {style="color: green;"}
**Example:** Let $y = \dfrac{x^3}{e^x}$. Find $y^{\prime}$.
:::
::: {style="color: green;"}
**Solution:** Let $u = x^3$ and $v = e^x$. Then, we know that $u^{\prime} = 3x^2$ and $v^{\prime} = e^x$. By the quotient rule,
\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{x^3}{e^x}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{3x^2e^x - e^xx^3}{(e^x)^2}\\
&= \dfrac{e^x(3x^2- x^3)}{(e^x)^2}\\
&= \dfrac{3x^2- x^3}{e^x}.
\end{align*}
Therefore, by the quotient rule, we see that $y^{\prime} = \dfrac{3x^2-x^3}{e^x}$.
:::
::: {style="color: green;"}
**Example:** Let $y = \dfrac{1}{x + 5}$. Find $\dfrac{dy}{dx}$.
:::
::: {style="color: green;"}
**Solution:** Let $u = 1$ and $v = x+5$. Then, we know that $u^{\prime} = 0$ and $v^{\prime} = 1$. By the quotient rule,
\begin{align*} \dfrac{dy}{dx} &= \dfrac{d}{dx} \dfrac{1}{x+5}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{0(x+5) - 1(1)}{(x+5)^2}\\
&= \dfrac{1}{(x+5)^2}.
\end{align*}
Therefore, by the quotient rule, we see that $\dfrac{dy}{dx} = \dfrac{1}{(x+5)^2}$.
:::
::: {style="color: green;"}
**Example:** Differentiate $\dfrac{x^2}{x^3 + x + 1}$.
:::
\noindent\textbf{Solution:} Set $y = \dfrac{x^2}{x^3 + x + 1}$. Let $u = x^2$ and $v = x^3 + x + 1$. Then, we know that $u^{\prime} = 2x$ and $v^{\prime} = 3x^2 + 1$. By the quotient rule,
\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{x^2}{x^3 + x + 1}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{2x(x^3 + x + 1) - (3x^2 + 1)(x^2)}{(x^3 + x + 1)^2}\\
&= \dfrac{2x^4 + 2x^2 + 2x - 3x^4-x^2}{(x^3 + x + 1)^2}\\
&= \dfrac{-x^4 + x^2 + 2x}{(x^3 + x + 1)^2}.
\end{align*}
Therefore, by the quotient rule, we see that $y^{\prime} = \dfrac{-x^4 + x^2 + 2x}{(x^3 + x + 1)^2}$.
:::
::: {style="color: green;"}
**Example:** Let $f(x) = \dfrac{2^x}{\sqrt{x}e^x}$. Find $f^{\prime}(x)$.
:::
::: {style="color: green;"}
**Solution:** Let $u = 2^x$ and $v = \sqrt{x}e^x$. Then, we know that $u^{\prime} = 2^x\ln(2)$ and we note that since $v$ is a product of two functions, we need to use the product rule to find the derivative of $v$. If we let $m = \sqrt{x}$ and $n = e^x$, then $v = mn$ and $v^{\prime} = m^{\prime}n + n^{\prime}m$, where $m^{\prime} = (1/2)x^{-1/2}$ and $n^{\prime} = e^x$. So, $v^{\prime} = (1/2)x^{-1/2}e^x + e^x\sqrt{x}$. By the quotient rule,
\begin{align*} f^{\prime}(x) &= \dfrac{d}{dx} \dfrac{2^x}{\sqrt{x}e^x}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{2^x\ln(x)(\sqrt{x}e^x) - ((1/2)x^{-1/2}e^x + e^x\sqrt{x})2^x}{(\sqrt{x}e^x)^2}\\
&= \dfrac{e^x(2^x\ln(x)\sqrt{x} - (1/2)x^{-1/2}2^x - \sqrt{x}2^x)}{x(e^x)^2}\\
&= \dfrac{2^x\ln(x)\sqrt{x} - (1/2)x^{-1/2}2^x - \sqrt{x}2^x}{xe^x}.
\end{align*}
Therefore, by the quotient rule, $f^{\prime}(x) = \dfrac{2^x\ln(x)\sqrt{x} - (1/2)x^{-1/2}2^x - \sqrt{x}2^x}{xe^x}$.
:::
Practice Problems
1. Differentiate.
* $y = \dfrac{x^4}{3e^x}$
* $y = \dfrac{x}{2^x}$
* $y = \dfrac{e^x}{x^2 + x + 1}$
* $y = \dfrac{3^x}{e^x + 2^x}$
* $y = \dfrac{\ln(5)4^x}{x^2 + 1}$
* $y = \dfrac{\sqrt{x}}{2^x}$
* $y = \dfrac{e^x}{\sqrt{x}}$
* $y = \dfrac{\ln(2)e^{x+2}}{ 4^{2x}}$
* $y = \dfrac{x^2 + 3x + 1}{\sqrt{x}}$
* $y = \dfrac{x^{-2}}{4+5x^{-3}}$
2. Find the derivative.
* $y = 2^x\dfrac{x^2}{5e^x}$
* $y = \dfrac{x2^x}{x^3+1}$
* $y = \dfrac{xe^x}{x + 1}$
* $y = \dfrac{3^x}{x^2e^x}$
3. Find the equation of the tangent line to each of the following functions at the indicated point.
* $y = \dfrac{2x+1}{e^x}$ at $a = 0$
* $y = \dfrac{x^2}{\sqrt{x} + 1}$ at $a = 1$
* $y = \dfrac{3\sqrt{x}}{e^x}$ at $a = 1$
* $y = \dfrac{(1 + 5\sqrt{x})e^x}{4-2x}$ at $a = 0$.
## Proof of the Quotient Rule {-}
::: {style="color: blue;"}
**Theorem (Quotient Rule):** Let $f$ and $g$ be differentiable function. Then \[\dfrac{d}{dx}(\dfrac{f(x)}{g(x)}) = \dfrac{g(x)\dfrac{d}{dx}f(x) - f(x) \dfrac{d}{dx} g(x)}{g(x)^2}.\]
:::
::: {style="color: blue;"}
**Proof:** Let $f$ and $g$ be differentiable functions. We need to show that \[\dfrac{d}{dx}(\dfrac{f(x)}{g(x)}) = \lim_{h \rightarrow 0} \dfrac{\frac{f(x + h)}{g(x+h)} - \frac{f(x)}{g(x)}}{h} = \dfrac{g(x)\dfrac{d}{dx}f(x) - f(x) \dfrac{d}{dx} g(x)}{g(x)^2}.\] Since $f$ and $g$ are differentiable, we know that \[\dfrac{d}{dx} f(x) = \lim_{h \rightarrow 0} \dfrac{f(x+h) - f(x)}{h} \;\;\; \text{ and } \;\;\; \dfrac{d}{dx} g(x) = \lim_{h \rightarrow 0} \dfrac{g(x+h) - g(x)}{h}\] both exist. Observe that,
\begin{align*}\dfrac{d}{dx}\left(\dfrac{f(x)}{g(x)}\right) &= \mathop {\lim }\limits_{h \to 0} \frac{{\frac{{f\left( {x + h} \right)}}{{g\left( {x + h} \right)}} - \frac{{f\left( x \right)}}{{g\left( x \right)}}}}{h}\\
&= \mathop {\lim }\limits_{h \to 0} \frac{1}{h}\,\,\frac{{f\left( {x + h} \right)g\left( x \right) - f\left( x \right)g\left( {x + h} \right)}}{{g\left( {x + h} \right)g\left( x \right)}}\\
&= \mathop {\lim }\limits_{h \to 0} \frac{1}{h}\,\,\frac{{f\left( {x + h} \right)g\left( x \right) - f\left( x \right)g\left( x \right) + f\left( x \right)g\left( x \right) - f\left( x \right)g\left( {x + h} \right)}}{{g\left( {x + h} \right)g\left( x \right)}}\\
&= \mathop {\lim }\limits_{h \to 0} \frac{1}{{g\left( {x + h} \right)g\left( x \right)}}\,\,\frac{{f\left( {x + h} \right)g\left( x \right) - f\left( x \right)g\left( x \right) + f\left( x \right)g\left( x \right) - f\left( x \right)g\left( {x + h} \right)}}{h}\\
&= \mathop {\lim }\limits_{h \to 0} \frac{1}{{g\left( {x + h} \right)g\left( x \right)}}\,\,\left( {\frac{{f\left( {x + h} \right)g\left( x \right) - f\left( x \right)g\left( x \right)}}{h} + \frac{{f\left( x \right)g\left( x \right) - f\left( x \right)g\left( {x + h} \right)}}{h}} \right)\\
&= \mathop {\lim }\limits_{h \to 0} \frac{1}{{g\left( {x + h} \right)g\left( x \right)}}\,\,\left( {g\left( x \right)\frac{{f\left( {x + h} \right) - f\left( x \right)}}{h} - f\left( x \right)\frac{{g\left( {x + h} \right) - g\left( x \right)}}{h}} \right)\\
& = \frac{1}{{\mathop {\lim }\limits_{h \to 0} g\left( {x + h} \right)\mathop {\lim }\limits_{h \to 0} g\left( x \right)}}\,\left( {\left( {\mathop {\lim }\limits_{h \to 0} g\left( x \right)} \right)\left( {\mathop {\lim }\limits_{h \to 0} \frac{{f\left( {x + h} \right) - f\left( x \right)}}{h}} \right) - } \right.\\
& \hspace{2.25in}\left. {\left( {\mathop {\lim }\limits_{h \to 0} f\left( x \right)} \right)\left( {\mathop {\lim }\limits_{h \to 0} \frac{{g\left( {x + h} \right) - g\left( x \right)}}{h}} \right)} \right)\\
& = \frac{1}{{g\left( x \right)g\left( x \right)}}\,\,\left( {g\left( x \right)f'\left( x \right) - f\left( x \right)g'\left( x \right)} \right)\\ & = \dfrac{g(x)\dfrac{d}{dx}f(x) - f(x) \dfrac{d}{dx} g(x)}{g(x)^2}.
\end{align*}
:::
Practice Problems
1. If $g$ is differentiable, find $f^{\prime}(x)$ given \[f(x) = \dfrac{g(x)}{x^3}.\]
2. If $g$ is differentiable, find $f^{\prime}(x)$ given \[f(x) = \dfrac{1 + x^2g(x)}{x}.\]
3. If $g$ is differentiable, find $f^{\prime}(x)$ given \[f(x) = \dfrac{2 + xg(x)}{\sqrt{x}}.\]
4. Calculate $f^{(n)}(x)$ for $f(x) = \dfrac{x^n}{e^x}$ at $x = 0$.
5. If $f$ and $g$ are differentiable, find $\left(\dfrac{f}{g}\right)^{\prime}(4)$ given $f(4) = 5$, $f^{\prime}(4) = -3$, $g(4) = 6$ and $g^{\prime}(4) = 5$.
6. If $f$, $g$ and $h$ are differentiable, find $\dfrac{d}{dx} \dfrac{f(x)/g(x)}{h(x)}$ assuming $h(x), g(x) \not = 0$.
7. Define $\sinh(x) = \dfrac{e^x - e^{-x}}{2}$ as the hyperbolic sine function. Find the derivative of $\sinh(x)$.
8. Define $\cosh(x) = \dfrac{e^x + e^{-x}}{2}$ as the hyperbolic cosine function. Find the derivative of $\cosh(x)$.
# 3.3 Derivatives of Trigonometric Functions {-}
## Derivative of $\sin(x)$ and $\cos(x)$ {-}
In this section, we differentiate $\sin(x)$ and $\cos(x)$.
::: {style="color: blue;"}
**Theorem (Derivative of sine and cosine):** The derivative of $\sin(x)$ is $\cos(x)$ and the derivative of $\cos(x)$ is $-\sin(x)$. That is, \[\dfrac{d}{dx}\sin(x) = \cos(x) \hspace{0.5in} \text{and} \hspace{0.5in} \dfrac{d}{dx} \cos(x) = -\sin(x).\]
:::
All of the rules that we have studied previously still apply here.
::: {style="color: green;"}
**Example:** Let $f(x) = 5x\sin(x)$. Find $f^{\prime}(x)$.
:::
::: {style="color: green;"}
**Solution:** The function $5x\sin(x)$ is a constant multiplied by a product of two functions. So, the product rule applies here. Let $u = x$ and $v = \sin(x)$. Then, we know that $u^{\prime} = 1$ and $v^{\prime} = \cos(x)$. By the product rule,
\begin{align*} f^{\prime}(x) &= \dfrac{d}{dx} 5x\sin(x)\\
&= 5\dfrac{d}{dx} uv\\
&= 5(u^{\prime}v + v^{\prime}u)\\
&= 5(1(\sin(x)) + \cos(x)(x))\\
&= 5\sin(x) + 5x\cos(x).
\end{align*}
Therefore, by the product rule, $f^{\prime}(x) = 5\sin(x) + 5x\cos(x)$.
:::
::: {style="color: green;"}
**Example:** Let $y = \dfrac{\cos(x) + x}{3\sin(x)}$. Find $\dfrac{dy}{dx}$.
:::
::: {style="color: green;"}
**Solution:** The function $y$ is a quotient of two functions. So, one must use the quotient rule in this example. Let $u = \cos(x) + x$ and $v = 3\sin(x)$. Then, we know that $u^{\prime} = -\sin(x) + 1$ and $v^{\prime} = 3\cos(x)$. Using the quotient rule, we find that
\begin{align*} \dfrac{dy}{dx} &= \dfrac{d}{dx} \dfrac{\cos(x) + x}{3\sin(x)}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{(-\sin(x) + 1)(3\sin(x)) - 3\cos(x)(\cos(x) + 1)}{(3\sin(x))^2}\\
&= \dfrac{-3\sin^2(x) + 3\sin(x) - 3\cos^2(x) - 3\cos(x)}{9\sin^2(x)}\\
&= \dfrac{-3 + 3\sin(x) - 3\cos(x)}{9\sin^2(x)}\\
&= \dfrac{-1 + \sin(x) - \cos(x)}{3\sin^2(x)}.
\end{align*}
Therefore, by the quotient rule, $\dfrac{dy}{dx} =\dfrac{-1 + \sin(x) - \cos(x)}{3\sin^2(x)}$.
:::
::: {style="color: green;"}
**Example:** Let $y = \sin(x)\cos(x)$. Find $y^{\prime}$.
:::
::: {style="color: green;"}
**Solution:** We proceed by the product rule. Let $u = \sin(x)$ and $v = \cos(x)$. Then, we know that $u^{\prime} = \cos(x)$ and $v^{\prime} = -\sin(x)$. Using the product rule, we find that
\begin{align*} y^{\prime} &= \dfrac{d}{dx} \sin(x)cos(x)\\
&= \dfrac{d}{dx} uv\\
&= u^{\prime}v + v^{\prime}u\\
&= \cos(x)\cos(x) + (-\sin(x))\sin(x)\\
&= \cos^2(x) - \sin^2(x).
\end{align*}
Therefore, by the product rule, $y^{\prime}=\cos^2(x) - \sin^2(x)$.
:::
Practice Problems
1. Differentiate.
* $y = 3^x\sin(x)$
* $y = \cos(x)e^x$
* $y = x^3\sin(x)$
* $y = (x^5 + 2^x)\cos(x)$
* $y = (x^2 + x + 1)\sin(x)$
* $y = e^x(\sin(x) + \cos(x))$
* $y = \dfrac{\sin(x)}{2^x}$
* $y = \dfrac{x}{\cos(x)}$
* $y = \dfrac{e^x}{\sin(x) + x + 1}$
* $y = \dfrac{\cos(x) + x}{e^x + 2^x}$
* $y = \dfrac{\sin(x)}{x^2 + 1}$
* $y = \dfrac{\sqrt{x}}{\cos(x)}$
2. Find the equation of the tangent line at the given point.
* $y = \sin(x)$ at $a = \pi$
* $y = \cos(x)$ at $a = 0$
* $y = x^3\sin(x)$ at $a = 0$
* $y = e^x\cos(x)$ at $a = \pi$
## Other Trigonometric Derivatives {-}
In this section, we introduce the derivatives of the other four basic trigonometric functions.
::: {style="color: green;"}
**Example:** Let $y = \tan(x)$. Find $y^{\prime}$ for all values $x$ in the domain of $\tan(x)$.
:::
::: {style="color: green;"}
**Solution:** The function $y = \tan(x) = \dfrac{\sin(x)}{cos(x)}$ is a quotient of two functions. We proceed by the quotient rule. Let $u = \sin(x)$ and $v = \cos(x)$. Then, we know that $u^{\prime} = \cos(x)$ and $v^{\prime} = -\sin(x)$. Using the quotient rule, we find that
\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{\sin(x)}{\cos(x)}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{\cos(x)\cos(x) - (-\sin(x))\sin(x)}{(\cos(x))^2}\\
&= \dfrac{\cos^2(x)\cos(x) + \sin^2(x)}{\cos^2(x)}\\
&= \dfrac{1}{\cos^2(x)}\\
&= \sec^2(x).
\end{align*}
Therefore, by the quotient rule, $y^{\prime}=\sec^2(x)$.
:::
::: {style="color: blue;"}
**Theorem (Derivative of the tangent function):** For all $x$ in the domain of $\tan(x)$, we have \[\dfrac{d}{dx} \tan(x) = \sec^2(x).\]
:::
Remember that the domain of $\tan(x)$ is $\mathbb{R}-\{x|x = \pi/2 + k\pi, k \in \mathbb{Z}\}$. Therefore, the derivative of $\tan(x)$ is undefined at these points (since $\tan(x)$ has an infinite discontinuity at these points).
::: {style="color: green;"}
**Example:** Let $y = \sec(x)$. Find $y^{\prime}$ for all values $x$ in the domain of $\sec(x)$.
:::
::: {style="color: green;"}
**Solution:** The function $y = \sec(x) = \dfrac{1}{\cos(x)}$ is a quotient of two functions. We proceed by the quotient rule. Let $u = 1$ and $v = \cos(x)$. Then, we know that $u^{\prime} = 0$ and $v^{\prime} = -\sin(x)$. Using the quotient rule, we find that
\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{1}{\cos(x)}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{0\cos(x) - (-\sin(x))(1)}{(\cos(x))^2}\\
&= \dfrac{\sin(x)}{\cos^2(x)}\\
&= \dfrac{1}{\cos(x)}\dfrac{\sin(x)}{\cos(x)}\\
&= \sec(x)\tan(x).
\end{align*}
Therefore, by the quotient rule, $y^{\prime}=\sec(x)\tan(x)$.
:::
::: {style="color: blue;"}
**Theorem (Derivative of the secant function):** For all $x$ in the domain of $\sec(x)$, we have \[\dfrac{d}{dx} \sec(x) = \sec(x)\tan(x).\]
:::
Since $\cos(x) = 0$ at $x = \pi/2 + k\pi$ with $k \in \mathbb{Z}$, we know that the domain of $\sec(x)$ is $\mathbb{R} - \{x | x = \pi/2 + k\pi, k \in \mathbb{Z}\}$.
::: {style="color: green;"}
**Example:** Let $y = \csc(x)$. Find $y^{\prime}$ for all values $x$ in the domain of $\csc(x)$.
:::
::: {style="color: green;"}
**Solution:** The function $y = \csc(x) = \dfrac{1}{\sin(x)}$ is a quotient of two functions. We proceed by the quotient rule. Let $u = 1$ and $v = \sin(x)$. Then, we know that $u^{\prime} = 0$ and $v^{\prime} = \cos(x)$. Using the quotient rule, we find that
\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{1}{\sin(x)}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{0\sin(x) - \cos(x)(1)}{(\sin(x))^2}\\
&= \dfrac{\cos(x)}{\sin^2(x)}\\
&= \dfrac{1}{\sin(x)}\dfrac{\cos(x)}{\sin(x)}\\
&= \csc(x)\cot(x).
\end{align*}
Therefore, by the quotient rule, $y^{\prime}=\csc(x)\cot(x)$.
:::
::: {style="color: blue;"}
**Theorem (Derivative of the cosecant function):** For all $x$ in the domain of $\csc(x)$, we have \[\dfrac{d}{dx} \csc(x) = \csc(x)\cot(x).\]
:::
Since $\sin(x) = 0$ at integer multiples of $\pi$, we know that the domain of $\csc(x)$ is $\mathbb{R} - \{x | x = k\pi, k \in \mathbb{Z}\}$.
::: {style="color: green;"}
**Example:** Let $y = \cot(x)$. Find $y^{\prime}$ for all values $x$ in the domain of $\cot(x)$.
:::
::: {style="color: green;"}
**Solution:** The function $y = \cot(x) = \dfrac{\cos(x)}{\sin(x)}$ is a quotient of two functions. We proceed by the quotient rule. Let $u = \cos(x)$ and $v = \sin(x)$. Then, we know that $u^{\prime} = -\sin(x)$ and $v^{\prime} = \cos(x)$. Using the quotient rule, we find that
\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{\cos(x)}{\sin(x)}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{-\sin(x)\sin(x) - \cos(x)\cos(x)}{(\sin(x))^2}\\
&= \dfrac{-1}{\sin^2(x)}\\
&= -\csc^2(x).
\end{align*}
Therefore, by the quotient rule, $y^{\prime}=-\csc^2(x)$.
:::
::: {style="color: blue;"}
**Theorem (Derivative of the cotangent function):** For all $x$ in the domain of $\cot(x)$, we have \[\dfrac{d}{dx} \cot(x) = -\csc^2(x).\]
:::
Since $\sin(x) = 0$ at integer multiples of $\pi$, we know that the domain of $\cot(x)$ is $\mathbb{R} - \{x | x = k\pi, k \in \mathbb{Z}\}$.
::: {style="color: green;"}
**Example:** Let $f(x) = \dfrac{\csc(x)e^x}{x^2}$. Find $f^{\prime}(x)$ for $x \not = 0$.
:::
::: {style="color: green;"}
**Solution:** The function $f(x) = \dfrac{\csc(x)e^x}{x^2}$ is a quotient of two functions with the numerator a product of two functions. We proceed by the quotient rule. Let $u = \csc(x)e^x$ and $v = x^2$. Then, we know that $u^{\prime} = \csc(x)\cot(x)e^x + e^x\csc(x)$ (by the product rule) and $v^{\prime} = 2x$. Using the quotient rule, we find that
\begin{align*} y^{\prime} &= \dfrac{d}{dx} \dfrac{\csc(x)e^x}{x^2}\\
&= \dfrac{d}{dx} \dfrac{u}{v}\\
&= \dfrac{u^{\prime}v - v^{\prime}u}{v^2}\\
&= \dfrac{(\csc(x)\cot(x)e^x + e^x\csc(x))x^2 - 2x(\csc(x)e^x)}{(x^2)^2}\\
&= \dfrac{xe^x(x\csc(x)\cot(x) + x\csc(x) - 2\csc(x))}{x^4}\\
&= \dfrac{e^x(x\csc(x)\cot(x) + x\csc(x) - 2\csc(x))}{x^3}.
\end{align*}
Therefore, by the quotient rule, $f^{\prime}(x)= \dfrac{e^x(x\csc(x)\cot(x) + x\csc(x) - 2\csc(x))}{x^3}$.
:::
Practice Problems
1. Differentiate.
* $y = x^2\sec(x)$
* $y = \cot(x)e^x$
* $y = (x^3 + 9\sin(x))\csc(x)$
* $y = (8x^5 + \sin(x)2^x)\cot(x)$
* $y = (7x^2 + x\sin(x) + 1)\sec(x)$
* $y = e^x(\csc(x) + 6\cot(x))$
* $y = \dfrac{5\sec(x)}{2^x}$
* $y = \dfrac{x}{4\csc(x)}$
* $y = \dfrac{e^x}{\cot(x) + \sin(x)}$
* $y = \dfrac{\cos(x) + 3x}{\csc(x)}$
* $y = \dfrac{\sin(x)}{2\cot(x) + 1}$
* $y = \dfrac{4\sqrt{x}}{\sec(x)}$
2. Find the equation of the tangent line at the given point.
* $y = \csc(x)$ at $a = \pi$
* $y = \cot(x)$ at $a = 3\pi/2$
* $y = x^3\sec(x)$ at $a = 0$
* $y = e^x\cot(x)$ at $a = \pi$
## Proofs of Trigonometric Derivatives {-}
The derivatives for $\tan(x)$, $\sec(x)$, $\csc(x)$ and $\cot(x)$ were predicated on the derivatives of $\sin(x)$ and $\cos(x)$ being what we claimed. Consequently, we cannot consider these derivative rules proved until we prove the derivative of the sine and cosine functions. In this section, we do just that.
::: {style="color: blue;"}
**Theorem (Derivative of the sine and cosine functions):** The derivative of $\sin(x)$ is $\cos(x)$. That is, \[\dfrac{d}{dx}\sin(x) = \cos(x).\]
:::
::: {style="color: blue;"}
**Proof:** We use the limit definition of the derivative. Let $f(x) = \sin(x)$.
\begin{align*} \dfrac{d}{dx} \sin(x) &= \lim_{h \rightarrow 0} \dfrac{f(x+h) - f(x)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{\sin(x+h) - \sin(x)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{\sin(x)\cos(h) + \cos(x)\sin(h) - \sin(x)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{\sin(x)(\cos(h) - 1) + \cos(x)\sin(h)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{\sin(x)(\cos(h) - 1)}{h} + \lim_{h \rightarrow 0}\dfrac{\cos(x)\sin(h)}{h}\\
&= \sin(x)\lim_{h \rightarrow 0} \dfrac{\cos(h) - 1}{h} + \cos(x)\lim_{h \rightarrow 0}\dfrac{\sin(h)}{h}\\
&= \sin(x)(0) + \cos(x)(1)\\
&= \cos(x).
\end{align*}
The last two limits were as a result of Theorem \ref{Thm:TrigLimits}.
:::
::: {style="color: blue;"}
**Theorem (Squeeze Theorem):** The derivative of $\cos(x)$ is $-\sin(x)$. That is, \[\dfrac{d}{dx} \cos(x) = -\sin(x).\]
:::
::: {style="color: blue;"}
**Proof:** We use the limit definition of the derivative. Let $f(x) = \cos(x)$.
\begin{align*} \dfrac{d}{dx} \cos(x) &= \lim_{h \rightarrow 0} \dfrac{f(x+h) - f(x)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{\cos(x+h) - \cos(x)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{\cos(x)\cos(h) - \sin(x)\sin(h) - \cos(x)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{\cos(x)(\cos(h) - 1) - \sin(x)\sin(h)}{h}\\
&= \lim_{h \rightarrow 0} \dfrac{\cos(x)(\cos(h) - 1)}{h} - \lim_{h \rightarrow 0}\dfrac{\sin(x)\sin(h)}{h}\\
&= \cos(x)\lim_{h \rightarrow 0} \dfrac{\cos(h) - 1}{h} - \sin(x)\lim_{h \rightarrow 0}\dfrac{\sin(h)}{h}\\
&= \cos(x)(0) - \sin(x)(1)\\
&=-\sin(x).
\end{align*}
The final two limits are as a result of Theorem \ref{Thm:TrigLimits}.
:::
Practice Problems
1. Find the derivative of $\sec^3(x)$.
2. Find the derivative of $\dfrac{\sin^2(x)}{\cos^2(x)}$.
3. Evaluate $\displaystyle\lim_{h \rightarrow 0} \dfrac{\sin(\pi/3 + h) - \sin(\pi/3)}{h}$.
4. Find the $3^{rd}$ derivative of $x^2\csc(x)$.
## Higher Derivatives {-}
The term higher derivative refers to second, third and, in general, $n^{th}$ derivatives. A function like \[f(x) = 4x^3 + 5x^2 + 8x + 3\] has first derivative \[f^{\prime}(x) = 12x^2 + 10x + 8.\] The second derivative of $f$ is \[f^{\prime \prime}(x) = 24x + 10\] The third derivative is \[f^{\prime \prime \prime}(x) = 24.\] Of course, the fourth derivative of $f$ is \[f^{(4)}(x) = 0.\]
::: {style="color: blue;"}
**Theorem:** If $p(x)$ is a polynomial of degree $n$ then, \[p^{(k)}(x) = 0,\] for all $k \geq n+1$.
:::
::: {style="color: blue;"}
**Proof:** Any derivative of a polynomial reduces the degree of the polynomial by one. Therefore, if $p$ is a polynomial of degree $n$, the degree of the $n^{th}$ derivative of $p$ will be 0 (ie, a constant). The $n+1^{st}$ derivative and all subsequent derivatives will therefore be 0.
:::
::: {style="color: green;"}
**Example:** Find the $n^{th}$ derivative of the function $f(x) = \sin(x)$.
:::
::: {style="color: green;"}
**Solution:** We can find the first few derivatives of $f$ and we can then try to extrapolate a general case.
\begin{align*}
f(x) &= \sin(x)\\
f^{\prime}(x) &= \cos(x)\\
f^{\prime \prime}(x) &= -\sin(x)\\
f^{\prime \prime \prime}(x) &= -\cos(x)\\
f^{(4)}(x) &= \sin(x)\\
f^{(5)}(x) &= \cos(x)\\
f^{(6)}(x) &= -\sin(x)\\
f^{(7)}(x) &= -\cos(x)\\
f^{(8)}(x) &= \sin(x).
\end{align*}
We can see that there is a cyclical pattern for the derivatives. Consider the integer $n$. It can take the form $n = 4k$, $n = 4k+1$, $n = 4k+2$, or $n = 4k+3$ (where $k$ is an integer). When $n$ has the form $4k$ (as in $f(x)$, $f^{(4)}(x)$ and $f^{(8)}(x)$), the $n^{th}$ derivative is $f^{(n)}(x) = \sin(x)$. When $n$ has the form $4k+1$ (as in $f^{\prime}(x)$ or $f^{(5)}$), we have $f^{(n)}(x) = \cos(x)$. If $n = 4k+2$, $f^{(n)}(x) = -\sin(x)$ and when $n = 4k+3$, we see that $f^{(n)}(x) = -\cos(x)$. We can write \[f^{(n)}(x) = \begin{cases} \sin(x) & n = 4k\\ \cos(x) & n = 4k+1\\ -\sin(x) & n=4k+2\\ -\cos(x) & n = 4k+3 \end{cases}.\]
:::
Many times a pattern emerges. In the previous example, it was a result of the cyclical pattern of the derivatives of trigonometric functions. The next example deals with constants that result from the chain rule.
::: {style="color: green;"}
**Example:** Find the $n^{th}$ derivative of the function $f(x) = e^{2x}$.
:::
::: {style="color: green;"}
**Solution:** We can find the first few derivatives of $f$ and we can then try to extrapolate a general case.
\begin{multicols}{2}
\begin{align*}
f(x) &= e^{2x}\\
f^{\prime}(x) &= 2e^{2x}\\
f^{\prime \prime}(x) &= 4e^{2x}\\
f^{\prime \prime \prime}(x) &= 8e^{2x}\\
f^{(4)}(x) &= 16e^{2x}.
\end{align*}
\end{multicols}
We can see that there is again a pattern for the derivatives. The third derivative is $2^3e^{2x}$ and the fourth derivative is $2^4e^{2x}$. It appears that, in general, we have \[f^{(n)}(x) = 2^ne^{2x}.\]
:::
We can find a higher derivative using implicit differentiation.
::: {style="color: green;"}
**Example:** Find the second derivative of the curve $x^2 + y^2 = 2xy$.
:::
::: {style="color: green;"}
**Solution:** We can find the first few derivatives using implicit differentiation:
\begin{align*}
x^2 + y^2 &= 2\\
2x + 2y \dfrac{dy}{dx} &=0\\
\dfrac{dy}{dx} &= \dfrac{-x}{y}.
\end{align*}
We differentiate again.
\begin{align*}
\dfrac{dy}{dx} &= \dfrac{-x}{y}\\
\dfrac{d^2y}{dx^2} &= \dfrac{-y + x\dfrac{dy}{dx}}{y^2}\\
\dfrac{d^2y}{dx^2} &= \dfrac{-y + x(-x/y)}{y^2}\\
\dfrac{d^2y}{dx^2} &= \dfrac{-y -x^2/y}{y^2}\\
\dfrac{d^2y}{dx^2} &= \dfrac{-(y^2 + x^2)}{y^3}\\
\dfrac{d^2y}{dx^2} &= \dfrac{-2}{y^3}.
\end{align*}
Therefore, the second derivative of the curve $x^2 + y^2 = 2$ is $\dfrac{d^2y}{dx^2} = \dfrac{-2}{y^3}$.
:::
Note that in the previous example, we were able to substitute out $dy/dx$ since we had already found that value. We also substituted out $x^2 + y^2$ since we knew that it was equal to 2.
Practice Problems
1. Find the second, third and fourth derivatives of each of the following.
* $y = e^{4x}$
* $f(x) = \sin(2x + 1)$
* $y = x^3 + x^2 + x + 1$
* $g(x) = \ln(x)$
* $h(x) = \tan(x)$
* $f(x) = \cos(2x) + e^{3x}$
2. Find a general formula for the $n^{th}$ derivative for each of the following.
* $y = \cos(x)$
* $f(x) = \sec(x)$
* $y = e^{3x}$
* $g(x) = \sin(2x + 1)$
* $f(x) = x^2 + x + 1$
* $y = \ln(x)$
* $g(x) = \cos(3x - 2)$
* $y = \cos(2x) + e^{2x}$
3. Find the second derivative of each of the following functions.
* $x^2 + y^2 = 5$
* $x^2 + 2y = xy$
* $x^2y^3 = 3x$
* $y = x^x$
* $\sin(y) = x$
* $e^y - e^x = 1$
# 3.4 The Chain Rule {-}
The chain rule is a rule for differentiating composite functions. Colloquially, it says that if you want to differentiate a composite function, you differentiate the ``outside'' function first while leaving the "inside" function alone and then you multiply that by the derivative of the inside function.
::: {style="color: blue;"}
**Theorem (The Chain Rule):** Suppose $f$ and $g$ are both differentiable functions.
1. If $F(x) = f(g(x))$, then the derivative of $F$ is given by \[F^{\prime}(x) = f^{\prime}(g(x))g^{\prime}(x).\]
2. If $y = f(u)$ and $u = g(x)$, then the derivative of $y$ is given by \[\dfrac{dy}{dx} = \dfrac{dy}{du}\dfrac{du}{dx}.\]
:::
::: {style="color: green;"}
**Example:** Find the derivative of $\sqrt{3x + 5}$.
:::
::: {style="color: green;"}
**Solution:** In this example, the outside function is $( )^{1/2}$ while the inside function is $3x + 5$. One might write $f(x) = x^{1/2}$ and $g(x) = 3x+5$ with a goal of finding the derivative of $F(x) = f(g(x))$. According to the chain rule, the derivative here would be \[F^{\prime}(x) = f^{\prime}(g(x))g^{\prime}(x).\] We know that $f^{\prime}(x) = \dfrac{1}{2}x^{-1/2}$ and $g^{\prime}(x) = 3$. Therefore, by the chin rule, \[F^{\prime}(x) = \dfrac{1}{2}(3x+5)^{-1/2}(3) = \dfrac{3}{2\sqrt{3x+5}}.\]
:::
Notice the pattern of the previous answer. We took the outside function and differentiated it. We left the inside function alone (inside the derivative of the outside function) then multiplied everything by the derivative of the inside function.
::: {style="color: green;"}
**Example:** Find the derivative of $\sin(3^x)$.
:::
::: {style="color: green;"}
**Solution:** Here, the outside function is $f(x) = \sin(x)$ and the inside function is $g(x) = 3^x$. According to the chain rule, the derivative of $F(x) = f(g(x))$ is \[F^{\prime}(x) = f^{\prime}(g(x))g^{\prime}(x).\] We know that $f^{\prime}(x) = \cos(x)$ and $g^{\prime}(x) = 3^x\ln3$. Therefore, by the chin rule, \[F^{\prime}(x) = \cos(3^x)3^x\ln3.\]
:::
::: {style="color: green;"}
**Example:** Find the derivative of $y = e^{5x}$.
:::
::: {style="color: green;"}
**Solution:** Using Leibnitz notation, we have $y = f(u) = e^u$ and $u(x) = 5x$. The derivatives are $\dfrac{dy}{du} = e^u$ and $\dfrac{du}{dx} = 5$. Therefore, \begin{align*}
\dfrac{dy}{dx} &= \dfrac{dy}{du}\dfrac{du}{dx}\\
&=e^u(5)\\
&=5e^{5x}. \end{align*}
Therefore, the derivative of $y = e^{5x}$ is \[\dfrac{dy}{dx} = 5e^{5x}.\]
:::
::: {style="color: green;"}
**Example:** Find the derivative of $f(x) = e^{4\tan(x)}$.
:::
::: {style="color: green;"}
**Solution:** The outside function is $e^x$ while the inside function is $4\tan(x)$. So, we know that \[f^{\prime}(x) = e^{4\tan(x)}(4\sec^2(x)).\]
:::
Practice Problems
1. Differentiate.
* $y = \cos(2x - 5)$
* $y = (3x + 5)^{50}$
* $y = e^{4x^2 + 3x + 2}$
* $y = \sec(4x - 2)$
* $y = \sin^5(x) + \sin(x^5)$
* $y = (x^3 + 4x + 1)^{500}$
* $y = \sin(4x)$
* $y = \dfrac{1}{(3x + 5)^8}$
* $y = \csc(1/x^2)$
* $y = \sqrt{\sqrt{x} + x}$
* $y = e^{\sin(x)}$
* $y = 5^{e^x}$