--- tags: course_note --- # Calculus A 1 [TOC] ## 09/12 ### Syllabus [hackmd link](/@teshenglin/ByzbCMses) ### intro Math is a language for scientists to communicate with other scientints. We care about the final answer and how you come up with the answer ### ch 1 A function $f$ is a rule that assigns to each element $x$ in a set $D$ exactly one element, call $f(x)$, in a set $E$. $D$ : domain, what can be feed into the function if we define $y=f(x)$ $y$ : dependent variable range is the set of all possible output values of the function --- for now on we consider $f:\mathbb{R}\rightarrow \mathbb{R}$ $\mathbb{R}$ : the set of real number $[0,1]=\{y \mid 0\leq y\leq 1\}$ *notice that $y$ is default in $\mathbb{R}$ because the number has been compared to other real numbers* --- Common notation in Calculus I $x$ : independent variable $f$ : function $y$ : dependent variable ### Image classification MNIST data set. $f(some\ handwriting\ image) = {0,1,2,...,9}$ convolutional neural network (CNN) D = specific resolution image range = {0,1,2,...,9} ### Ch 1.1 Find the domain of the function #39 $f(x)=\frac{x+4}{x^2-9}$ $x^2-9\neq0$ $\Rightarrow x\neq\pm3$ answer: $\{x\mid x\in\mathbb{R},x\neq\pm3\}$ #42 $g(t)=\sqrt{3-t}-\sqrt{2+t}$ $2+t\geq0$ $\Rightarrow t\geq-2$ $3-t\geq0$ $\Rightarrow t\leq 3$ answer: $\{t\mid-2\leq t\leq 3\}$ #45 $F(p)=\sqrt{2-\sqrt{p}}$ $p\geq0$ $2-\sqrt{p}\geq0$ $\Rightarrow 2\geq\sqrt{p}$ $\Rightarrow [0,4]$ answer: $\{p\mid p\in[0,4]\}$ --- composite function $(f\circ g)(x)=f(g(x))$ e.g. $f(x)=\sqrt{x}$ , $g(x)=\sqrt{2-x}$ what is the domain? (a) $(f\circ g)(x)$ $(f\circ g)(x)=\sqrt{\sqrt{2-x}}$ $\Rightarrow \sqrt{2-x}\geq0$ $\Rightarrow 2-x\geq0$ $\Rightarrow x\leq 2$ answer: $\{x\mid x\leq 2\}$ (b) $(g\circ f)(x)$ $(g\circ f)(x)=\sqrt{2-\sqrt{x}}$ $\Rightarrow 2-\sqrt{x}\geq0$ answer: $\{x\mid 0\leq x\leq 4\}$ (<!---->c) $(f\circ f)(x)$ answer: $\{x\mid -2\leq x\leq 2\}$ --- e.g. $f(x)=\begin{cases}x&x<0\\x^2&x\geq0\end{cases}$ --- e.g. Heaviside function $H(t)=\begin{cases}0&t<0\\1&t\geq0\end{cases}$ ![](https://i.imgur.com/7p6O1rl.png) --- **polynomial function** $p(t)=p_0+p_1t+p_2t^2+...+p_nt^n$ e.g. $p(t)=1+3t+t^4+t^{10}$ **Power function** $f(x)=x^\alpha, \alpha\in\mathbb{R}$ e.g. $f(x)=x^\frac{1}{2}=\sqrt{x}, x\geq0$ $p(t)=t^{-\frac{1}{4}}=(t^{-1})^\frac{1}{4}=(\frac{1}{t})^\frac{1}{4}=\frac{1}{\sqrt[4]{t}}, t>0$ --- **sinusoidal function** $\sin(x),\cos(x),\tan(x),\cot(x),\sec(x),\csc(x)$ ## 09/15 Machine learning: To learn a function MNIST, Yolo v4, AlphaGo, Language Translation, Natural language Programming... **piecewise function** e.g. $f(x)=\begin{cases}\sin(x)&x>0\\\cos(x)&x\leq 0\end{cases}$ ### sec 1.4 **Exponential functions** e.g. $f(x)=b^x$ $for x\in \mathbb{N}$ $\mathbb{N}$ : natural number = $\{1,2,3...\}$ e.g. $f(3)=b^3=b\times b\times b$ $f(-3)=(b^3)^{-1}=\frac{1}{b^3}=\frac{1}{b\times b\times b}$ $f(0)=b^0=b^{3-3}=b^3\times\frac{1}{b^3}=1$ $\Rightarrow b^0=1\ for\ b\neq 0$ because $0^0$ if not defined For $x\in \mathbb{Q}$ $x=\frac{g}{p}$ $b^x=b^{\frac{g}{p}}=(b^g)^\frac{1}{p}$ **law of exponents** $b^x\cdot b^y=b^{x+y}$ $(b^x)^y=b^{xy}$ --- e.g. $f(x)=2^x$ |$x=1$|$x=2$|$x=10$|$x=100$| |-|-|-|-| |$2$|$4$|$1024$|$\approx10^{30}$| :::info Exponential functions grow much faster than any polynomial fucntions ::: e.g. $f(x)=x^2$ |$x=1$|$x=2$|$x=10$|$x=100$| |-|-|-|-| |$1$|$4$|$100$|$10^4$| $f(x)=x^10$ |$x=1$|$x=2$|$x=10$|$x=100$| |-|-|-|-| |$1$|$1024$|$10^{10}$|$10^{20}$| **in small scale** ![](https://i.imgur.com/0JYVPIH.png) **in bigger scale** $f(x)=2^x$ is going to catch up $x^10$ **There are 3 intersections between $y=2^x$ and $y=x^{10}$** --- exercise $8^{\frac{4}{3}}=2^{?}$ $(2^3)^\frac{4}{3}=2^?$ $2^{3\times \frac{4}{3}}=2^?$ $?=3\times\frac{4}{3}=4$ --- $\frac{\sqrt{a\sqrt{b}}}{\sqrt[3]{ab}}=a^?b^?$ $= \frac{(ab^{\frac{1}{2}})^\frac{1}{2}}{(ab)^\frac{1}{3}}$ $\Rightarrow a^\frac{1}{6}b^{11}{12}$ --- graph $y=4^x-1$ ![](https://i.imgur.com/VdeLkjZ.png) --- ### sec 1.4 Natural exponential function $e$ : natural exponent $f(x)=e^x$ : natural exponential function :::info **def:** $e$ is such that the slope of the tangent line of $y=f(x)=e^x$ at $(0,1)$ is one ::: ![](https://i.imgur.com/w2UXzd4.png) :::info suppose you have 1 dollar with 100% interest rate. At the end if the first year you get if interest paid annually $1+1=2$ if paid monthly $(1+\frac{1}{12})^{12}$ if paid daily $(1+\frac{1}{365})^{365}$ if $(1+\frac{1}{n})^n$ , n is huge as $n\rightarrow\infty$ $e\approx 2.xxx$ ::: --- ### sec 1.5 inverse function :::info Def: A function $f:D\rightarrow E$ is a rule that assigns an element $x\in D$ exactly one element in $E$. Def A function is called one-to-one if $f(x)=f(y)$ implies $x=y$ ::: e.g. $f(x)=x^2$ ![](https://i.imgur.com/qhuREvn.png) To show that $f(x)=x^2$ is not 1-1 $f(1)=1=f(-1)$ but $1\neq -1$ so $x^2$ is not 1-1 **however** $f(x)=x^2,\ x\geq 0$ then $f$ is a 1-1 function --- ![](https://i.imgur.com/LRnJemK.png) in this case, $f$ is a 1-1 function, but $g$ is not. :::info if $f$ is 1-1 and $f(x)=y$ then it's inverse fucntion is $f^{-1}(y)=x$ ::: :::danger $f^{-1}(x)$ and $(f(x))^{-1}$ are not the same ::: --- if $A\rightarrow B$ is 1-1 then $f^{-1}(f(x))=x,x\in A$ $f(f^{-1}(x))=x,x\in B$ --- :::info **how to find the inverse funciton** 1. $f(x)=y$ 2. $f^{-1}(y)=x$ 3. change the symbol, $f^{-1}(x)$ ::: e.g. $f(x)=x^2,\ x\geq 0$ 1. $x^2=y$ 2. $x=(x^2)^\frac{1}{2}=y^\frac{1}{2}=f^{-1}(y)$ 3. $f^{-1}(x)=x^{\frac{1}{2}}=\sqrt{x}$ --- ### Logarithmic function 1. $f(x)=b^x=y$ 2. $\log_{b}b^{x}=\log_{b}y$ $\Rightarrow x=\log_{b}y=f^{-1}(y)$ 3. $f^{-1}(x)=\log_{b}x$ --- :::info **some logarithmic formula** $\log_b(xy)=\log_bx+\log_by$ $\log_b(\frac{x}{y})=\log_bx-\log_by$ ::: --- ### Natural logorithm $\log_ex=\ln x$ in general $\ln x=\log_e x$ $\log x=\log_{10} x$ --- ### Inverse Trigonometric function e.g. $\sin(x)$ if we restrict $x\in[-\frac{\pi}{2},\frac{\pi}{2}]$ ![](https://i.imgur.com/cnFOqpA.png) for $\sin(x)$ domain: $[-\frac{\pi}{2},\frac{\pi}{2}]$ range: $[-1,1]$ for $\sin^{-1}(x)$ domain: $[-1,1]$ range: $[-\frac{\pi}{2},\frac{\pi}{2}]$ $\sin^{-1}(x)=asin(x)=\arcsin(x)$ --- similar to $\cos$ $[0,\pi]\rightarrow [-1,1]$ $\cos^{-1}(x)$ : $[-1,1]\rightarrow[0,\pi]$ e.g. $\cos^{-1}=0$ , not $2\pi$ because of the range we define --- e.g. $e^{\ln(\ln e^3)}$ $y=e^{\ln(\ln e^3)}$ $\begin{align}\ln y=&\ln e^{\ln(\ln e^3)}\\=&\ln(\ln e^3)\\=&\ln(3)\end{align}$ $\Rightarrow y=3$ e.g. $sin^{-1}(sin\frac{5}{4}\pi)$ $\begin{align}\sin^{-1}(\sin\frac{5}{4}\pi)=\sin^{-1}(\sin(\frac{-\pi}{4}))=-\frac{\pi}{4}\end{align}$ e.g. $\cos(\sin^{-1}(x))$ assume $y=\sin^{-1}x$ $\Rightarrow\sin y=x$ ![](https://i.imgur.com/Zv9WTHz.png) $\cos(\sin^{-1}(x))=\cos(y)=\sqrt{1-x^2}$ --- e.g. $\sin(\tan^{-1}x)$ $y=\tan^{-1}x\Rightarrow \tan y=x$ ![](https://i.imgur.com/LT5aULL.png) $\sin(\tan^{-1}x)=\sin(y)=\frac{x}{\sqrt{1+x^2}}$ --- ## 09/19 ### Ch 2 Limits and Derivatives ### Ch 2.1 tangent line tangent: touching ~~at only one point~~ $\rightarrow$ but also move in the same direction ### Ch 2.2 Limits of a function $\lim_{x\rightarrow a}f(x)=L$ the limit of $f(x)$ as $x$ approaches $a$ equals to $L$ e.g. $f(x)=\frac{x}{x}$ domain: $\{x\mid x\in\mathbb{R}\setminus\{0\}\}$ ![](https://i.imgur.com/mgaOO0F.png =480x) |$x$|0.1|0.01|0.001|...|$\lim_{x\rightarrow 1}$| |-|-|-|-|-|-| |$f(x)$|1|1|1|...|1| :::info $\lim_{x\rightarrow a}f(x)$ has nothing to do with the value at $x=a$ ::: e.g. $f(x)=\begin{cases}x&x\neq0\\a&x=0\end{cases}$ $\lim_{x\rightarrow a}f(x)=0$ e.g. $f(x)=\frac{x^2-2x+1}{x-1}, x\neq 1$ $\lim_{x\rightarrow 1}f(x)$ $f(x)=\frac{(x-1)^2}{x-1}=x-1,x\neq1$ $\Rightarrow\lim_{x\rightarrow 1}f(x)= \lim_{x\rightarrow 1}(x-1)=0$ :::info Def: One-sided limit $\lim_{x\rightarrow a^+}f(x)=L$ or $\lim_{x\rightarrow a^-}f(x)=L$ ::: e.g. $H(x)=\begin{cases}1&x\geq0\\-1&x<0\end{cases}$ $\lim_{x\rightarrow0^+}H(x)=1$ $\lim_{x\rightarrow0^-}H(x)=-1$ $\Rightarrow\lim_{x\rightarrow0}H(x)$ does not exist :::info $\lim_{x\rightarrow0}f(x)$ if and only if (iff) $\lim_{x\rightarrow0^+}f(x)=L=\lim_{x\rightarrow0^-}f(x)$ ::: e.g. $f(x)=\frac{1}{x^2}$ ![](https://i.imgur.com/Cyz92RA.png) $\lim_{x\rightarrow 0}f(x)=\infty$ :::danger Note: the limit equals to infinity means that the liimit **does not exist** because $\lim_{x\rightarrow a}f(x)=L$ where $L\in\mathbb{R}$ ::: e.g. $f(x)=\frac{1}{x},x\neq 0$ ![](https://i.imgur.com/xAfAAr2.png) $\lim_{x\rightarrow 0^+}f(x)=\infty$ $\lim_{x\rightarrow 0^-}f(x)=-\infty$ $\Rightarrow \lim_{x\rightarrow 0}f(x)$ does not exist :::info If the limits is infinity at $x=a$ $\Rightarrow$ there exists a vertical asymptote at $x=a$ vertical asymptote: 垂直漸進線 ::: sec 2.2 #38 $\lim_{x\rightarrow 3^-}\frac{x^2+4x}{x^2-2x-3}$ $\lim_{x\rightarrow 3}x^2+4x=21$ $\lim_{x\rightarrow 3}x^2-2x-3=0$ $x^2-2x-3=(x-3)(x+1)$ for $x$ approaches $3$ from the left $\Rightarrow x^2-2x-3<0$ sec 2.2 #34 $\lim_{x\rightarrow 0^+}\ln(\sin(x))$ for $x>0$ and close to $0$ , $\sin(x)>0$ and close to $0$. sec 2.2 #32 $\lim_{x\rightarrow 3^-}\frac{\sqrt{x}}{(x-3)^5}$ because $\lim_{x\rightarrow 3^-}\sqrt{x}=\sqrt{3}$ $\lim_{x\rightarrow 3^-}(x-3)^5=0^-$ $\Rightarrow \lim_{x\rightarrow 3^-}\frac{\sqrt{x}}{(x-3)^5}=-\infty$ e.g. $\lim_{x\rightarrow 0}\frac{\sqrt{9+x}-3}{x}$ for $x\neq0$ $\begin{align}\lim_{x\rightarrow 0}\frac{\sqrt{9+x}-3}{x}=&\frac{\sqrt{9+x}-3}{x}\cdot\frac{\sqrt{9+x}+3}{\sqrt{9+x}+3}\\=&\frac{9+x-9}{x(\sqrt{9+x}+3)}\\=&\frac{x}{x(\sqrt{9+x}+3)}=\frac{1}{\sqrt{9+x}+3}\\=&\frac{1}{3+3}=\frac{1}{6}\end{align}$ ### sec 2.3 Limit Laws If the limit exists, then $\lim(f\pm g)=\lim f\pm \lim g$ $\lim(f\cdot g)=(\lim f)(\lim g)$ $\lim(\frac{f}{g})=\frac{\lim f}{\lim g}$ ### squeezing theorem if $f(x)\leq g(x)\leq h(x)$ and $\lim_{x\rightarrow a}f(x)=L=\lim_{x\rightarrow a}h(x)$ then $\lim_{x\rightarrow a} g(x)=L$ e.g. $f(x)=\sin\frac{1}{x}$ ![](https://i.imgur.com/KbfEuOd.png) $\lim_{x\rightarrow 0} f(x)$ does not exist e.g. $f(x)=x\sin\frac{1}{x}$ ![](https://i.imgur.com/vvsx24d.png) $\lim_{x\rightarrow 0}f(x)=0$ e.g. $f(x)=x^2\sin\frac{1}{x}$ ![](https://i.imgur.com/mbqAhw8.png) $-1\leq \sin\frac{1}{x}\leq 1, x\neq 0$ $-x^2\leq x^2\sin\frac{1}{x}\leq x^2, \forall x\in \mathbb{R}$ $\Rightarrow\lim_{x\rightarrow 0}-x^2=0=\lim_{x\rightarrow 0}x^2$ by squeezing thm. $\Rightarrow \lim_{x\rightarrow 0}f(x)=0$ #63 $f(x)=\begin{cases}x^2&x\ is\ rational\\0&x\ is\ irrational\end{cases}$ ![](https://i.imgur.com/kVfpZv2.png) $0\leq f(x)\leq x^2$ by squeezing thm. $\Rightarrow \lim_{x\rightarrow 0}f(x)=0$ ## 10/03 ### Chain rule consider $(f\cdot g)(x)=f(g(x))=F(x)$ given $x$, evaluate $g(x)$, then evaluate $f(g(x))$ Q: $\frac{d}{dx}F(x)=\frac{d}{dx}f(g(x))$ Let $z=g(x)$ then $F(x)=f(z)$ $[\frac{d}{dx}F]=\frac{[F]}{[x]}=\frac{[f]}{[x]}$ $([\frac{d}{dz}f]=\frac{[f]}{[z]})\times \frac{[z]}{[x]}=\frac{[f]}{[x]}$ :::info **Chain rule** $\frac{dF}{dx}=f'(g(x))\times g'(x)$ ::: --- $\begin{align}\frac{d}{dx}F(x)=&\frac{d}{dx}f(g(x))\\=&\lim_{h\rightarrow 0}\frac{f(g(x+h))-f(g(x))}{h}\\=&\lim_{h\rightarrow 0}\frac{f(g(x+h))-f(g(x))}{g(x+h)-g(x)}\times \frac{g(x+h)-g(x)}{h}\end{align}$ Assume $f$ and $g$ are both differentiable $=\lim_{h\rightarrow 0}\frac{f(g(x+h))-f(g(x))}{g(x+h)-g(x)}\times \lim_{h\rightarrow 0}\frac{g(x+h)-g(x)}{h}=f'(g(x))\times g'(x)$ **Remark:** $f'=\frac{df}{dz}$ $g'=\frac{dg}{dx}$ e.g. $\frac{d}{dx}(\sin(x^2))$ $f=\sin(x),\ g=x^2$ $=\cos(x^2)\times 2x$ e.g. $\frac{d}{dx}(\sin^2(x))$ $f=x^2,\ g=\sin(x)$ $=2\sin(x)\times \cos(x)$ e.g. $\frac{d}{dx}\sqrt{1+x^2}$ $f=\sqrt{x},\ g=1+x^2$ $=\frac{1}{2}(1+x^2)^\frac{-1}{2}\times 2x$ $=\frac{x}{\sqrt{1+x^2}}$ e.g. $\frac{d}{dx}(e^{x^2})$ $=e^{x^2}\times 2x$ e.g. $\frac{d}{dx}(2^x)$ $2^x=e^{x\ln2}$ $=e^{x\ln2}\times \ln 2$ $=2^x\times \ln 2$ e.g. $\frac{d}{dt}(2^{t^3})=\frac{d}{dt}(e^{t^3\ln 2})$ $=e^{t^3\ln 2}\times 3t^2\ln 2$ $=2^{t^3}\times 3t^2 \ln 2$ e.g. $\frac{d}{dx}(x^2)=\frac{d}{dx}(e^{x\ln x})$ $=e^{x\ln x}\times (1\times \ln x+x\times \frac{1}{x})$ $=x^x(1+\ln x)$