News for hackers. Stuff that matters.
Re:Obsolete trig functions and why we don't use them anymore... by benrbray on Thursday December 03, 2020 @06:18AM (#25287804)
Let me teach you a secret: You don't need to memorize any trig identities, you just need to know Euler's formula and one or two more facts:

    exp(ix) = cos(x) + i*sin(x)
    [cos(x)]^2 + [sin(x)]^2 = 1
    i*i = -1
That is, the complex number exp(ix), which lies on the unit circle in the complex plane, has real component cos(x) and imaginary component sin(x). Consequently, the line from 0 to exp(ix) in the complex plane makes an angle of x radians with the real axis.

Any complex number can be written as an exponent like rexp(ix), where x is the angle and r is the distance from the origin in the complex plane. Using this understanding, we can interpret complex number multiplication as a rotation in the complex plane:

    (a * exp(ix)) * (b * exp(iy)) = ab * exp(i (x+y))
Ok, the above was a digression, let's get to the trig identities. Let's derive the double angle formula. We can start with the point on the unit circle representing an angle of 2x, and use Euler's formula to simplify it one way:

    exp(i*2x) = cos(2x) + i * sin(2x)
Ok, we can also use the fact that a^(bc) = (a^b)^c to write the same expression a different way, then FOIL it:

    exp(i*2x) = [exp(i*x)]^2
    = [cos(x) + i*sin(x)]^2
    = [cos(x)]^2 + (i*i)*[sin(x)]^2 + 2i * cos(x) * sin(x)
    = [cos(x)]^2 - [sin(x)]^2 + 2i * cos(x) * sin(x)
Now, comparing the two expressions, we see that

    cos(2x) + i * sin(2x) = [cos(x)]^2 - [sin(x)]^2 + 2i * cos(x) * sin(x)
Taking real and imaginary parts of both sides, we find that:

    cos(2x) = [cos(x)]^2 - [sin(x)]^2
    sin(2x) = 2 * cos(x) * sin(x)
This works for most identities you want to derive, and there is a variation for things like cosh and sinh. This trick came in handy on calc 3 exams whenever I couldn't remember the silly trig identities that were required to perform integrals.
Re:Obsolete trig functions and why we don't use them anymore... by seanc on Thursday December 03, 2020 @10:53AM (#25290056)
The trouble is that it is rare that trig identities are used for simplifying computations.

Most often they are used for simplifying expressions. For that purpose it's not a matter of deducing what they are, but recognizing them in the expression, and spotting the opportunity to use the identity on the path to eliminating terms.

For that purpose one needs to have them memorized in order to spot the opportunity -on the carefully derived homework problem- in the wild.

Re:Obsolete trig functions and why we don't use them anymore... by benrbray on Thursday December 03, 2020 @10:59AM (#25290147)
I generally just know that any trig formula can be converted to quite a few different other ones visa trig identities. Whether a certain expression is more or less complex than another is a matter of perspective and context.

If I'm stuck with a trig function I don't know what to do with, I just look on Wikipedia for a trig identity and don't worry about derivations or memorization.

This trick is good for exam settings though! My memory is terrible so I always relied on tricks like this in school

Re:Obsolete trig functions and why we don't use them anymore... by lopmotr on Thursday December 03, 2020 @11:58AM (#25291079)
What kind of exam requires you to memorize trig identities? Were they trying to prepare you for a world without paper or computers to look them up on? Or to be a smidgen faster at hand calculations?
Re:Obsolete trig functions and why we don't use them anymore... by jacobolus on Thursday December 03, 2020 @01:14PM (#25292322)
> Were they trying to prepare you for a world without paper or computers

Yes, most high schools spend a few months teaching “trigonometry” as a system for simplifying formulas that was primarily useful historically to save time for human calculators working with pen/paper and a printed lookup table. In the modern world this is entirely anachronistic and the content could be profitably compressed down to a couple weeks, with the saved time spent on something else. The main remaining utility is as rather cumbersome, unpleasant, and unenlightening algebra practice.

Re:Obsolete trig functions and why we don't use them anymore... by gmadsen on Friday December 04, 2020 @10:20AM (#25303194)
I think it would be enlightening but rarely done in school, is focus on the geometry of it and how the relationships are connected, such as https://math.wikia.org/wiki/Unit_circle?file=Unit_circle_ind...
Re:Obsolete trig functions and why we don't use them anymore... by lynndotpy on Thursday December 03, 2020 @02:44PM (#25293654)
I always understood the memorization part as a stopgap to truly understanding them.

In the same sense that doing this work by hand will build depth of understanding, I know that remembering the trig identities came before really understanding their relationships. And that also came far before I could truly understand Euler's formula, radians, etc.

Re:Obsolete trig functions and why we don't use them anymore... by immmmmm on Thursday December 03, 2020 @06:45AM (#25287958)
As the math teacher at the first year of university once said:

"i know two things:

[cos(x)]^2 + [sin(x)]^2 = 1

i*i = -1

but can re-derive all the rest"

Re:Obsolete trig functions and why we don't use them anymore... by lrmunoz on Thursday December 03, 2020 @07:41AM (#25288273)
My math teacher was in love with the Euler's identity written like this: 1+e^(i*pi) = 0

He said it relates the most important numbers and constants of the universe. He had it embroidered and framed on his office wall

Re:Obsolete trig functions and why we don't use them anymore... by jacobolus on Thursday December 03, 2020 @01:20PM (#25292419)
“Euler’s identity” is a flashy way of stating that a half-turn rotation in the plane is equivalent to a reflection across the center of rotation. This is a fact which can be easily understood by young children.

The part that makes the expression flashy is that the rotation is written via its logarithm, which can be represented as the length of a circular arc (“angle measure”).

It’s a useful fact to know, but is vastly overrated.

Re:Obsolete trig functions and why we don't use them anymore... by MayeulC on Thursday December 03, 2020 @10:03AM (#25289467)
Well, as far as I know, cosinus and sinus have relatively little to do with exponential and imaginary numbers, just like imaginary numbers have intrinsically little to do with the 2D plane. I just think of it as a convenient notation since those obey similar composition rules (that probably stem from their odd and even-ness, and taylor series decomposition from there).

So you need at least that one, since it is by convention, and not really derivable[1]:

    exp(ix) = cos(x) + i*sin(x)
I personally just use Euler's notation (using exp) as a tool to derive trig formulas, since I know power composition rules quite well already, and those tend to be more useful in general.

   [cos(x)]^2 + [sin(x)]^2 = 1
Is just the Pythagorean theorem on a unit circle, which also defines sin and cos :)

[1] OK, you can look at the taylor series expansion, but you need to remember the derivatives for this.

Re:Obsolete trig functions and why we don't use them anymore... by dragontamer on Thursday December 03, 2020 @10:36AM (#25289819)
cos(x) and sin(x) are just the unit circles applied over the 2-dimesnional real + imaginary axis.

Because x^2 + y^2 = 1 defines a unit circle, if you perform x^2 + i * y^2 = 1, you get a unit circle over the real/imaginary planes.

Or to put it in a picture: https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Eu...

Remember the definition of sin / cos: https://upload.wikimedia.org/wikipedia/commons/b/bd/Sine_and...

-------

Once you realize that "the imaginary axis" is just an arbitrary 2-dimension extension field (and that "imaginary" is a very bad name for it), it becomes way easier to see.

-------

Now if you had a 3-dimension graph (real, imaginary, and time), and then you project the unit-circle over the real + time axis, you get a sin (or cos) respectively.

-----------

Or to put it another way: there's a periodic nature of i:

* i = i

* i^2 = -1

* i^3 = -i

* i^4 = 1 -- Cycle-length 4

* i^5 = i

* i ^ x = i^(x mod 4) (In general)

This period itself forms a circle, moving from real-to-imaginary and back. (e^i^x) = (e^(ix)) therefore is periodic as well. And the most natural periodic cycle is a circle (which is of course, just sin/cos).

To make this "period 4" into a proper circle, multiply by pi/2.

i^(pi/2)^x == period 3.141592.... or the "circumference" of the unit circle.

e^i^(pi/2)^x == e^(i * pi/2 * x). Done.

Re:Obsolete trig functions and why we don't use them anymore... by gmadsen on Thursday December 03, 2020 @10:37AM (#25289846)
how can you say imaginary numbers have intrinsically little to do with the 2D plane? it is entirely possible and equally correct to define imaginary numbers geometrically. It is nice and convenient that this is equivalent to the algebraic definition.
Re:Obsolete trig functions and why we don't use them anymore... by gmadsen on Friday December 04, 2020 @10:26AM (#25303276)
for anyone interested, a great text on this is https://www.amazon.com/Visual-Complex-Analysis-Tristan-Needh...
Re:Obsolete trig functions and why we don't use them anymore... by beervirus on Thursday December 03, 2020 @11:25AM (#25290524)
It's not just a convenient notation. Sine and cosine are intimately connected with exponentials and imaginary numbers.
Re:Obsolete trig functions and why we don't use them anymore... by amelius on Thursday December 03, 2020 @07:38AM (#25288252)
From these two facts, you can come to the conclusion that sin(x) == 0 and cos(x) == 1, for any x. I.e., you need to know more.
Re:Obsolete trig functions and why we don't use them anymore... by filmor on Thursday December 03, 2020 @08:57AM (#25288835)
No, you can't. You can come to the conclusion that if there exits an x with sin(x) = 0, then cos(x) = 1. The expression as it stands is true for every x \in R without any additional assumptions.
Re:Obsolete trig functions and why we don't use them anymore... by amelius on Thursday December 03, 2020 @09:37AM (#25289203)
Yes, I agree that was badly worded, but in any case you need more than those two equations to do anything meaningful with sin(x) and cos(x).
Re:Obsolete trig functions and why we don't use them anymore... by laszlokorte on Thursday December 03, 2020 @10:32AM (#25289783)
but you could conclude that cos and sin are both jsut the constant function: x->sqrt(0.5)
Re:Obsolete trig functions and why we don't use them anymore... by filmor on Saturday December 05, 2020 @01:07PM (#25316736)
Not at all, same reason.
Re:Obsolete trig functions and why we don't use them anymore... by eru on Thursday December 03, 2020 @07:24AM (#25288173)
Good luck deriving group theory from that. :)

(Though, yes, there's a bit of a connection with group theory, but not enough to help you.)

Re:Obsolete trig functions and why we don't use them anymore... by dragontamer on Thursday December 03, 2020 @10:46AM (#25289960)
Well, unit-circles over a finite field are a periodic "square". So you gotta redefine the norm from norm = sqrt(x^2 + y^2) into norm = max(x, y).

From there, you get extension fields from real vs imaginary already. (Ex: you can form a new extension field from x + y*j, where x and y are complex numbers), which forms a new periodic cycle.

I mean, deriving it all is hard because group theory is hard. I'm not sure if its because the tools "aren't there". Some super-AI or super-human probably can derive it all from those given facts.

Re:Obsolete trig functions and why we don't use them anymore... by eru on Friday December 04, 2020 @04:23AM (#25300505)
Yes, I know about the unit circle.

But that's just a way to embed some of group theory. It doesn't actually help you much.

(It's similar to how you can use eg set theory to construct the integers. It's possible, but doesn't actually help you prove anything about interesting about integers that you wouldn't have been able to prove without embedding them like this.)

> I mean, deriving it all is hard because group theory is hard. I'm not sure if its because the tools "aren't there". Some super-AI or super-human probably can derive it all from those given facts.

Yes, but that task wouldn't be made easier by this approach compared to starting from just the group theory axioms instead.

Re:Obsolete trig functions and why we don't use them anymore... by sriku on Thursday December 03, 2020 @10:09AM (#25289521)
You don't need to treat "[cos(x)]^2 + [sin(x)]^2 = 1" separately either.

e^(iθ) times e^(-iθ) = e^(iθ-iθ) = e^0 = 1 = (cosθ+isinθ)(cosθ-isinθ) = cos²θ + sin²θ

Re:Obsolete trig functions and why we don't use them anymore... by josephcsible on Thursday December 03, 2020 @11:03AM (#25290197)
Sure, this takes "[cos(x)]^2 + [sin(x)]^2 = 1" off the list, but doesn't it require you to put "cos(-x) = cos(x)" and "sin(-x) = -sin(x)" on it, to get "(cosθ-isinθ)" from "e^(-iθ)"?
Re:Obsolete trig functions and why we don't use them anymore... by evanb on Thursday December 03, 2020 @11:11AM (#25290315)
Only if you forget about how complex conjugation works. (e^-ix) = (e^ix)* = cos x - i sin x
Re:Obsolete trig functions and why we don't use them anymore... by sriku on Thursday December 03, 2020 @09:16PM (#25298165)
As indicated in the other reply, think of the minus as changing the sign of i instead of x.
Re:Obsolete trig functions and why we don't use them anymore... by matheusmoreira on Thursday December 03, 2020 @10:58AM (#25290126)
> This trick came in handy on calc 3 exams whenever I couldn't remember the silly trig identities that were required to perform integrals.

Why do people even have to memorize stuff like this? I simply don't understand what's wrong with referencing stuff you don't remember during a test. That's what we do in real life!

Re:Obsolete trig functions and why we don't use them anymore... by Chinjut on Thursday December 03, 2020 @11:27AM (#25290557)
You don't even need to think specifically about exp(ix) unless you're doing calculus and taking derivatives or antiderivatives. Just the fact that there's SOME base of exponentiation such that cos is the even component of exponentiation with this base and i * sin is the odd component of exponentiation with this base is enough for all these trig laws.

Incidentally, we can derive [cos(x)]^2 + [sin(x)]^2 = 1 from the fact that cos and i * sin are even and odd components of exponentiation with some base, like so: 1 = exp(ix) * exp(-ix) = (cos(x) + i * sin(x)) * (cos(x) - i * sin(x)) = [cos(x)]^2 + [sin(x)]^2.