# cos2x

• Feb 27th 2010, 01:46 AM
Lloyd78
cos2x
Hello,

So I want to evaluate cos(2x) in c. Using Trigonometric Identities:

cos(2x) = cos^2(x) - sin^2(x) = 2 cos^2(x) - 1 = 1 - 2 sin^2(x)

Where:

cos(2x) = 1 - 2 sin^2(x)

However:

sin^2(x) = 1/2 - 1/2 cos(2x)

So is this like the chicken and the egg?

Using sin^2(x) to evaluate cos(2x) which needs sin^2(x). I only have access to the basic functions cos, sin etc and I was hoping to evaluate cos(2x) using a combination of these.

Or is cos(2x) simply the cosine of twice the angle. I have only recently returned from a long hiatus from the world of mathematics so please forgive me if the solution is glaringly obvious. Any help would be greatly appreciated.

Cheers,

Lloyd.
• Feb 27th 2010, 02:41 AM
tonio
Quote:

Originally Posted by Lloyd78
Hello,

So I want to evaluate cos(2x) in c. Using Trigonometric Identities:

cos(2x) = cos^2(x) - sin^2(x) = 2 cos^2(x) - 1 = 1 - 2 sin^2(x)

Where:

cos(2x) = 1 - 2 sin^2(x)

However:

sin^2(x) = 1/2 - 1/2 cos(2x)

So is this like the chicken and the egg?

Using sin^2(x) to evaluate cos(2x) which needs sin^2(x). I only have access to the basic functions cos, sin etc and I was hoping to evaluate cos(2x) using a combination of these.

Or is cos(2x) simply the cosine of twice the angle. I have only recently returned from a long hiatus from the world of mathematics so please forgive me if the solution is glaringly obvious. Any help would be greatly appreciated.

Cheers,

Lloyd.

I don't understand what's the problem: $\sin^2x$ is a basic function raised to the second power!
And yes: $\cos 2x$ is just the value of cosine of twice the angle x.
Mathematics is a jealous lover: if you keep away from it a long time it gets its revenge by making your life tough when you want to come back to it.

Tonio
• Feb 27th 2010, 04:43 AM
e^(i*pi)
Quote:

Originally Posted by Lloyd78

Or is cos(2x) simply the cosine of twice the angle.
Lloyd.

Bingo!

$\cos(2x) = \cos(x+x)$

Of course to evaluate it it will need to be equal to something (Rofl)

If you're doing calculus (as the forum would imply you are) then it's nearly always easier to manipulate $\cos(2x)$ than $1-2\sin ^2(x)$ or $2 \cos ^2(x) - 1$
• Feb 27th 2010, 05:00 AM
HallsofIvy
What do you mean by "evaluate cos(2x) in c"? In particular, what is "c"?

The programming language? Since C has sine and cosine functions just "cos(2*x)" is simplest.

The complex numbers? $cos(x)= \frac{e^{ix}+ e^{-ix}}{2}$
• Feb 28th 2010, 01:44 AM
Lloyd78
Cheers guys!

Yeah the programming language c. Had a feeling I might be asking the obvious. Being the cosine of twice the angle does make life a lot easier. Hangs head... (Itwasntme)

Thanks again!