<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Notes on My Blog</title><link>https://EMEEEEMMMM.github.io/categories/notes/</link><description>Recent content in Notes on My Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sat, 23 May 2026 12:59:51 +0800</lastBuildDate><atom:link href="https://EMEEEEMMMM.github.io/categories/notes/index.xml" rel="self" type="application/rss+xml"/><item><title>Quaternions</title><link>https://EMEEEEMMMM.github.io/posts/quaternion/</link><pubDate>Sat, 23 May 2026 12:59:51 +0800</pubDate><guid>https://EMEEEEMMMM.github.io/posts/quaternion/</guid><description>&lt;img src="https://EMEEEEMMMM.github.io/" alt="Featured image of post Quaternions" /&gt;&lt;h1 id="complex-number"&gt;Complex Number
&lt;/h1&gt;&lt;p&gt;We call the numbers of the form $a + bi$ complex numbers.
Set consisting of all complex numbers $\mathbb{C}={a+b \mathrm{i}\mid a,b \in \mathbb{R}}$, complex number is usually represented by letter $z$, so $z=a+b\mathrm{i}(a,b \in \mathbb{R})$ where $a$ is the real part of the number and $b$ is the imaginary part. A complex number is an imaginary number introduced on top of the real numbers in one dimension, forming a two dimensional complex plane. A particular complex number is a vector in that complex plane, as follows:
&lt;img alt="Complex_Vector" class="gallery-image" data-flex-basis="313px" data-flex-grow="130" height="521" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://EMEEEEMMMM.github.io/posts/quaternion/Complex_Vector.png" width="681"&gt;&lt;/p&gt;
&lt;h2 id="operations"&gt;Operations:
&lt;/h2&gt;&lt;h3 id="addition"&gt;Addition:
&lt;/h3&gt;&lt;p&gt;Two complex number $z_{1} = a+b\mathrm{i},\ z_{2} = c+d\mathrm{i} \ (a,b,c,d \in \mathbb{R})$ , their sum is:
&lt;/p&gt;
$$
z_{1} + z_{2} = (a+b\mathrm{i})+(c+d\mathrm{i})=(a+c) + (b+d)\mathrm{i}
$$&lt;p&gt;
For any complex number:
&lt;/p&gt;
$$
\begin{align}
z_{1} + z_{2} &amp;= z_{2} + z_{1} \\
(z_{1} + z_{2}) + z_{3} &amp;= z_{1} + (z_{2} + z_{3})
\end{align}
$$&lt;h3 id="subtraction"&gt;Subtraction:
&lt;/h3&gt;&lt;p&gt;Two complex number $z_{1} = a+b\mathrm{i},\ z_{2} = c+d\mathrm{i} \ (a,b,c,d \in \mathbb{R})$ , their difference is:
&lt;/p&gt;
$$
z_{1} - z_{2} = (a+b\mathrm{i})-(c+d\mathrm{i})=(a-c) + (b-d)\mathrm{i}
$$&lt;h3 id="multiplication"&gt;Multiplication:
&lt;/h3&gt;&lt;p&gt;Two complex number $z_{1} = a+b\mathrm{i},\ z_{2} = c+d\mathrm{i} \ (a,b,c,d \in \mathbb{R})$ , their product is:
&lt;/p&gt;
$$
\begin{align}
z_{1} \cdot z_{2} &amp;= (a+b\mathrm{i}) \cdot (c+d\mathrm{i}) \\
&amp;=ac+ad\mathrm{i}+bc\mathrm{i}+bd\mathrm{i}^2 \\
&amp;=(ac-bd) + (ad+bc)\mathrm{i}
\end{align}
$$&lt;p&gt;
For any complex number:
&lt;/p&gt;
$$
\begin{align}
z_{1} z_{2} &amp;= z_{2} z_{1} \\
(z_{1} z_{2}) z_{3} &amp;= z_{1} (z_{2} z_{3}) \\
z_{1} (z_{2} + z_{3}) &amp;= z_{1} z_{2} + z_{1} z_{3}
\end{align}
$$&lt;h3 id="division"&gt;Division:
&lt;/h3&gt;&lt;p&gt;Two complex number $z_{1} = a+b\mathrm{i},\ z_{2} = c+d\mathrm{i} \ (a,b,c,d \in \mathbb{R})$ , their quotient is:
&lt;/p&gt;
$$
\begin{align}
z_{1} \div z_{2} &amp;= \frac{a+b\mathrm{i}}{c+d\mathrm{i}} \\
&amp;= \frac{(a+b\mathrm{i}) (c-d\mathrm{i})}{(c+d\mathrm{i})(c-d\mathrm{i})} \\
&amp;= \frac{ac - ad\mathrm{i} + bc\mathrm{i} + bd}{c^2+d^2} \\
&amp;= \frac{ac+bd}{c^2+d^2} + \frac{bc-ad}{c^2+d^2}\mathrm{i}
\end{align}
$$&lt;h2 id="eulers-formula"&gt;Euler&amp;rsquo;s Formula:
&lt;/h2&gt;$$
e^{i \theta} = cos(\theta) + \mathrm{i} \sin(\theta) 
$$&lt;h3 id="proof"&gt;Proof:
&lt;/h3&gt;&lt;p&gt;The MacLaurin Series for $e^x$:
&lt;/p&gt;
$$
e^x=\sum_{n=0}^{\infty} \frac{x^n}{n!}=1+x+\frac{x^2}{2}+\frac{x^3}{6}+\cdots
$$&lt;p&gt;
For $e^{\mathrm{i} \theta}$, there exist:
&lt;/p&gt;
$$
\begin{align}
LHS = e^{\mathrm{i} \theta} &amp;= \sum_{n=0}^{\infty} \frac{(\mathrm{i} \theta)^n}{n!} \\
&amp;= 1 + \mathrm{i} \theta - \frac{\theta^2}{2!} + \frac{(\mathrm{i}\theta)^3}{3!} + \frac{\theta^4}{4!} + \cdots \\
&amp;= \left(1-\frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \frac{\theta^6}{6!} + \cdots \right) + \mathrm{i} \left(\theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \frac{\theta^7}{7!} + \cdots \right) \\
&amp;= \cos \theta + \mathrm{i} \sin \theta \\
&amp;= RHS
\end{align}
$$&lt;h2 id="the-derivation-for-formula-of-cos-ntheta-and-sin-ntheta"&gt;The derivation for formula of $\cos n\theta$ and $\sin n\theta$:
&lt;/h2&gt;$$
\begin{align}
\left(e^{\mathrm{i} \theta}\right)^{n} =e^{\mathrm{i}n\theta} &amp;= \cos n\theta + \mathrm{i} \sin n\theta \\
\left( \cos \theta + \mathrm{i} \sin \theta \right)^{n} &amp;= \cos n\theta + \mathrm{i} \sin n\theta \\
\cos n\theta + \mathrm{i} \sin n\theta &amp; = \sum_{k=0}^{n} \binom{n}{k} \left( \cos \theta \right)^{n-k} \left( \mathrm{i} \sin \theta \right)^k
\end{align}
$$&lt;p&gt;
Extract the real and imaginary parts of the expansion separately:
&lt;/p&gt;
$$
\begin{align}
\cos n\theta &amp;= \sum_{k=0}^{n} \binom{n}{2k} (\cos \theta)^{n-2k} (\mathrm{i} \sin \theta)^{2k} \\
&amp;= \sum_{k=0}^{n} \binom{n}{2k} (-1)^k (\cos \theta)^{n-2k} (\sin \theta)^{2k} \\
\mathrm{i} \sin n\theta &amp;= \sum_{k=0}^{n} \binom{n}{2k+1} (\cos \theta)^{n-2k-1} (\mathrm{i})^{2k+1} (\sin \theta)^{2k+1} \\
&amp;= \mathrm{i} \sum_{k=0}^{n} \binom{n}{2k+1} (\cos \theta)^{n-2k-1} (-1)^k (\sin \theta)^{2k+1} \\
\end{align}
$$&lt;p&gt;
&lt;/p&gt;
$$
\therefore \quad
\begin{cases}
\cos n\theta &amp;= \sum_{k=0}^{n} \binom{n}{2k} (-1)^k (\cos \theta)^{n-2k} (\sin \theta)^{2k} \\
\sin n\theta &amp;= \sum_{k=0}^{n} \binom{n}{2k+1}(-1)^k (\cos \theta)^{n-2k-1} (\sin \theta)^{2k+1} \\
\end{cases}
$$&lt;h3 id="chebyshev-polynomials"&gt;Chebyshev polynomials:
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://zhuanlan.zhihu.com/p/55076525" target="_blank" rel="noopener"
 &gt;https://zhuanlan.zhihu.com/p/55076525&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="quaternions"&gt;Quaternions
