Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Sequences and Series chapter to the Calculus course #50

Draft
wants to merge 129 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
2891fc1
content/courses/calculus/sequences-and-series/index.md created from h…
saumyasinghal747 Jun 18, 2021
889f394
content/courses/calculus/sequences-and-series/index.md updated from h…
saumyasinghal747 Jun 18, 2021
14d4b67
content/courses/calculus/sequences-and-series/index.md updated from h…
saumyasinghal747 Jun 18, 2021
b7346ed
content/courses/calculus/sequences-and-series/index.md updated from h…
saumyasinghal747 Jun 18, 2021
3395e34
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 18, 2021
afeae22
content/courses/calculus/sequences-and-series/mc-laurin/index.md crea…
saumyasinghal747 Jun 18, 2021
e7fb006
content/courses/calculus/sequences-and-series/mc-laurin/index.md upda…
saumyasinghal747 Jun 18, 2021
772bfb5
content/courses/calculus/sequences-and-series/mc-laurin/index.md upda…
saumyasinghal747 Jun 18, 2021
0787bba
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 18, 2021
206de2e
content/courses/calculus/sequences-and-series/mc-laurin/index.md upda…
saumyasinghal747 Jun 18, 2021
d1573ab
content/courses/calculus/sequences-and-series/mc-laurin/index.md upda…
saumyasinghal747 Jun 18, 2021
24ba893
content/courses/calculus/sequences-and-series/taylor-practice/index.m…
saumyasinghal747 Jun 18, 2021
14664fe
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 18, 2021
ccfc7f2
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 19, 2021
45f3b5b
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 20, 2021
8da64fd
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 20, 2021
50ce588
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 20, 2021
d7343a1
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 20, 2021
50c6ce3
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 20, 2021
3621a25
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 20, 2021
3419ad5
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 20, 2021
9ffc1be
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
fe712ad
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
450dacf
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
035dc07
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
1e9b46c
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
9968ccc
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
7b545fb
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
bf8273b
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
018d10e
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
47efa10
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
3c4a32c
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
246a17e
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
99bef2e
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
788005c
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
32bfc4a
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
6dbc2f9
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
0f59cc3
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
fda6215
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
9dd0633
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
7b01df5
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
c0e7b53
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
9d54c80
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
c6f794e
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
22df360
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 21, 2021
c4f69d7
content/courses/calculus/sequences-and-series/mc-laurin/index.md upda…
saumyasinghal747 Jun 22, 2021
5c8b43a
content/courses/calculus/differential/lines-of-tangency/index.md crea…
saumyasinghal747 Jun 23, 2021
5f715a6
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
d16c0fa
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
3b8b8d7
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
07e424f
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
b7fe56a
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
9b516d7
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
b84f210
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
71fb6a6
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
b06068a
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
234871b
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
a4ae847
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
c578ce7
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
709adda
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
5695f77
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
6d270ff
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
80586f5
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 23, 2021
eb71b2a
content: x-cubed image
saumyasinghal747 Jun 24, 2021
75fc96f
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
4471a05
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
5af8651
style: smaller image graphs
saumyasinghal747 Jun 24, 2021
468fe78
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
3a6c839
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
4a41a42
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
acaf82b
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
5db868b
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
fe33495
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
63e5c40
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
ce28427
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
4ba8eaa
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
bb1867b
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
396b64e
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
b244146
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
35e1697
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
841fd6f
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
bd68c55
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
e2ef518
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
75ba5e7
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
1ab2b6f
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
e9be4cb
content/courses/calculus/differential/lines-of-tangency/problems/1.md…
saumyasinghal747 Jun 24, 2021
3f1b3b1
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
9ae0f5a
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
ec78d14
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
27f366e
content/courses/calculus/differential/lines-of-tangency/index.md upda…
saumyasinghal747 Jun 24, 2021
ea34579
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
2df9211
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
5dbe4e2
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
60b8923
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
3460354
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
3856dd3
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
ea364f8
content/courses/calculus/differential/lines-of-tangency/problems/2.md…
saumyasinghal747 Jun 24, 2021
a9a1a6c
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 24, 2021
6327802
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 24, 2021
2e157db
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 24, 2021
f077631
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
9ab9d31
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
e55b39d
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
b0990b0
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
3c3c146
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
e576150
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
ead0937
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
b79c1a1
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
defa850
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
078f426
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
e1cc9f7
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
d245310
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
9421dba
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
2741d11
Add files via upload
saumyasinghal747 Jun 25, 2021
a64cc18
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
8c4801a
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
40de434
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
709a1ee
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
2013063
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
a30bdec
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
5e67c59
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
7cde06a
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
4be3313
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
e13d262
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
78fc0c9
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
704949b
Add files via upload
saumyasinghal747 Jun 25, 2021
2a06ea1
content/courses/calculus/sequences-and-series/taylor-series/index.md …
saumyasinghal747 Jun 25, 2021
d40a97a
fix: use clearer grapher
saumyasinghal747 Jun 25, 2021
b22242e
content/courses/calculus/sequences-and-series/taylor-practice/problem…
saumyasinghal747 Jul 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions assets/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,25 @@ span.correct .ML__fieldcontainer{
}

@media (min-width: 992px) {
.graph {
iframe.graph {
height: 500px;
width: 500px;
}
img.graph {
height: 300px;
width: 300px;
}
}

@media (max-width: 992px) {
.graph {
iframe.graph {
height: 80vw;
width: 80vw;
}
img.graph {
height: 30vw;
width: 30vw;
}
}

.graph {
Expand Down
51 changes: 51 additions & 0 deletions content/courses/calculus/differential/lines-of-tangency/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
index: 9.2
title: Tangent Lines
type: lesson

---

In the previous lesson, we saw how derivatives can help us find the slope of a function. When the function's slope varies, the derivative gives us a formula for the slope, given the location.

In this lesson, we'll look at an interesting application of the above — constructing lines tangent to nonlinear functions.

<iframe src="https://www.desmos.com/calculator/vcpwd6c0uz?embed" class="graph"></iframe>

Let's say we have a function $f(x)$, and we want to construct a line tangent to the function at a point $\left(a,f(a)\right).$

What should be the slope of the line?

For the function to 'align' with the line at the desired point, they must have the same slope. So, the slope of the line must be equal to $f'(a)$, the slope of the function at $x=a$.

Using point-slope form, we have:
$$\text{point} = (a, f(a))$$ $$\text{slope} = f'(a)$$

$$y - f(a) = f'(a) (x-a).$$

Now, we'll try this with an example.
Let's say we want to graph a line tangent to $$y=x^3$$ at $$x=-1.$$

For context, $y=x^3$ looks like this:

<img class="graph" src="/img/graphs/x-cubed.png"/>

Now, we'll use the point-slope approach we just came up with.

To find the slope of $f(x)=x^3$, we need its derivative. Using the [power rule](/learn/calculus/differential/power-rule), we know that $$f'(x)=3x^2.$$
So, the slope at $x=-1$ is $$f'(-1)=3(-1)^2=\boxed{3}.$$

Using point-slope, we get
$$ y - (-1) = 3(x- (-1))$$ $$y+1=3x+3$$ $$\boxed{y=3x+2}.$$

Now, try another example on your own. If you get stuck, use a hint!

@1

@2

<!--stackedit_data:
eyJoaXN0b3J5IjpbMTU3MDgyNDM1NywtMTYwNzA3NDY0NywtOT
M4MjMzNTMxLC01NTA1MDczMDcsLTE4MTkyNDY0NjEsNTIxMjU3
NzExLDE5NjcxMDExOTIsLTEwMDUxNDMxNTksLTk0MzE5ODU0OS
wtMTk1NzI1NDQ3OSwxNzg0NTk4MDc5XX0=
-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
type: problem
answers:
- "x-\frac{\\pi}{2}"

---

@statement
Find the equation of the line tangent to $y = \cos x$ at $x=\frac{\pi}{2}$. Express your answer in slope-intercept form.

@hint
What is the point of tangency?

@hint
What is the slope at the point of tangency?

@solution
First, we identify the point of tangency. The question tells us to find the tangent line at $x=\frac{\pi}{2}.$
So, our point is $$\left(\frac{\pi}{2}, \cos\left(\frac{\pi}{2}\right)\right)\rightarrow\left(\frac{\pi}{2}, 0\right).$$

Now, we need the slope. The slope of $\cos x$ is modeled by its derivative, $\sin x$.

So, $$\cos'\left(\frac{\pi}{2}\right) = -\sin\left(\frac{\pi}{2}\right) = -1.$$

Using point-slope, we get $$y-0=-1\cdot\left(x-\frac{\pi}{2}\right)$$ $$\boxed{y=\frac{\pi}{2}-x}.$$
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTgxODM1OTY2NiwtMjAxMjM1MzI4OSw3MD
cwNzkwMDRdfQ==
-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
type: problem
answers:
- "8"

---

@statement
If $f\left(x\right)=4-x^2,$ then the tangent lines at $x=-2$ and $x=2$ intersect at $\left(0,c\right).$ Find $c.$

@hint
How can we break this problem into smaller parts? How many tangent lines do we need to find?

@hint
Divide the problem into smaller ones:
1. Find the tangent line at $x=-2$
2. Find the tangent line at $x=2$
3. Find their intersection point

@solution

*For this problem, we will be needing the derivative of $f(x)$, so it is helpful to compute it ahead of time:* $$f'(x) = -2x.$$

1. Find the tangent line at $x=-2:$

$$\text{Point: } (-2,0)$$ $$\text{Slope: } f'(-2)=4$$ $$\text{Point-slope: } y-0=4(x+2)$$ $$y=4x+8.$$

2. Find the tangent line at $x=2:$
$$\text{Point: } (2,0)$$ $$\text{Slope: } f'(2)=4$$ $$\text{Point-slope: } y-0=-4(x-2)$$ $$y=8-4x.$$

3. Find the intersection point:
We know that the $x$ value at the intersection point is $0$, so we just need to plug $x=0$ into one of the equations.
$$y=4x+8=0+8=\boxed{8}.$$
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTE0NzM3NjM0MDYsLTE3MDE5OTEyNzYsMj
AxMjAyMjQyNiwxODkxMTg3ODczXX0=
-->
12 changes: 12 additions & 0 deletions content/courses/calculus/sequences-and-series/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
index: 13.1
title: Sequences and Series
type: chapter

---

Coming soon!
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTE2NTIzMzUwODUsMTE4NjAxOTgyOCwxMz
k5Njk1OTUyXX0=
-->
10 changes: 10 additions & 0 deletions content/courses/calculus/sequences-and-series/mc-laurin/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
index: 3.4
title: MacLaurin Series
type: lesson

---
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTQ2OTk0MTM4LC0xMTQ3OTg0Njc1LC0yMD
A1MTg5NjUsNzMwOTk4MTE2XX0=
-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
index: 3.3
title: Practice with Taylor Series
type: lesson

---

<!--stackedit_data:
eyJoaXN0b3J5IjpbLTgyMDIwNDg4M119
-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: problem

<!--stackedit_data:
eyJoaXN0b3J5IjpbOTM4OTk4MjY2XX0=
-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
index: 3.2
title: Introduction to Taylor Series
type: lesson

---

In [Differential Calculus](/learn/calculus/differential), we learned that the derivative of a function describes its behavior at a specific point.

We can use this information to construct a line tangent to the function. These tangent lines are often a good approximation for values close to the tangent point as well.

But often, a line isn't a great representation of a function. Especially when the function isn't a line. The problem is, lines are always straight. They can tell us what direction a function is traveling in that moment, but it can't tell us where the function had lunch today, its general mood, and where it plans to have dinner tonight.

We can't achieve this with a straight line. But, what if we tried a curved line? Taking it up a degree from the line, let's see what we can do with a quadratic.

As an example, we'll try to find a "tangent" quadratic to the function $f(x) = \sin(x).$

## Using Derivatives to Mimic Behavior

Let's say we have a function $f(x)$, and we want to construct a tangent line at $x=a$.

### Why do lines work?
When we construct a line tangent to a function, we measure the slope (derivative) of the function at the tangent point, and assign that value to the slope of the line. In this way, the line and the function have the same first derivative at $x=a$.

### Taking it a slope further
The second derivative of every line is 0, unlike most functions you'll want to mimic. But, with a quadratic equation, we can control the second derivative.

Let's find a quadratic $g(x)$ tangent to $f(x)$ at $x=a$.
As opposed to the line, where we had two requirements, we now have three!
They are:
$$f(a)=g(a)$$ $$f'(a)=g'(a)$$ $$f''(a)=g''(a).$$

Take a moment to think about this yourself.

---

A naive approach to this is
$$g(x) = f(a) + f'(a)(x-a) + \frac{1}{2}f''(a)x^2.$$
This only satisfies the third criteria. If we take away the third term, it satisfies only the second criteria. If we take away the second term as well, it only satisfies the first criteria.

In short, the higher degree erms are hindering the lower degree terms from serving their purpose.

We can solve this by setting up higher degree terms to cancel out when they are not needed. This is done by replacing
$$x \rightarrow x-a.$$

Since these two terms have the same derivative, this replacement won't disturb the parts of our naive solution that work.

So, we have
$$g(x)=f(a)+f'(a)(x-a) + \frac{1}{2}f''(a)(x-a)^2.$$

Let's try it out! With $f(x) = \cos x$ and $a=0$, we have
<img class="graph" src="/img/graphs/cosx-taylor-2.png" />

This is definitely nicer than a line. And, it lines up well at $x=0$, which was our $a$ value. Now that we've seen greatness, let's get greedy!

What should the next term be to make this a cubic function?
At first glance, you might say
$$\frac{1}{3}f'''(a)(x-a)^3.$$
The purpose of that fractional coefficient is to make up for the scalar residue caused by differentiation.
However, the problem here is that when this term comes into play, it will have been differentiated *thrice*, and we need to cancel out not just a scalar of $3$, but $3!$. We didn't have to deal with this in the second degree term, because $2!=2$. This factorial rule goes for any following terms.

So, a cubic would look like
$$g(x)=f(a)+f'(a)(x-a) + \frac{1}{2!}f''(a)(x-a)^2 + \frac{1}{3!}f'''(a)(x-a)^3.$$

Sadly, in our example, the third degree term is $0$ because $\sin(0)=0.$ So, there's nothing new to see. This doesn't satisfy our greed. Let's upgrade to the 8th degree!

<img class="graph" src="/img/graphs/cosx-taylor-8.png" />

That's more like it. And, if we graphed an infinite degree series, it would line up exactly!


<!--stackedit_data:
eyJoaXN0b3J5IjpbLTIwNDE4ODE0MjcsMTMwMjczNjAxOCwtNT
A4MTM3NjgxLDk5MzIwMzk3MiwzOTIwNTYxNTYsLTE5MzEzMDcx
MjksMTY1OTM0MjIyNywtMTg3NDQ4OTg1NCw3MzQzMjczNDksLT
EwMjc2Njg1OSwtMjQ1NjI2MTAwLC0xNzA4MjQwMDM5LDQ4Nzg1
OTkxOSwzNjY4MzIwNzQsNjg3OTQ2ODk4LDE4Mjk5OTUwMSwxOD
EyNDYwMDM1LC0xMTg2ODE5NTEzLC0xNzEzNzQwNTYxLC0xMTc5
NjQ5NzM3XX0=
-->
Binary file added static/img/graphs/cosx-taylor-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/graphs/cosx-taylor-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/graphs/x-cubed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.