Trigonometric Identity involving sin()+cos()

In summary: Hence, the same argument goes through.In summary, the 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)## is valid for all values of ##a## and ##b##, and can be used to simplify equations involving trigonometric functions. However, it is important to be mindful of the signs of ##a## and ##b## when applying this identity, as it can affect the overall result.
  • #1
erobz
Homework Helper
Gold Member
3,634
1,511
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
  • #2
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 erobz and topsquark
  • #3
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 erobz, PeroK and topsquark
  • #4
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 topsquark and erobz
  • #6
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
 
  • #7
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 topsquark
  • #8
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 topsquark
  • #9
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 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 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 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 FactChecker and erobz

1. What is the trigonometric identity involving sin()+cos()?

The trigonometric identity involving sin()+cos() is known as the Pythagorean identity, which states that sin2(x) + cos2(x) = 1. This identity is derived from the Pythagorean theorem in geometry.

2. How is the Pythagorean identity used in trigonometry?

The Pythagorean identity is used to simplify trigonometric expressions by replacing either sin2(x) or cos2(x) with 1 - cos2(x) or 1 - sin2(x), respectively. This allows for easier evaluation of trigonometric functions and solving trigonometric equations.

3. Can the Pythagorean identity be extended to other trigonometric functions?

Yes, the Pythagorean identity can be extended to other trigonometric functions such as secant, cosecant, and tangent. For example, sec2(x) = 1 + tan2(x) and csc2(x) = 1 + cot2(x). These identities are derived from the Pythagorean identity and the definitions of these trigonometric functions.

4. How is the Pythagorean identity related to the unit circle?

The Pythagorean identity is related to the unit circle because it can be used to find the values of sine and cosine for any angle on the unit circle. The radius of the unit circle is always 1, so when substituted into the Pythagorean identity, the equation becomes sin2(θ) + cos2(θ) = 1, where θ is the angle on the unit circle.

5. Can the Pythagorean identity be used to prove other trigonometric identities?

Yes, the Pythagorean identity can be used to prove other trigonometric identities by manipulating the equation and substituting in other trigonometric identities. For example, the double angle identities for sine and cosine can be derived from the Pythagorean identity.

Similar threads

Replies
15
Views
2K
Replies
5
Views
950
  • General Math
Replies
5
Views
823
  • General Math
Replies
2
Views
726
  • General Math
Replies
2
Views
638
Replies
13
Views
1K
  • General Math
Replies
7
Views
953
Replies
1
Views
9K
  • Introductory Physics Homework Help
Replies
10
Views
263
  • Introductory Physics Homework Help
Replies
4
Views
224
Back
Top