&lt;/h1&gt;&lt;p&gt;In complex numbers, the multiplication can represent the rotation in 2 dimensional space. For example, by rotating a vector $(a, bi)$ for $30 \degree$, just multiply it by $\cos 30 \degree + \mathrm{i} \sin 30 \degree$. But in three dimensional space, we need something that is stronger than complex numbers since that rotate about the x axis first and then rotate about the y axis is not equal to rotate about the y axis first and then rotate about the x axis, we need a algebraic system which does not satisfy commutative multiplication and is able to describe rotation in 3 dimensional space. So, the hypercomplex number, quaternions is just the right tool to use.&lt;/p&gt;
&lt;h2 id="definition"&gt;Definition:
&lt;/h2&gt;&lt;p&gt;The numbers in the form of:
&lt;/p&gt;
$$
q = a + b \mathrm{i} + c \mathrm{j} + d \mathrm{k} (a,b,c,d \in \mathbb{R})
$$&lt;h2 id="basic-properties"&gt;Basic properties:
&lt;/h2&gt;$$
\begin{align}
i^2 = j^2 = k^2 = -1 \\
ij = k, ji = -k, jk = i, kj = -i, ki = j, ik = -j
\end{align}
$$&lt;p&gt;For any quaternions, their conjugate is given by:
&lt;/p&gt;
$$
q = a - b \mathrm{i} - c \mathrm{j} - d \mathrm{k}
$$&lt;h2 id="operations-1"&gt;Operations:
&lt;/h2&gt;&lt;h3 id="addition-1"&gt;Addition:
&lt;/h3&gt;&lt;p&gt;For two quaternions $q = a + b \mathrm{i} + c \mathrm{j} + d \mathrm{k}$ and $p = t + x \mathrm{i} + y \mathrm{j} + z \mathrm{k}$, their sum is:
&lt;/p&gt;
$$
q+p = (a+t) + (b+x) \mathrm{i} + (c+y) \mathrm{j} + (d+z) \mathrm{k}
$$&lt;p&gt;
For any quaternions:
&lt;/p&gt;
$$
\begin{align}
q_{1} + q_{2} &amp;= q_{2} + q_{1} \\
(q_{1} + q_{2}) + q_{3} &amp;= q_{1} + (q_{2} + q_{3})
\end{align}
$$&lt;h3 id="subtraction-1"&gt;Subtraction:
&lt;/h3&gt;&lt;p&gt;For two quaternions $q = a + b \mathrm{i} + c \mathrm{j} + d \mathrm{k}$ and $p = t + x \mathrm{i} + y \mathrm{j} + z \mathrm{k}$, their difference is:
&lt;/p&gt;
$$
q-p = (a-t) + (b-x) \mathrm{i} + (c-y) \mathrm{j} + (d-z) \mathrm{k}
$$&lt;h3 id="multiplication-1"&gt;Multiplication:
&lt;/h3&gt;&lt;p&gt;For two quaternions $q = a + b \mathrm{i} + c \mathrm{j} + d \mathrm{k}$ and $p = t + x \mathrm{i} + y \mathrm{j} + z \mathrm{k}$, their product is:
&lt;/p&gt;
$$
\begin{align}
q \cdot p &amp;= (a + b \mathrm{i} + c \mathrm{j} + d \mathrm{k}) (t + x \mathrm{i} + y \mathrm{j} + z \mathrm{k}) \\
&amp;= at - bx - cy - dz \\
&amp;+ (ax+bt+cz-dy) \mathrm{i} \\
&amp;+ (ay-bz+ct+dx) \mathrm{j} \\
&amp;+ (az+by-cx+dt) \mathrm{k}
\end{align}
$$&lt;p&gt;Quaternions can also be expressed by a much simpler way:
$q = a + b \mathrm{i} + c \mathrm{j} + d \mathrm{k} = (a, \vec{a})$, where $\vec{a} = (b, c, d)$.
In this way, the multiplication would become:
&lt;/p&gt;
$$
\begin{align}
q \cdot p &amp;= (a + b \mathrm{i} + c \mathrm{j} + d \mathrm{k}) (t + x \mathrm{i} + y \mathrm{j} + z \mathrm{k}) \\
&amp;= (a, \vec{a}) (t, \vec{t}) \\
&amp;= (at - \vec{a} \cdot \vec{t}, a \vec{t} + t \vec{a} + \vec{a} \times \vec{t})
\end{align}
$$&lt;h2 id="rotation"&gt;Rotation:
&lt;/h2&gt;&lt;p&gt;We call the quaternions which have a zero real part the Pure Quaternions. For any vector in 3 dimensional space, we can plug it in a pure quaternion $q$:
&lt;/p&gt;
$$
q = (0, \vec{v}) = 0 + x \mathrm{i} + y \mathrm{j} + z \mathrm{k}
$$&lt;p&gt;
Let&amp;rsquo;s say that we are rotating about a unit vector $\hat{u}$ for $\theta$ angle. Imitate the way of the complex number where we multiply a $\cos \theta + \mathrm{i} \sin \theta$, we construct a similar quaternion:
&lt;/p&gt;
$$
q = (\cos \theta, \sin \theta \hat{u})
$$&lt;p&gt;
If we completely follow the steps of the rotation of the complex number, trying to multiply a pure quaternion:
&lt;/p&gt;
$$
\begin{align}
p \prime &amp;= (\cos \theta, \sin \theta \hat{u}) \cdot (0, \vec{v}) \\
&amp;= (0 - \sin \theta (\hat{u} \cdot \vec{v}), \cos \theta \vec{v} + \sin \theta (\hat{u} \times \vec{v}))
\end{align}
$$&lt;p&gt;
But the real part of this quaternion is not zero which means that unless $\hat{u} \cdot \vec{v} = 0$, the quaternion $p \prime$ won&amp;rsquo;t become a pure quaternion. This means that this equation is unable to handle most of the rotations in 3 dimensional space. We need to multiply another thing to cancel out the non-zero real part.&lt;/p&gt;
&lt;p&gt;Let $q$ be a unit quaternion, $v = (0, \vec{v})$ be a pure quaternion, $v\prime = (0, \vec{v}\prime)$ be the pure quaternion after the rotation. Expand and calculate:
&lt;/p&gt;
$$
\begin{align}
v\prime = qvq^{-1} &amp;= qvq^* \\
&amp;= (s_{q}, \vec{v_{q}}) \cdot (0, \vec{v}) \cdot (s_{q}, -\vec{v_{q}}) \\
&amp;= (- \vec{v_{q}} \cdot \vec{v}, s_{q} \vec{v} + \vec{v_{q}} \times \vec{v}) \cdot (s_{q}, -\vec{v_{q}}) \\
\mathrm{Re}(v\prime) &amp;= s_{q} \cdot (- \vec{v_{q}} \cdot \vec{v}) - (-\vec{v_{q}}) \cdot (s_q \vec{v} + \vec{v_{q}} \times \vec{v}) = 0 \\
\vec{v}\prime &amp;= (-\vec{v_q} \cdot \vec{v}) \cdot (-\vec{v_q}) + s_q \cdot (s_q \vec{v} + \vec{v_q} \times \vec{v}) + (s_q \vec{v} + \vec{v_q} \times \vec{v}) \times (-\vec{v_q}) \\
&amp;= (\vec{v_q} \vec{v}) \cdot \vec{v_q} + s_q^2 \vec{v} + s_q \cdot (\vec{v_q} \times \vec{v}) - s_q (\vec{v} \times \vec{v_q}) - (\vec{v_q} \times \vec{v}) \times \vec{v_q} \\
&amp;= (\vec{v_q} \vec{v}) \cdot \vec{v_q} + s_q^2 \vec{v} + s_q \cdot (\vec{v_q} \times \vec{v}) + s_q (\vec{v_q} \times \vec{v}) - (\vec{v_q} \cdot \vec{v_q}) \cdot \vec{v} + (\vec{v} \cdot \vec{v_q}) \cdot \vec{v_q} \\
&amp;= (s_q^2 - \lvert \lvert \vec{v_q} \rvert \rvert ^2) \vec{v} + 2 s_q (\vec{v_q} \times \vec{v}) + 2(\vec{v} \cdot \vec{v_q}) \cdot \vec{v_q}
\end{align}
$$&lt;p&gt;
So, the full expression for $v\prime$:
&lt;/p&gt;
$$
v\prime = qvq^{-1} = qvq^* = (0, (s_q^2 - \lvert \lvert \vec{v_q} \rvert \rvert ^2) \vec{v} + 2 s_q (\vec{v_q} \times \vec{v}) + 2(\vec{v} \cdot \vec{v_q}) \cdot \vec{v_q})
$$&lt;p&gt;
Now, we need to derive if $q$ express rotate about the rotation axis $u$ of $\theta$ degrees, what is the expression of $s_q$ and $v_q$.&lt;/p&gt;
&lt;p&gt;The imaginary part vector of a quaternion must be in the same direction with the rotation axis.
&lt;/p&gt;
$$
\vec{v_q} = k\vec{u} (k \in \mathbb{R})
$$&lt;p&gt;
Because of $q$ is a unit quaternion, there is $s_q^2 + \lvert\lvert v_q \rvert\rvert^2=s_q^2 + k^2=1$.
Now, we break down the vector $\vec{v}$ into two parts:
&lt;/p&gt;
$$
\vec{v} = \vec{v_{\lvert\lvert}} + \vec{v_\perp}
$$&lt;ul&gt;
&lt;li&gt;$\vec{v_{\lvert\lvert}}$ is collinear with $\vec{u}$, satisfying $\vec{v_{\lvert\lvert}} = (\vec{u}\cdot\vec{v})\cdot\vec{u}$.&lt;/li&gt;
&lt;li&gt;$\vec{v_\perp}$ is orthogonal to $\vec{u}$, meaning $\vec{u} \cdot \vec{v_\perp} = 0$.
First, sub $\vec{v_{\lvert\lvert}}$ into the expression of $\vec{v}\prime$:

