Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Deriving Trigonometry Formulae
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Deriving Trigonometry Formulae\n",
"\n",
"## Step 1: Deriving Compound Angle Formulae\n",
"\n",
"Start with Euler's formula:\n",
"\n",
"$$\n",
"e^{i\\theta} = \\cos\\theta + i\\sin\\theta\n",
"$$\n",
"\n",
"Put $\\theta = A + B$:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\cos(A + B) + i\\sin(A + B) &= e^{i(A + B)} \\\\\n",
"&= e^{iA} \\cdot e^{iB} \\\\\n",
"&= (\\cos{A} + i\\sin{A}) \\cdot (\\cos{B} + i\\sin{B}) \\\\\n",
"&= \\cos{A}\\cos{B} + i\\cos{A}\\sin{B} + i\\sin{A}\\cos{B} + i^2\\sin{A}\\sin{B} \\\\\n",
"&= (\\cos{A}\\cos{B} - \\sin{A}\\sin{B}) + i(\\sin{A}\\cos{B} + \\cos{A}\\sin{B})\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Separate real and imaginary parts:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\cos(A + B) + i\\sin(A + B) &= (\\cos{A}\\cos{B} - \\sin{A}\\sin{B}) + i(\\sin{A}\\cos{B} + \\cos{A}\\sin{B}) \\\\\n",
"\\implies \\quad \\cos(A + B) &= \\cos{A}\\cos{B} - \\sin{A}\\sin{B} \\\\\n",
"\\text{and} \\quad \\sin(A + B) &= \\sin{A}\\cos{B} + \\cos{A}\\sin{B}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Put $\\theta = A - B$:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\cos(A - B) + i\\sin(A - B) &= e^{i(A - B)} \\\\\n",
"&= e^{iA} \\cdot e^{-iB} \\\\\n",
"&= (\\cos{A} + i\\sin{A}) \\cdot (\\cos(-B) + i\\sin(-B)) \\\\\n",
"&= (\\cos{A} + i\\sin{A}) \\cdot (\\cos{B} - i\\sin{B}) \\\\\n",
"&= \\cos{A}\\cos{B} - i\\cos{A}\\sin{B} + i\\sin{A}\\cos{B} - i^2\\sin{A}\\sin{B} \\\\\n",
"&= (\\cos{A}\\cos{B} + \\sin{A}\\sin{B}) + i(\\sin{A}\\cos{B} - \\cos{A}\\sin{B})\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Separate real and imaginary parts:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\cos(A - B) + i\\sin(A - B) &= (\\cos{A}\\cos{B} + \\sin{A}\\sin{B}) + i(\\sin{A}\\cos{B} - \\cos{A}\\sin{B}) \\\\\n",
"\\implies \\quad \\cos(A - B) &= \\cos{A}\\cos{B} + \\sin{A}\\sin{B} \\\\\n",
"\\text{and} \\quad \\sin(A - B) &= \\sin{A}\\cos{B} - \\cos{A}\\sin{B}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Conclusion:\n",
"\n",
"$$\n",
"\\boxed{\n",
"\\begin{aligned}\n",
"\\sin(A + B) &= \\sin{A}\\cos{B} + \\cos{A}\\sin{B} \\\\\n",
"\\sin(A - B) &= \\sin{A}\\cos{B} - \\cos{A}\\sin{B} \\\\\n",
"\\cos(A + B) &= \\cos{A}\\cos{B} - \\sin{A}\\sin{B} \\\\\n",
"\\cos(A - B) &= \\cos{A}\\cos{B} + \\sin{A}\\sin{B}\n",
"\\end{aligned}\n",
"}\n",
"$$\n",
"\n",
"## Step 1.5: Deriving Double / Half Angle Formulae (Special Cases of Compound Angle Formulae)\n",
"\n",
"Put $B = A$ into $\\sin(A + B)$ above:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\sin(A + B) &= \\sin{A}\\cos{B} + \\cos{A}\\sin{B} \\\\\n",
"\\sin(A + A) &= \\sin{A}\\cos{A} + \\cos{A}\\sin{A} \\\\\n",
"\\sin(2A) &= 2\\sin{A}\\cos{A}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Put $B = A$ into $\\cos(A + B)$ above:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\cos(A + B) &= \\cos{A}\\cos{B} - \\sin{A}\\sin{B} \\\\\n",
"\\cos(A + A) &= \\cos{A}\\cos{A} - \\sin{A}\\sin{A} \\\\\n",
"\\cos(2A) &= \\cos^2{A} - \\sin^2{A}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Write $\\cos(2A)$ in terms of $\\cos{A}$:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\cos(2A) &= \\cos^2{A} - \\sin^2{A} \\\\\n",
"&= \\cos^2{A} - (1 - \\cos^2{A}) \\\\\n",
"&= 2\\cos^2{A} - 1\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Write $\\cos(2A)$ in terms of $\\sin{A}$:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\cos(2A) &= \\cos^2{A} - \\sin^2{A} \\\\\n",
"&= (1 - \\sin^2{A}) - \\sin^2{A} \\\\\n",
"&= 1 - 2\\sin^2{A}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Put $A = \\displaystyle\\frac{C}{2}$ into $\\cos(2A)$ in terms of $\\cos{A}$ above:\n",
"\n",
"$$\n",
"\\displaystyle\n",
"\\begin{aligned}\n",
"\\cos(2A) &= 2\\cos^2{A} - 1 \\\\\n",
"\\cos(2 \\cdot \\frac{C}{2}) &= 2\\cos^2{\\frac{C}{2}} - 1 \\\\\n",
"\\cos{C} &= 2\\cos^2{\\frac{C}{2}} - 1 \\\\\n",
"\\frac{\\cos{C} + 1}{2} &= \\cos^2{\\frac{C}{2}} \\\\\n",
"\\pm\\sqrt{\\frac{\\cos{C} + 1}{2}} &= \\cos\\frac{C}{2} \\\\\n",
"\\cos\\frac{C}{2} &= \\pm\\sqrt{\\frac{1 + \\cos{C}}{2}}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Put $A = \\displaystyle\\frac{C}{2}$ into $\\cos(2A)$ in terms of $\\sin{A}$ above:\n",
"\n",
"$$\n",
"\\displaystyle\n",
"\\begin{aligned}\n",
"\\cos(2A) &= 1 - 2\\sin^2{A} \\\\\n",
"\\cos(2 \\cdot \\frac{C}{2}) &= 1 - 2\\sin^2{\\frac{C}{2}} \\\\\n",
"\\cos{C} &= 1 - 2\\sin^2{\\frac{C}{2}} \\\\\n",
"2\\sin^2{\\frac{C}{2}} &= 1 - \\cos{C} \\\\\n",
"\\sin{\\frac{C}{2}} &= \\pm\\sqrt{\\frac{1 - \\cos{C}}{2}}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"Conclusion:\n",
"\n",
"$$\n",
"\\displaystyle\n",
"\\boxed{\n",
"\\begin{aligned}\n",
"\\sin(2\\theta) &= 2\\sin\\theta\\cos\\theta \\\\\n",
"\\cos(2\\theta) &= \\cos^2\\theta - \\sin^2\\theta \\\\\n",
"&= 2\\cos^2\\theta - 1 \\\\\n",
"&= 1 - 2\\sin^2\\theta \\\\\n",
"\\sin{\\frac{\\theta}{2}} &= \\pm\\sqrt{\\frac{1 - \\cos{\\theta}}{2}} \\\\\n",
"\\cos\\frac{\\theta}{2} &= \\pm\\sqrt{\\frac{1 + \\cos{\\theta}}{2}}\n",
"\\end{aligned}\n",
"}\n",
"$$\n",
"\n",
"## Step 2: Deriving Product-to-Sum Formulae\n",
"\n",
"From Step 1 above, add $\\sin(A - B)$ to $\\sin(A + B)$:\n",
"\n",
"$$\n",
"\\begin{array}{rrl}\n",
" & \\sin(A + B) \\!\\!\\!\\!\\! &= \\sin{A}\\cos{B} + \\cos{A}\\sin{B} \\\\\n",
"+ & \\sin(A - B) \\!\\!\\!\\!\\! &= \\sin{A}\\cos{B} - \\cos{A}\\sin{B} \\\\\n",
"\\hline\n",
"& \\sin(A + B) + \\sin(A - B) \\!\\!\\!\\!\\! &= 2\\sin{A}\\cos{B} \\\\\n",
"& \\implies \\sin{A}\\cos{B} \\!\\!\\!\\!\\! &= (1/2)[\\sin(A + B) + \\sin(A - B)]\n",
"\\end{array}\n",
"$$\n",
"\n",
"From Step 1 above, subtract $\\sin(A - B)$ from $\\sin(A + B)$:\n",
"\n",
"$$\n",
"\\begin{array}{rrl}\n",
" & \\sin(A + B) \\!\\!\\!\\!\\! &= \\sin{A}\\cos{B} + \\cos{A}\\sin{B} \\\\\n",
"- & \\sin(A - B) \\!\\!\\!\\!\\! &= \\sin{A}\\cos{B} - \\cos{A}\\sin{B} \\\\\n",
"\\hline\n",
"& \\sin(A + B) - \\sin(A - B) \\!\\!\\!\\!\\! &= 2\\cos{A}\\sin{B} \\\\\n",
"& \\implies \\cos{A}\\sin{B} \\!\\!\\!\\!\\! &= (1/2)[\\sin(A + B) - \\sin(A - B)]\n",
"\\end{array}\n",
"$$\n",
"\n",
"From Step 1 above, add $\\cos(A - B)$ to $\\cos(A + B)$:\n",
"\n",
"$$\n",
"\\begin{array}{rrl}\n",
" & \\cos(A + B) \\!\\!\\!\\!\\! &= \\cos{A}\\cos{B} - \\sin{A}\\sin{B} \\\\\n",
"+ & \\cos(A - B) \\!\\!\\!\\!\\! &= \\cos{A}\\cos{B} + \\sin{A}\\sin{B} \\\\\n",
"\\hline\n",
"& \\cos(A + B) + \\cos(A - B) \\!\\!\\!\\!\\! &= 2\\cos{A}\\cos{B} \\\\\n",
"& \\implies \\cos{A}\\cos{B} \\!\\!\\!\\!\\! &= (1/2)[\\cos(A + B) + \\cos(A - B)]\n",
"\\end{array}\n",
"$$\n",
"\n",
"From Step 1 above, subtract $\\cos(A - B)$ from $\\cos(A + B)$ above:\n",
"\n",
"$$\n",
"\\begin{array}{rrl}\n",
" & \\cos(A + B) \\!\\!\\!\\!\\! &= \\cos{A}\\cos{B} - \\sin{A}\\sin{B} \\\\\n",
"- & \\cos(A - B) \\!\\!\\!\\!\\! &= \\cos{A}\\cos{B} + \\sin{A}\\sin{B} \\\\\n",
"\\hline\n",
"& \\cos(A + B) - \\cos(A - B) \\!\\!\\!\\!\\! &= -2\\sin{A}\\sin{B} \\\\\n",
"& \\implies \\sin{A}\\sin{B} \\!\\!\\!\\!\\! &= (-1/2)[\\cos(A + B) - \\cos(A - B)]\n",
"\\end{array}\n",
"$$\n",
"\n",
"Conclusion:\n",
"\n",
"$$\n",
"\\displaystyle\n",
"\\boxed{\n",
"\\begin{aligned}\n",
"\\sin{A}\\cos{B} &= \\frac{1}{2}\\big[\\sin(A + B) + \\sin(A - B)\\big] \\\\\n",
"\\cos{A}\\sin{B} &= \\frac{1}{2}\\big[\\sin(A + B) - \\sin(A - B)\\big] \\\\\n",
"\\cos{A}\\cos{B} &= \\frac{1}{2}\\big[\\cos(A + B) + \\cos(A - B)\\big] \\\\\n",
"\\sin{A}\\sin{B} &= -\\frac{1}{2}\\big[\\cos(A + B) - \\cos(A - B)\\big]\n",
"\\end{aligned}\n",
"}\n",
"$$\n",
"\n",
"## Step 3: Deriving Sum-to-Product Formulae\n",
"\n",
"Let $C = A + B$ and $D = A - B$.\n",
"\n",
"Then, $A = \\displaystyle\\frac{C + D}{2}$, $B = \\displaystyle\\frac{C - D}{2}$.\n",
"\n",
"From step 2 above:\n",
"\n",
"$$\n",
"\\begin{aligned}\n",
"\\sin{A}\\cos{B} &= (1/2)[\\sin(A + B) + \\sin(A - B)] \\\\\n",
"\\cos{A}\\sin{B} &= (1/2)[\\sin(A + B) - \\sin(A - B)] \\\\\n",
"\\cos{A}\\cos{B} &= (1/2)[\\cos(A + B) + \\cos(A - B)] \\\\\n",
"\\sin{A}\\sin{B} &= (-1/2)[\\cos(A + B) - \\cos(A - B)]\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"After substitution:\n",
"\n",
"$$\n",
"\\displaystyle\n",
"\\begin{aligned}\n",
"\\sin{\\frac{C + D}{2}}\\cos{\\frac{C - D}{2}} &= \\frac{1}{2}(\\sin{C} + \\sin{D}) \\\\\n",
"\\cos{\\frac{C + D}{2}}\\sin{\\frac{C - D}{2}} &= \\frac{1}{2}(\\sin{C} - \\sin{D}) \\\\\n",
"\\cos{\\frac{C + D}{2}}\\cos{\\frac{C - D}{2}} &= \\frac{1}{2}(\\cos{C} + \\cos{D}) \\\\\n",
"\\sin{\\frac{C + D}{2}}\\sin{\\frac{C - D}{2}} &= -\\frac{1}{2}(\\cos{C} - \\cos{D})\n",
"\\end{aligned} \\\\\n",
"$$\n",
"\n",
"After rearrangement:\n",
"\n",
"$$\n",
"\\displaystyle\n",
"\\begin{aligned}\n",
"\\sin{C} + \\sin{D} &= 2\\sin{\\frac{C + D}{2}}\\cos{\\frac{C - D}{2}} \\\\\n",
"\\sin{C} - \\sin{D} &= 2\\cos{\\frac{C + D}{2}}\\sin{\\frac{C - D}{2}} \\\\\n",
"\\cos{C} + \\cos{D} &= 2\\cos{\\frac{C + D}{2}}\\cos{\\frac{C - D}{2}} \\\\\n",
"\\cos{C} - \\cos{D} &= -2\\sin{\\frac{C + D}{2}}\\sin{\\frac{C - D}{2}}\n",
"\\end{aligned}\n",
"$$\n",
"\n",
"\n",
"Conslusion:\n",
"\n",
"$$\n",
"\\displaystyle\n",
"\\boxed{\n",
"\\begin{aligned}\n",
"\\sin{A} + \\sin{B} &= 2\\sin{\\frac{A + B}{2}}\\cos{\\frac{A - B}{2}} \\\\\n",
"\\sin{A} - \\sin{B} &= 2\\cos{\\frac{A + B}{2}}\\sin{\\frac{A - B}{2}} \\\\\n",
"\\cos{A} + \\cos{B} &= 2\\cos{\\frac{A + B}{2}}\\cos{\\frac{A - B}{2}} \\\\\n",
"\\cos{A} - \\cos{B} &= -2\\sin{\\frac{A + B}{2}}\\sin{\\frac{A - B}{2}}\n",
"\\end{aligned}\n",
"}\n",
"$$"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment