Trigonometric Identity involving sin()+cos()

Click For Summary
SUMMARY

The discussion centers on the application of the trigonometric identity $$ a \cos ( \omega t ) + b \sin ( \omega t ) = \sqrt{a^2+b^2} \cos ( \omega t - \phi )$$, specifically in the context of the equation $$ x(t) = -\frac{g}{ \omega^2} \cos ( \omega t) + \frac{v_o}{ \omega } \sin ( \omega t ) + \frac{g}{ \omega^2} $$. The participants identify that the angle $$\phi$$, defined as $$\tan^{-1} \left( \frac{b}{a} \right)$$, must account for the signs of $$a$$ and $$b$$, leading to the correction that $$\phi$$ should be expressed as $$sgn(a) \tan^{-1} \left( \frac{b}{a} \right)$$. This adjustment resolves discrepancies in plotting the function, emphasizing the importance of quadrant considerations in trigonometric identities.

PREREQUISITES
  • Understanding of trigonometric identities, specifically linear combinations of sine and cosine.
  • Familiarity with the concept of phase angle and its calculation.
  • Knowledge of the atan2 function and its significance in determining angles in different quadrants.
  • Basic principles of harmonic motion and its mathematical representation.
NEXT STEPS
  • Research the use of the atan2 function for angle calculations in programming.
  • Study the derivation and applications of trigonometric identities in physics.
  • Explore the implications of phase shifts in harmonic motion analysis.
  • Examine common pitfalls in applying trigonometric identities, particularly regarding sign conventions.
USEFUL FOR

Students and professionals in physics, engineering, and mathematics who are working with harmonic motion and trigonometric identities, as well as anyone interested in improving their understanding of phase angles and their applications in real-world scenarios.

erobz
Gold Member
Messages
4,459
Reaction score
1,846
I'm trying to use the following trigonometric identity:

$$ a \cos ( \omega t ) + b \sin ( \omega t ) = \sqrt{a^2+b^2} \cos ( \omega t - \phi )$$ Where ##\phi = \tan^{-1} \left( \frac{b}{a} \right)## for the following equation:

$$ x(t) = -\frac{g}{ \omega^2} \cos ( \omega t) + \frac{v_o}{ \omega } \sin ( \omega t ) + \frac{g}{ \omega^2} $$

When I apply the identity I get:

##a = -\frac{g}{ \omega^2}##
##b = \frac{v_o}{ \omega }##
##\phi = \tan^{-1} \left( \frac{-v_o \omega}{g} \right)##

$$ X(t) = \sqrt{\left( \frac{g}{ \omega^2} \right)^2+\left( \frac{v_o}{ \omega } \right)^2} \cos \left( \omega t - \tan^{-1} \left( \frac{-v_o \omega}{g} \right) \right) + \frac{g}{ \omega^2} $$

However, on a plot they are not matching up...What am I doing wrong?

Mass-Spring Oscillator.JPG
 
Mathematics news on Phys.org
I suspect it may be related to the fact that
##\phi = \tan^{-1} \left( \frac{b}{a} \right)## can't distinguish ##\frac{b}{a}## from ##\frac{-b}{-a}##.
Try https://en.wikipedia.org/wiki/Atan2
or add ##\pi## to the result of ##\tan^{-1}## if the x-component is negative.
 
  • Like
Likes   Reactions: erobz and topsquark
You can see from your original equation that CORRECTION the right-hand side is the same no matter what the signs of ##a## and ##b## are, whereas the left-hand side is different when a sign of ##a## or ##b## changes. Your plot of the right-hand side is correct for a positive ##a##, but your example has a negative ##a=-g/\omega^2##.
CORRECTION: I overlooked that ##\phi## of the right-hand side depends on the signs of ##a## and ##b##.
 
Last edited:
  • Like
Likes   Reactions: erobz, PeroK and topsquark
erobz said:
I'm trying to use the following trigonometric identity:

$$ a \cos ( \omega t ) + b \sin ( \omega t ) = \sqrt{a^2+b^2} \cos ( \omega t - \phi )$$ Where ##\phi = \tan^{-1} \left( \frac{b}{a} \right)## for the following equation:
This is not quite right. According to Wikipedia, it should be:
$$ a \cos ( \omega t ) + b \sin ( \omega t ) = sgn(a) \sqrt{a^2+b^2} \cos ( \omega t - \phi )$$ Where ##\phi = \tan^{-1} \left( \frac{b}{a} \right)##.