$$
\begin{align}
\vec{v_{\lvert\lvert}}\prime &amp;= (s_q^2 - \lvert \lvert \vec{v_q} \rvert \rvert ^2) \vec{v_{\lvert\lvert}} + 2 s_q (\vec{v_q} \times \vec{v_{\lvert\lvert}}) + 2(\vec{v_{\lvert\lvert}} \cdot \vec{v_q}) \cdot \vec{v_q} \\
&amp;= (s_q^2 - k^2) \vec{v_{\lvert\lvert}} + 0 + 2k^2 \vec{v_{\lvert\lvert}} \\
&amp;= (s^2_q + k^2) \vec{v_{\lvert\lvert}} \\
&amp;= \vec{v_{\lvert\lvert}}
\end{align}
$$
This means that component which is parallel to the rotation axis remains completely undisturbed by the operation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Second, sub $\vec{v_\perp}$ into the expression:
&lt;/p&gt;
$$
\begin{align}
\vec{v_\perp}\prime &amp;= (s_q^2 - \lvert \lvert \vec{v_q} \rvert \rvert ^2) \vec{v_\perp} + 2 s_q (\vec{v_q} \times \vec{v_\perp}) + 2(\vec{v_\perp} \cdot \vec{v_q}) \cdot \vec{v_q} \\
&amp;= (s_q^2 - k^2) \vec{v_\perp} + 2s_q(k \vec{u} \times \vec{v_\perp}) + 0 \\
&amp;= (s_q^2 - k^2) \vec{v_\perp} + 2s_q k (\vec{u} \times \vec{v}) 
\end{align}
$$&lt;p&gt;
Combines all these above together, the overall vector after the quaternion operation is:
&lt;/p&gt;
$$
\vec{v} \prime = \vec{v_{\lvert\lvert}} + (s_q^2 - k^2) \vec{v_\perp} + 2s_q k (\vec{u} \times \vec{v}) 
$$&lt;p&gt;
Now, we overlay the standard Rodrigues&amp;rsquo; Rotation Formula which dictates that a vector rotating around a unit axis $\vec{u}$ by a angle of $\theta$ behaves according to:
&lt;/p&gt;
$$
\vec{v} \prime = \vec{v_{\lvert\lvert}} + \cos \theta \vec{v_\perp} + \sin \theta (\vec{u} \times \vec{v})
$$&lt;p&gt;
By directly comparing the corresponding coefficients of our algebraic result against the geometric target:
&lt;/p&gt;
$$
\begin{cases}
s_q^2 - k^2 = \cos \theta \\
2s_qk = \sin \theta
\end{cases}
$$&lt;p&gt;
It is not hard to notice that the solution matches the standard trigonometric double-angle identities where:
&lt;/p&gt;
$$
\begin{align}
\cos \theta = \cos^2(\frac{\theta}{2}) - \sin^2(\frac{\theta}{2}) \\
\sin \theta = 2 \sin(\frac{\theta}{2}) \cos(\frac{\theta}{2})
\end{align}
$$&lt;p&gt;
Matching the terms explicitly yields the values for the scalar and vector scale factors of the quaternion:
&lt;/p&gt;
$$
s_q = \cos(\frac{\theta}{2}), k = \sin(\frac{\theta}{2})
$$&lt;p&gt;
So, substituting back these values into our initial definition $q = (s_q, \vec{v_q}) = (s_q, k \vec{u})$, we get the axis-angle rotation quaternion formula used universally in computer graphics and physics simulators:
&lt;/p&gt;
$$
q = \left[ \cos\left(\frac{\theta}{2}\right), \sin\left(\frac{\theta}{2}\right) \vec{u} \right]
$$&lt;h1 id="reference"&gt;Reference:
&lt;/h1&gt;&lt;ol&gt;
&lt;li&gt;[1] Yan-Bin Jia, Quaternions and Rotations. Com S 477/577 Course Notes, Iowa State University / Stanford Graphics Lab, 2013.
(&lt;a class="link" href="https://graphics.stanford.edu/courses/cs348a-17-winter/Papers/quaternion.pdf" target="_blank" rel="noopener"
 &gt;https://graphics.stanford.edu/courses/cs348a-17-winter/Papers/quaternion.pdf&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Math Notes</title><link>https://EMEEEEMMMM.github.io/posts/mathnotes/</link><pubDate>Tue, 28 Apr 2026 17:40:36 +0800</pubDate><guid>https://EMEEEEMMMM.github.io/posts/mathnotes/</guid><description>&lt;img src="https://EMEEEEMMMM.github.io/" alt="Featured image of post Math Notes" /&gt;&lt;h1 id="trigonometry"&gt;Trigonometry:
&lt;/h1&gt;$$
\begin{align}
&amp; \sin x = \frac{1}{\csc x} \\
&amp; \cos x = \frac{1}{\sec x} \\
&amp; \tan x = \frac{1}{\cot x} \\
&amp; \tan^2 \theta + 1 = \sec^2 \theta \\
&amp; \cot^2 \theta + 1 = \csc^2 \theta \\
&amp; \arcsin x + \arccos x = \frac{\pi}{2} \\
&amp;f(x)=\arctan x + \arctan \frac{1}{x}=\begin{cases}
\frac{\pi}{2}, x &gt; 0 \\
-\frac{\pi}{2}, x &lt; 0
\end{cases}
\end{align}
$$&lt;h1 id="limits"&gt;Limits:
&lt;/h1&gt;$$
\begin{align}
\lim_{x \to 0} \frac{\sin (x)}{x} &amp;= 1 \\
e = \lim_{x \to \infty} (1+\frac{1}{x})^x&amp;=\lim_{x \to 0^+} (1+x)^{\frac{1}{x}} \\
\end{align}
$$&lt;h1 id="derivative-and-integral"&gt;Derivative and Integral:
&lt;/h1&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Derivative&lt;/th&gt;
 &lt;th&gt;Integral&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx}x^n = nx^{n-1} $$&lt;/td&gt;
 &lt;td&gt;$$\int x^n dx= \frac{1}{n+1} x^{n+1} + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \sin x = \cos x$$&lt;/td&gt;
 &lt;td&gt;$$\int \cos x \ dx = \sin x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \cos x = - \sin x$$&lt;/td&gt;
 &lt;td&gt;$$\int \sin x \ dx = - \cos x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx}\ln(x) = \frac{1}{x}$$&lt;/td&gt;
 &lt;td&gt;$$\int \frac{1}{x} dx = \ln \lvert x \rvert + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} e^x = e^x$$&lt;/td&gt;
 &lt;td&gt;$$\int e^x dx = e^x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} a^x = a^x \times \ln a$$&lt;/td&gt;
 &lt;td&gt;$$\int a^x dx=\frac{a^x}{\ln(a)} + C, a&gt;0,a\neq1$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \tan x=\sec^2 x$$&lt;/td&gt;
 &lt;td&gt;$$\int \sec^2 x \ dx = \tan x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \cot x = -csc^2x$$&lt;/td&gt;
 &lt;td&gt;$$\int \csc^2 x \ dx = - \cot x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \sec x = \sec x \cdot \tan x$$&lt;/td&gt;
 &lt;td&gt;$$\int \sec x \cdot \tan x \ dx = \sec x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \csc x = - \csc x \cdot \cot x$$&lt;/td&gt;
 &lt;td&gt;$$\int \csc x \cdot \cot x \ dx = - \csc x + C $$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \arcsin x = \frac{1}{\sqrt{ 1-x^2 }}$$&lt;/td&gt;
 &lt;td&gt;$$\int \frac{1}{\sqrt{1-x^2}}dx=\arcsin x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \arccos x = - \frac{1}{\sqrt{ 1-x^2 }}$$&lt;/td&gt;
 &lt;td&gt;$$\int -\frac{1}{\sqrt{1-x^2}}dx = \arccos x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} \arctan x = \frac{1}{1+x^2}$$&lt;/td&gt;
 &lt;td&gt;$$\int \frac{1}{1+x^2}dx = \arctan x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;$$\frac{d}{dx} sec^{-1} x = \frac{1}{\lvert x \rvert \sqrt{x^2 - 1}}$$&lt;/td&gt;
 &lt;td&gt;$$\int \frac{1}{\lvert x \rvert \sqrt{x^2-1}}dx = sec^{-1}x + C$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="more-integration-formula"&gt;More Integration Formula:
&lt;/h2&gt;$$
\begin{align}
\int \tan x \ dx &amp;= \ln \lvert \sec x \rvert + C \ or \ -\ln\lvert \cos x \rvert + C \\
\int \cot x \ dx &amp;= \ln \lvert \sin x \rvert + C \ or \ -\ln\lvert \csc x \rvert + C \\
\int \sec x \ dx &amp;= \ln \lvert \sec x + \tan x \rvert + C \\
\int \csc x \ dx &amp;= \ln \lvert \csc x - \cot x \rvert + C \\
\int \ln x \ dx &amp;= x \ \ln \lvert x \rvert - x + C \\
\int \frac{1}{\sqrt{a^2-x^2}} dx &amp;= \arcsin(\frac{x}{a}) + C \\
\int \frac{1}{a^2+x^2} dx &amp;= \frac{1}{a} \arctan (\frac{x}{a}) + C \\
\int \frac{1}{x{\sqrt{x^2-a^2}}} dx &amp;= \frac{1}{a} \sec^{-1}\lvert\frac{x}{a} \rvert + C \ or \ \frac{1}{a} \arccos \lvert \frac{a}{x} \rvert + C \\
\int \sin^2 x \ dx &amp;= \frac{x}{2} - \frac{\sin 2x}{4} + C
\end{align}
$$&lt;h2 id="u-substitution-method"&gt;U-Substitution Method:
&lt;/h2&gt;&lt;p&gt;If $f(g(x))$ and $f \prime$ are continuous and $F \prime = f$, then
&lt;/p&gt;
$$\int f(g(x))g\prime(x)dx = F(g(x)) + C$$&lt;p&gt;
Let $u=g(x)$, then $du = g \prime (x) dx$:
&lt;/p&gt;
$$\int f(g(x))g\prime(x)dx = \int f(u) du = F(u) + C = F(g(x)) + C$$&lt;h2 id="integration-by-parts"&gt;Integration by Parts:
&lt;/h2&gt;&lt;p&gt;According to the product rule for differentiation:
&lt;/p&gt;
$$
\frac{d}{dx} (uv) = u \frac{dv}{dx} + v \frac{du}{dx}
$$&lt;p&gt;
Integrating tells us that:
&lt;/p&gt;
$$
uv = \int u \frac{dv}{dx} + \int v \frac{du}{dx}
$$&lt;p&gt;
Therefore:
&lt;/p&gt;
$$
\int u \frac{dv}{dx} = uv - \int v \frac{du}{dx}
$$&lt;h2 id="trigonometrical-substitution"&gt;Trigonometrical substitution:
&lt;/h2&gt;&lt;p&gt;Find:
&lt;/p&gt;
$$I = \int \sqrt{a^2-x^2}dx, a \geq 0$$&lt;p&gt;
First, solve the inequality:
&lt;/p&gt;
$$
\begin{align*} \\
a^2 - x^2 &amp;\ge 0 \\
\implies x^2 &amp;\le a^2 \\
\implies -a &amp;\le x \le a
\end{align*}
$$&lt;p&gt;Second, substitute x with a trigonometric function and solve the integral:
Let $x=a \sin t$, $t \in \left[-\frac{\pi}{2},\frac{\pi}{2} \right]$, then $dx = a \cdot \cos t dt$
&lt;/p&gt;
$$
\begin{align}
I &amp;= \int \sqrt{a^2 - (a \sin t)^2} a \cdot \cos t dt \\
&amp;= \int \sqrt{a^2(1-\sin^2 t)} a \cdot \cos t dt \\
&amp;= \int a^2 \cdot \cos^2 t \ dt \\
&amp;= a^2 \int \frac{\cos (2t) + 1}{2} dt \\
&amp;= a^2 \int \frac{1}{2} \cos 2t + \frac{1}{2} dt \\
&amp;= \frac{a^2}{2} \sin t \cdot \cos t + \frac{a^2}{2} \cdot t + C
\end{align}
$$&lt;p&gt;
Third, substitute x back into the expression by imagining a &amp;ldquo;fake&amp;rdquo; triangle:
&lt;/p&gt;
$$
\begin{align}
I &amp;= \frac{x}{2} \sqrt{a^2 - x^2} + \frac{a^2}{2} \arcsin (\frac{x}{a}) + C
\end{align}
$$&lt;h2 id="integration-by-partial-fractions"&gt;Integration by Partial Fractions:
&lt;/h2&gt;&lt;p&gt;Factor the denominator of the function, list the equations and solve them using the undetermined coefficient method. The big function will be split into two or more small functions which are easier to integrate than a whole big function.&lt;/p&gt;
&lt;h1 id="first-fundamental-theorems-of-calculus"&gt;First-Fundamental Theorems of Calculus:
&lt;/h1&gt;&lt;p&gt;If $f$ is continuous on $[a, b]$ and $F$ is an anti derivative of $f$ on $[a, b]$, then
&lt;/p&gt;
$$
\begin{align}
&amp;\int_a^b f(x) dx = F(b) - F(a) \\
&amp;Note: \ F(b) - F(a) \ is \ often \ denoted \ as [F(x)]^b_a
\end{align}
$$&lt;h1 id="area-between-two-curves"&gt;Area Between Two curves:
&lt;/h1&gt;$$
\begin{align}
A = \int^b_a(upper \ curve - lower \ curve) dx
\end{align}
$$&lt;h1 id="volumes-and-definite-integrals"&gt;Volumes and Definite Integrals:
&lt;/h1&gt;&lt;h2 id="the-disc-method"&gt;The Disc Method:
&lt;/h2&gt;&lt;p&gt;Revolving about a line $y=k$:
&lt;/p&gt;
$$
V = \pi \int^b_c(f(x) - k)^2 dx, where \ \lvert f(x) - k \rvert = radius
$$&lt;p&gt;
Revolving about a line $x=b$:
&lt;/p&gt;
$$
V = \pi \int^d_c (g(y) - h)^2 dy, where \ \lvert g(y) - h \rvert = radius
$$&lt;h2 id="the-washer-method"&gt;The Washer Method:
&lt;/h2&gt;&lt;p&gt;The volume of a solid (with a hole in the middle) generated by revolving a region bounded by 2 curves:
About a line $x=h$:
&lt;/p&gt;
$$
V = \pi \int^b_a \left[ (f(x) - h)^2 - (g(x) - h)^2 \right]dx
$$&lt;p&gt;
About a line $y=k$:
&lt;/p&gt;
$$
V = \pi \int^d_c \left[(p(y) - k)^2 - (q(y) - k)^2 \right]dy
$$&lt;h1 id="integration-of-parametric-polar-curves"&gt;Integration of Parametric, Polar Curves:
&lt;/h1&gt;&lt;h2 id="parametric-curves"&gt;Parametric Curves:
&lt;/h2&gt;&lt;h3 id="area"&gt;Area:
&lt;/h3&gt;&lt;p&gt;For a curve defined parametrically by $x=f(t)$ and $y=g(t)$, the area bounded by the curve between $t=\alpha$ and $t=\beta$ is $A = \int^\beta_\alpha g(t)f\prime(t)dt$.&lt;/p&gt;
&lt;h3 id="arc-length-for-parametric-curves"&gt;Arc Length for Parametric Curves:
&lt;/h3&gt;&lt;p&gt;The length of that arc is $L = \int^\beta_\alpha \sqrt{(\frac{dx}{dt})^2+(\frac{dy}{dt})^2} dt$.&lt;/p&gt;
&lt;p&gt;Proof:
Divide the parametric interval $\left[\alpha, \beta \right]$ into $n$ intervals.
&lt;/p&gt;
$$
\alpha = t_0 &lt; t_1 &lt; t_2 &lt; \cdots &lt; t_n = \beta
$$&lt;p&gt;
The corresponding delta t for every interval is $\Delta t_i=t_i - t_{i-1}$, correspond to the point on the curve is $P_i(x_i, y_i)$, where $x_i=f(t_i), y_i=g(t_i)$.
Connect the neighboring points $P_{i-1}$ and $P_{i}$ with a straight line, the total length of which is the sum of the lengths of all the segments:
&lt;/p&gt;
$$
L_n = \Sigma_{i=1}^n \lvert P_{i-1}P_{i} \rvert
$$&lt;p&gt;
When the maximum length of the intervals $\lambda = \max (\Delta t_1, \Delta t_2, \cdots, \Delta t_n) \to 0$, the limit of $L_n$ exist, this limit is the length of the curve:
&lt;/p&gt;
$$
L = \lim_{\lambda \to 0} \Sigma_{i=1}^n \lvert P_{i-1} P_{i} \rvert
$$&lt;p&gt;According to Pythagorean theorem, every segment $\lvert P_{i-1} P_{i} \rvert$ can be expressed as:
&lt;/p&gt;
$$
\begin{align}
&amp;\lvert P_{i-1} P_{i} \rvert = \sqrt{(\Delta x_i)^2 + (\Delta y_{i})^2} \\
&amp;where \ \Delta x_i = x_i - x_{i-1} = f(t_i) - f(t_{i-1}), \Delta y_i = y_i - y_{i-1} = g(t_i) - g(t_{i-1})
\end{align}
$$&lt;p&gt;According to the Lagrange mean value theorem, for every interval $\left[t_{i-1} , t_i \right]$, there must exist $\xi_i \in (t_{i-1}, t_i)$, such that $\Delta x_i = f\prime(\xi_i) \cdot \Delta t_i$. Similarly, there must also exist $\eta_i \in (t_{i-1}, t_i)$, such that $\Delta y_i = g\prime(\eta_i) \cdot \Delta t_i$.
Substitute them into the segments&amp;rsquo; expression:
&lt;/p&gt;
$$
\begin{align}
\lvert P_{i-1} P_{i} \rvert &amp;= \sqrt{(f\prime (\xi_i)\Delta t_i)^2 + (g\prime(\eta_i)\Delta t_i)^2} \\
\lvert P_{i-1} P_{i} \rvert &amp;= \sqrt{(f\prime (\xi_i))^2 + (g\prime(\eta_i))^2} \ \cdot \Delta t_i
\end{align}
$$&lt;p&gt;
So the expression of the length of the curve becomes:
&lt;/p&gt;
$$
L = \lim_{\lambda \to 0} \Sigma_{i=1}^n \sqrt{(f\prime (\xi_i))^2 + (g\prime(\eta_i))^2} \ \cdot \Delta t_i
$$&lt;p&gt;
Since when $\lambda \to 0$, the difference between $\eta_i$ and $\xi_i$ is also approaching 0 $\eta_i - \xi_i \to 0$, replacing $\eta_i$ by $\xi_i$ will remain the limit unchanged.
According to the definition of the definite integral, when $\lambda \to 0$, the limit of Riemann sum is the definite integral on interval $\left[\alpha, \beta \right]$:
&lt;/p&gt;
$$
L = \lim_{\lambda \to 0} L_n = \int ^\beta_\alpha \sqrt{(f\prime (t))^2 + (g\prime(t))^2} \ dt = \int^\beta_\alpha \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2} \ dt
$$&lt;h3 id="surface-area-for-parametric-curves"&gt;Surface Area for Parametric Curves:
&lt;/h3&gt;&lt;p&gt;The surface area created when that arc is revolved about the x-axis is
&lt;/p&gt;
$$
S = \int^\beta_\alpha 2 \pi y \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2} dt
$$&lt;h2 id="polar-curves"&gt;Polar Curves
&lt;/h2&gt;&lt;h3 id="area-for-polar-curves"&gt;Area for Polar Curves:
&lt;/h3&gt;&lt;p&gt;If $r=f(\theta)$ is a continuous polar curve on the interval $\alpha \leq \theta \leq \beta$ and $\alpha &amp;lt; \beta &amp;lt; \alpha + 2 \pi$, then the area enclosed by the polar curve is
&lt;/p&gt;
$$
A = \frac{1}{2} \int^\beta_\alpha \left[f(\theta)\right]^2 d\theta = \frac{1}{2} \int^\beta_\alpha r^2 d\theta
$$&lt;h3 id="arc-length-for-polar-curves"&gt;Arc Length for Polar Curves:
&lt;/h3&gt;&lt;p&gt;For a polar graph defined on a interval $\left(\alpha, \beta \right)$, if the graph does not retrace itself in that interval and if $\frac{dr}{d\theta}$ is continuous, then the length of the arc from $\theta=\alpha$ to $\theta = \beta$ is
&lt;/p&gt;
$$
L = \int^\beta_\alpha \sqrt{r^2 + (\frac{dr}{d\theta})^2} d\theta
$$&lt;h1 id="differential-equations"&gt;Differential Equations
&lt;/h1&gt;&lt;h2 id="separable-differential-equations"&gt;Separable Differential Equations:
&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;Separate the variables: $g(y)dy = f(x) dx$&lt;/li&gt;
&lt;li&gt;Integrate both sides: $\int g(y) dy = \int f(x) dx$&lt;/li&gt;
&lt;li&gt;Solve for $y$ to get a general solution&lt;/li&gt;
&lt;li&gt;Substitute given conditions to get a particular solution&lt;/li&gt;
&lt;li&gt;Verify your result by differentiating&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="logistic-differential-equations"&gt;Logistic Differential Equations:
&lt;/h2&gt;&lt;p&gt;Logistic growth is represented by the differential equation
&lt;/p&gt;
$$
\frac{dP}{dt} = kP ( 1 - \frac{P}{K})
$$&lt;p&gt;
where $P$ is the population, $K$ is the carrying capacity, and $k$ is the proportional constant.
Derivation:
This is a separable differential equation so
&lt;/p&gt;
$$
\begin{align}
\frac{dP}{dt} &amp;= \frac{kP(K-P)}{K} \\
\frac{K}{P(K-P)} dP &amp;= k dt \\
\int \frac{KdP}{P(K-P)}dP &amp;= \int k dt \\
\int (\frac{1}{P} + \frac{1}{K-P})dP &amp;= \int k dt \\
\ln{\lvert P \rvert} - \ln{\lvert K-P \rvert} &amp;= kt + C_1 \\
\ln{\left\lvert \frac{P}{K-P} \right\rvert} &amp;= kt + C_1 \\
e^{kt+C_1} &amp;= \frac{P}{K-P} \\
let \ C_2&amp;=e^{C_{1}} \\
C_2 e^{kt} (K - P) &amp;= P \\
C_2 e^{kt} K &amp;= P (C_2 e^{kt} + 1) \\
P &amp;= \frac{C_2 e^{kt} K}{C_2 e^{kt} + 1} \\
P(t) &amp;= \frac{K}{(\frac{1}{C_2})e^{-kt}+1}
\end{align}
$$</description></item></channel></rss>