# 102 - Topic 05 - Analytic Trigonometry Formulas

## 324 days ago by Professor102

Analytic Trigonometric Formulas - Derivation

John Travis

Mississippi College

Starting with a unit circle approach, developing all the sum, difference, double angle and half angle formulas.

%hide %auto @interact def _(A = slider(1,3,1/10,1.5,label='Angle $A$'),B = slider(1,3,1/10,1,label='Angle $B$')): if A==B: pretty_print('Formula is not interesting if $A=B$. Make them different!') else: pt0 = (1,0) ptA = (cos(A),sin(A)) ptB = (cos(B),sin(B)) ptAmB = (cos(A-B),sin(A-B)) d1 = (cos(A-B)-1)^2 + sin(A-B)^2 d2 = (cos(A)-cos(B))^2 + (sin(A)-sin(B))^2 G = circle((0,0), 1, edgecolor='blue' ) G += line([(0,0),ptAmB],color='gray')+line([pt0,ptAmB],color='green',thickness=5) G += text(str(d1.n(digits=5)),( (cos(A-B)+1)/2.5, sin(A-B)/2.5),rotation=90+180*atan(sin(A-B)/(cos(A-B)-1))/pi) G += text(str(d2.n(digits=5)),( (cos(A)+cos(B))/2.5, (sin(A)+sin(B))/2.5),rotation=90+180*atan((sin(A)-sin(B))/(cos(A)-cos(B)))/pi) G += text('(1,0)',pt0,fontsize=15,color='red')+text('A-B',ptAmB,fontsize=15,color='red') G += text('A',ptA,fontsize=15,color='red')+text('B',ptB,fontsize=15,color='red') G += line([(0,0),ptA],color='gray')+line([(0,0),ptB],color='gray') G += line([ptA,ptB],color='green',thickness=5) G.show(aspect_ratio=True) pretty_print('Distances for each of the arc segments: %s'%str(d1.n())+' and %s'%str(d2.n()))

Angle $A$
Angle $B$

## Click to the left again to hide and once more to show the dynamic interactive window

%hide %auto reset() var('A,B,C') d1 = sin(A-B)^2 + (cos(A-B)-1)^2 d2 = (sin(A)-sin(B))^2 + (cos(A)-cos(B))^2 equation = d1 == d2 pretty_print(html('Equating the two distances $d_1$ and $d_2$ gives')) equation.show() pretty_print('Expanding the squares on each side gives') equation2 = d1.expand() == d2.expand() equation2.show() pretty_print('Canceling using the Pythagorean identities gives') d1a = (d1+2*cos(A-B)).simplify_trig() d2a = d2.simplify_trig() equation3 = d1a -2*cos(A-B) == d2a equation3.simplify().show() pretty_print('Cancel the leftover $2$s and negatives gives the formula') equation4(A,B) = cos(A-B) == (-d2a/2+1) equation4(A,B).show()
 Equating the two distances $d_1$ and $d_2$ gives Equating the two distances and gives
%hide %auto pretty_print(html('Replacing $B$ with $-B$ yields the addition formula for cosine') ) equation4(A,-B).show() pretty_print(html('Use the fact at $\sin$ is odd and $\cos$ is even to get the addition formula.'))
 Replacing $B$ with $-B$ yields the addition formula for cosineUse the fact at $\sin$ is odd and $\cos$ is even to get the addition formula. Replacing with yields the addition formula for cosineUse the fact at is odd and is even to get the addition formula.
%hide %auto pretty_print(html('Using this formula and replacing $A$ with $\pi/2-A$ and $B$ with $-B$ yields')) equation5=equation4(pi/2-A,B) equation5.show() pretty_print(html('The cofunction relationships yield')) equation6(A,B) = sin(A+B) == sin(A)*cos(B)+cos(A)*sin(B) equation6(A,B).show()
 Using this formula and replacing $A$ with $\pi/2-A$ and $B$ with $-B$ yieldsThe cofunction relationships yield Using this formula and replacing with and with yieldsThe cofunction relationships yield
%auto %hide pretty_print(html('Replacing $B$ with $-B$ yields')) equation6(A,-B).show() pretty_print(html('Use the fact at $\sin$ is odd and $\cos$ is even to get the subtraction formula.'))
 Replacing $B$ with $-B$ yieldsUse the fact at $\sin$ is odd and $\cos$ is even to get the subtraction formula. Replacing with yieldsUse the fact at is odd and is even to get the subtraction formula.
%hide %auto pretty_print(html('Replacing $A-B$ with $A+A$ yields the double angle formula')) equation6(A,A).show()
 Replacing $A-B$ with $A+A$ yields the double angle formula Replacing with yields the double angle formula
%hide %auto pretty_print(html('Visually, <font color="blue">$\sin(2A)$</font> is the traditional sine curve compressed horizontally.')) pretty_print(html('Visually, <font color="green">$2\sin(A)$</font> is the traditional sine curve expanded vertically.')) pretty_print(html('By multiplying $2\sin(A)$ by $\cos(A)$ the second curve is given a variable amplitude.')) pretty_print(html('The animation shows what happens as $2\sin(A)$ is increasingly multiplied by $\cos(A)$.')) Slides = [] G = plot(sin(2*x),(x,0,2*pi),color='blue',alpha=0.3)+plot(2*sin(x),(x,0,2*pi),color='green',alpha=0.3) for k in range(1,20): c = cos(k/20*x) H = G + plot(2*sin(x)*c,(x,0,2*pi),color='red') Slides.append(H) animate(Slides).show(delay=20, iterations=0)
 Visually, $\sin(2A)$ is the traditional sine curve compressed horizontally.Visually, $2\sin(A)$ is the traditional sine curve expanded vertically.By multiplying $2\sin(A)$ by $\cos(A)$ the second curve is given a variable amplitude.The animation shows what happens as $2\sin(A)$ is increasingly multiplied by $\cos(A)$. Visually, is the traditional sine curve compressed horizontally.Visually, is the traditional sine curve expanded vertically.By multiplying by the second curve is given a variable amplitude.The animation shows what happens as is increasingly multiplied by . %hide %auto pretty_print(html('Using the similar addition formula for $\cos$ but replacing $A+B$ with $A+B$ yields the double angle formula')) equation4(A,-A).show() pretty_print(html('Evenness and oddness gives a first formula for $\cos(2*A)$')) (cos(2*A) == cos(A)^2-sin(A)^2).show() pretty_print(html('Replacing $\sin(A)^2$ with $1-\cos(A)^2$ gives a second formula for $\cos(2*A)$')) (cos(2*A) == 2*cos(A)^2-1).show() pretty_print(html('Instead, replacing $\cos(A)^2$ with $1-\sin(A)^2$ gives a third formula for $\cos(2*A)$')) (cos(2*A) == 1-2*sin(A)^2).show()
 Using the similar addition formula for $\cos$ but replacing $A+B$ with $A+B$ yields the double angle formulaEvenness and oddness gives a first formula for $\cos(2*A)$Replacing $\sin(A)^2$ with $1-\cos(A)^2$ gives a second formula for $\cos(2*A)$Instead, replacing $\cos(A)^2$ with $1-\sin(A)^2$ gives a third formula for $\cos(2*A)$ Using the similar addition formula for but replacing with yields the double angle formulaEvenness and oddness gives a first formula for Replacing with gives a second formula for Instead, replacing with gives a third formula for