https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Linear_combinations
 
  • Like
Likes   Reactions: topsquark and erobz
I read the identity from my Mechanical Measurements Text:

Perhaps they are assuming something about ##A,B##, but I don't see it anywhere.

IMG_1739.jpg
 
erobz said:
I read the identity from my Mechanical Measurements Text:

Perhaps they are assuming something about ##A,B##, but I don't see it anywhere.

View attachment 315809
If ##A## is taken to be the amplitude (##y(0) = A##), then tacitly ##A > 0##.
 
  • Like
Likes   Reactions: topsquark
FactChecker said:
You can see from your original equation that CORRECTION the right-hand side is the same no matter what the signs of ##a## and ##b## are, whereas the left-hand side is different when a sign of ##a## or ##b## changes. Your plot of the right-hand side is correct for a positive ##a##, but your example has a negative ##a=-g/\omega^2##.
CORRECTION: I overlooked that ##\phi## of the right-hand side depends on the signs of ##a## and ##b##.
You were right if you looked at the case where ##t = 0##, as ##\cos## is positive on the range of ##\tan^{-1}##, which is ##(-\frac \pi 2, \frac \pi 2)##:
$$a = \sqrt{a^2 + b^2}\cos(-\phi) = \sqrt{a^2 + b^2}\cos(\phi)> 0$$
 
  • Like
Likes   Reactions: topsquark
PeroK said:
If ##A## is taken to be the amplitude (##y(0) = A##), then tacitly ##A > 0##.
But wouldn't the amplitude be ##\sqrt{ A^2 + B^2}## ?
 
  • Like
Likes   Reactions: topsquark and PeroK
  • #10
erobz said:
But wouldn't the amplitude be ##\sqrt{ A^2 + B^2}## ?
That's true. The important thing is to remember the mathematical pitfall you uncovered here. It's possible the book's author overlooked it.
 
  • Like
Likes   Reactions: topsquark and erobz
  • #11
First, assume ##a > 0## and let ##\phi = \tan^{-1}\big (\frac b a \big )##. Note that ##-\frac \pi 2 < \phi < \frac \pi 2##. Hence: ##\cos \phi > 0## and ##\sin \phi## has the same sign as ##b##. We have:
$$\cos(x - \phi) = \cos x \cos \phi + \sin x \sin \phi$$Where
$$\cos \phi = \sqrt{\cos^2 \phi} = \frac 1 {\sqrt{\sec^2 \phi}} = \frac 1 {\sqrt{1 + \tan^2 \phi}} = \frac 1 {\sqrt{1 + \frac{b^2}{a^2}}} = \frac{a}{\sqrt{a^2 + b^2}}$$And:
$$\sin \phi = sgn(b) \sqrt{\sin^2 \phi} = sgn(b) \sqrt{1 - \cos^2 \phi} = sgn(b)\sqrt{1 - \frac{1}{\sec^2 \phi}}$$$$ = sgn(b)\sqrt{\frac{b^2}{a^2 + b^2}} = \frac{b}{\sqrt{a^2+b^2}}$$Hence, for ##a > 0## we have:
$$\cos(x - \phi) = \frac 1 {\sqrt{a^2 + b^2}}\big(a\cos x + b\sin x\big)$$And$$a\cos x + b\sin x = \sqrt{a^2 + b^2}\cos(x - \phi)$$Finally, if ##a < 0##, then:
$$a\cos x + b\sin x = -\big((-a)\cos x + (-b)\sin x \big ) = -\sqrt{a^2 + b^2}\cos(x - \phi)$$Where ##\phi = \tan^{-1}\big(\frac{-b}{-a} \big) = \tan^{-1}\big(\frac{b}{a} \big)##
 
  • Like
Likes   Reactions: erobz and topsquark
  • #12
It is really common for people to be sloppy when they say ##\phi = tan^{-1}(b/a)##. As others have said, there are sign issues depending on which quadrant you are in. When things seem wrong always look at a sketch in the complex plane first. This is why all (good) programming libraries have the atan2 function. Also, beware, you'll see this mistake again, from yourself or others.
 
  • Like
Likes   Reactions: FactChecker and erobz

Similar threads

  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 1 ·
Replies
1
Views
11K
  • · Replies 10 ·
Replies
10
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K