Question 629265
There may be be a much easier way to do this. But since you haven't gotten a response in over a day, I'd thought I'd give it a try.<br>
To save on typing I'm going to use A and B instead of alpha and beta.<br>
Using the Quadratic Formula on {{{x^2-px+q=0}}} we get:
{{{x = (-(-p) +- sqrt((-p)^2-4(1)(q)))/2(1)}}}
Simplifying...
{{{x = (-(-p) +- sqrt(p^2-4(1)(q)))/2(1)}}}
{{{x = (-(-p) +- sqrt(p^2-4q))/2(1)}}}
{{{x = (p +- sqrt(p^2-4q))/2}}}
which is short for
{{{x = (p + sqrt(p^2-4q))/2}}} or {{{x = (p - sqrt(p^2-4q))/2}}}<br>
It doesn't matter which one we say is tan(A) and which one is tan(B). So I'll make the first root tan(A) and the second one tan(B).<br>
Next we use the formula for {{{tan(A+B) = (tan(A) + tan(B))/(1-tan(A)*tan(B))}}}. Inserting our roots into this formula we get:
{{{tan(A+B) = (((p + sqrt(p^2-4q))/2) + ((p - sqrt(p^2-4q))/2))/(1-((p + sqrt(p^2-4q))/2)*((p - sqrt(p^2-4q))/2))}}}
Simplifying... (Note: to multiply the two numerators in the denominator, I am going to use the {{{(a+b)(a-b) = a^2-b^2}}} pattern.)
{{{tan(A+B) = ((2p)/2)/(1-((p)^2 - (sqrt(p^2-4q))^2)/4)}}}
{{{tan(A+B) = p/(1-(p^2 - (p^2-4q))/4)}}}
{{{tan(A+B) = p/(1-(4q/4))}}}
{{{tan(A+B) = p/(1-q)}}}<br>
From this we are going to find an expression for sin(A+B). tan is opposite/adjacent. So draw a right triangle, pick one of the acute angles and make the opposite side "p" and the adjacent side "1+q". Then use the Pythagorean Theorem to find the hypotenuse. You should get {{{sqrt(p^2 + (1+q)^2)}}}. Since sin is opposite/hypotenuse:
{{{sin(A+B) = p/sqrt(p^2 + (1+q)^2)}}}<br>
Next we will use the {{{cos(2x) = 1 - 2sin^2(x)}}} variation of the cos(2x) formulas to find our answer. Replacing the x's with (A+B)'s:
{{{cos(2(a+B)) = 1 - 2sin^2(A+B)}}}
Replacing the sin(A+B) with the expression we found earlier:
{{{cos(2(a+B)) = 1 - 2(p/sqrt(p^2 + (1+q)^2))^2}}}
Simplifying:
{{{cos(2(a+B)) = 1 - 2(p^2/(p^2 + (1+q)^2))}}}
{{{cos(2(a+B)) = 1 - (2p^2)/(p^2 + (1+q)^2)}}}
{{{cos(2(a+B)) = (p^2 + (1+q)^2)/(p^2 + (1+q)^2) - (2p^2)/(p^2 + (1+q)^2)}}}
{{{cos(2(a+B)) = (-p^2 + (1+q)^2)/(p^2 + (1+q)^2)}}}