%hide %auto pretty_print(html('Compare the equality of the last two forms for $\cos(2A)$:\n')) pretty_print(html('Graph <font color="green">$\sin^2(A)$</font> and then flip and stretch vertically.')) pretty_print(html('Graph <font color="blue">$\cos^2(A)$</font> and then stretch vertically.')) pretty_print(html('Finally translate blue down $1$ and green up $1$')) Slides = [] G = plot(cos(x)^2,(x,0,2*pi),color='blue',alpha=0.4) H = plot(sin(x)^2,(x,0,2*pi),color='green',alpha=0.4) for k in range(1,10): flip = (5-k)/5 Slides.append(G+H+plot(flip*sin(x)^2,(x,0,2*pi),color='green')) Slides.append(G+H+plot(-1*sin(x)^2,(x,0,2*pi),color='green')) for k in range(1,10): r = k/10 Slides.append(G+H+plot((-1-r)*sin(x)^2,(x,0,2*pi),color='green')) H1 = plot(-2*sin(x)^2,(x,0,2*pi),color='green') Slides.append(G+H+H1) for k in range(1,11): r = k/10 Slides.append(G+H+H1+plot((1+r)*cos(x)^2,(x,0,2*pi),color='blue')) for k in range(1,10): r = k/10 Slides.append(G+H+plot(2*cos(x)^2-r,(x,0,2*pi),color='blue')+plot(r-2*sin(x)^2,(x,0,2*pi),color='green')) G += plot(2*cos(x)^2-1,(x,0,2*pi),color='red') Slides.append(G+H) animate(Slides).show(delay=30, iterations=3)
 Compare the equality of the last two forms for $\cos(2A)$: Graph $\sin^2(A)$ and then flip and stretch vertically.Graph $\cos^2(A)$ and then stretch vertically.Finally translate blue down $1$ and green up $1$ Compare the equality of the last two forms for : Graph and then flip and stretch vertically.Graph and then stretch vertically.Finally translate blue down and green up # Trying to save animation to a file for quicker use later. #dir = tmp_dir() + '/' #Slides.gif(savefile=dir + 'my_animation.gif', show_path=True) #Slides.ffmpeg(savefile=dir + 'new.mpg', show_path=True)
%hide %auto solns(A) = solve((cos(2*A) == 1-2*sin(A)^2),sin(A)) html('Using the <i>second</i> formula but solving for $\sin(A)$ gives') solns(A).show() html('or') solns(A).show() html('Replacing $A$ with $A/2$ (using the $+$ formula) gives $\sin(A/2)$') solns(A/2).show()
%hide %auto html('Visually verify the half-angle formula for $\sin(A/2)$:\n') html('Graph <font color="green">$\sin(A)$</font> and then stretch horizontally for a period of $4\pi$ to get $\sin(A/2)$.') html('Graph <font color="blue">$- \cos(A)$</font>, up one, compress by half and then square root.') html('Notice that the graphs agree for half the time and are negatives of each other for the other half. This reflects the $\pm$ formulas.') Slides = [] G = plot(-1*cos(x),(x,0,4*pi),color='blue',alpha=0.3) H = plot(sin(x),(x,0,2*pi),color='green',alpha=0.3) for k in range(1,10): r = k/10 Slides.append(G+H+plot(sin(x/(1+r)),(x,0,4*pi),color='green')) H += plot(sin(x/2),(x,0,4*pi),color='green') Slides.append(G+H) for k in range(1,10): r = k/10 Slides.append(G+H+plot(r-cos(x),(x,0,4*pi),color='blue')) for k in range(1,11): r = k/10 Slides.append(G+H+plot((1-cos(x))/(1+r),(x,0,4*pi),color='blue')) for k in range(1,5): r = k/10 Slides.append(G+H+plot(((1-cos(x))/2)^(1-r),(x,0,4*pi),color='blue')) G += plot(sqrt((1-cos(x))/2),(x,0,4*pi),color='blue') Slides.append(G+H) #G += plot(plot(((1-cos(x))/2)^0.5,(x,0,4*pi),color='blue') #Slides.append(G+H) animate(Slides).show(delay=30, iterations=3) %hide %auto solns(A) = solve((cos(2*A) == 2*cos(A)^2-1),cos(A)) html('Using the <i>third</i> formula but solving for $\cos(A)$ gives') solns(A).show() html('or') solns(A).show() html('Replacing $A$ with $A/2$ (using the $+$ formula) gives $\cos(A/2)$') solns(A/2).show()