Enter the coefficients a and b of the expression a sin θ + b cos θ. The formula below is linked to the input fields, so you can also edit the coefficients in it directly.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and graphs
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Rewrites an expression of the form \(a\sin\theta + b\cos\theta\) as a single sine wave \(R\sin(\theta + \alpha)\) (harmonic addition)
- The amplitude \(R = \sqrt{a^{2} + b^{2}}\) is shown both as a simplified exact value such as \(\sqrt{2}\) and as a decimal. The angle \(\alpha\) is shown as an exact fraction of π when it is a special angle such as \(\dfrac{\pi}{4}\). Otherwise it is shown by the exact values of \(\cos\alpha\) and \(\sin\alpha\), with approximate values in radians and degrees
- The cosine form \(R\cos(\theta - \beta)\) is shown too (when to use which form is explained below)
- Also finds the maximum \(R\) and the minimum \(-R\) and the values of \(\theta\) where they occur (a classic exam question)
- Coefficients can be whole numbers, decimals, fractions, or values with square roots such as √3 or √3/2. A graph shows the two original waves, the combined wave and its amplitude
What is this calculation used for?
The alternating current at a household outlet in the US is a voltage that swings back and forth as a sine wave 60 times a second. In circuit calculations, coils and capacitors shift the waves, and their sum appears in the form \(a\sin\theta + b\cos\theta\). Combining it tells you what single wave you really have: its amplitude (the peak voltage) and how far its phase is shifted.
This calculation is a standard part of electrical engineering courses and exams such as the FE (Fundamentals of Engineering) exam.
Sound is a wave of vibrating air. When two sounds of the same pitch (the same frequency) overlap, the sum of their wave equations combines into one wave. The larger the combined amplitude \(R\), the louder the sound. When the waves are in step (in phase), they reinforce each other. When they are opposite, they cancel out.
Noise-canceling headphones reduce noise by playing a wave opposite to the noise, which is based on this idea of adding waves.
When analyzing earthquakes or machine vibrations, engineers often split the motion into a sine part and a cosine part, calculate each, and combine them at the end to find the actual size of the shaking (the amplitude). When the motion can be treated as a simple vibration with one period, the largest movement is estimated as the combined amplitude \(R\).
Real earthquake waves are a complex mix of many periods, but the basis of their analysis is this adding of sine waves.
A smartphone receives the radio wave that comes straight from the cell tower overlapped with waves reflected off buildings and other objects. Waves of the same frequency combine into one wave, and depending on the difference in their paths they reinforce or weaken each other (this is called fading).
Moving just a little can change the number of signal bars because this combined amplitude is different from place to place.
Formulas and graphs
Symbols and terms
Symbols
| \(a,\ b\) | a, b | The coefficients of the expression. \(a\) is the number in front of \(\sin\theta\), and \(b\) is the number in front of \(\cos\theta\). By custom, letters from the start of the alphabet, \(a,\ b,\ c\), are used for fixed numbers. |
| \(\theta\) | theta | A Greek letter often used for angles. It is not the Greek word for "angle"; it simply became the custom to use it for angles. On this page, it is the angle that varies in the expression. |
| \(R\) | R | The amplitude (height) of the combined sine wave. The letter is said to come from "radius". It equals \(\sqrt{a^{2} + b^{2}}\), the distance from the origin to the point \((a,\ b)\), and it is the maximum value of the expression. |
| \(\alpha\) | alpha | The angle of the shift in the sine form. It is the first letter of the Greek alphabet, following the custom of naming extra angles with Greek letters. It equals the angle between the \(x\)-axis and the arrow from the origin to the point \((a,\ b)\). |
| \(\beta\) | beta | The angle of the shift in the cosine form, the second letter of the Greek alphabet. \(\beta = \dfrac{\pi}{2} - \alpha\) (angles that differ by \(2\pi\), one full turn, are in the same position, so \(2\pi\) may be added or subtracted to keep \(-\pi < \beta \le \pi\)). |
| \(\sin\) | sine | One of the trig functions, short for sine. On the unit circle, \(\sin\theta\) is the \(y\)-coordinate of the point at angle \(\theta\). |
| \(\cos\) | cosine | One of the trig functions, short for cosine. On the unit circle, \(\cos\theta\) is the \(x\)-coordinate of the point at angle \(\theta\). |
| \(\pi\) | pi | Pi (about 3.14). In radians, \(\pi\) is exactly 180°, so \(\dfrac{\pi}{4}\) is 45° and \(\dfrac{\pi}{6}\) is 30°. |
| \(2n\pi\) | two n pi | A way to write "an integer multiple of \(2\pi\) (one full turn)". \(n\) is an integer (from "number"). An angle comes back to the same position after every full turn (\(2\pi\)), so there are infinitely many \(\theta\) that give the maximum or minimum, spaced \(2\pi\) apart. |
| \(\sqrt{\phantom{2}}\) | square root | The square root sign (radical sign). \(\sqrt{2}\) is the positive number whose square is 2. It appears in the amplitude \(R = \sqrt{a^{2} + b^{2}}\). |
| \(\le\) | less than or equal to | The inequality sign for "less than or equal to". \(-R \le f(\theta) \le R\) means that \(f(\theta)\) is at least \(-R\) and at most \(R\). |
Terms
| harmonic addition | Rewriting an expression of the form \(a\sin\theta + b\cos\theta\) as one sine wave \(R\sin(\theta + \alpha)\). It works by using the angle addition formula backward. In the US, it usually comes up in Precalculus, often without a special name ("write as a single sine function"). |
| sine wave | A wave that rises and falls smoothly again and again, like the graph of \(y = \sin\theta\). Also called a sinusoid. Many waves around us, such as sound, light and alternating current, have this shape. |
| amplitude | The "height" of a wave: the distance from the center of the wave (0 on this page) to its highest point. The amplitude of \(y = R\sin(\theta + \alpha)\) is \(R\), and the wave swings between \(-R\) and \(R\). |
| period | The length it takes a wave to complete one full cycle and start over. The period of \(\sin\theta\) is \(2\pi\) (360°), and combining does not change it. |
| phase shift | How far a wave is shifted sideways. \(R\sin(\theta + \alpha)\) is the wave \(R\sin\theta\) shifted \(\alpha\) to the left, and this shift is called the phase shift. |
| angle addition formula | A formula such as \(\sin(\theta + \alpha) = \sin\theta\cos\alpha + \cos\theta\sin\alpha\) that writes a trig function of a sum of two angles in terms of trig functions of each angle. Also called the sum formula. Harmonic addition uses it backward, from right to left. |
| special angle | An angle such as \(30°\) (\(\dfrac{\pi}{6}\)), \(45°\) (\(\dfrac{\pi}{4}\)) or \(60°\) (\(\dfrac{\pi}{3}\)) whose trig values are simple exact values such as \(\dfrac{1}{2}\) or \(\dfrac{\sqrt{3}}{2}\). Textbook and exam problems on this topic are almost always built so that \(\alpha\) is a special angle. |
| radian | The unit that measures an angle by the arc length on a circle of radius 1. \(180° = \pi\) radians, so \(45°\) is \(\dfrac{\pi}{4}\). For trig functions from Precalculus on, radians are standard rather than degrees. |
| unit circle | The circle of radius 1 centered at the origin. The point on it at angle \(\theta\) has coordinates \((\cos\theta,\ \sin\theta)\), which makes it a tool for seeing the values of trig functions. |
| maximum | The largest value a function can take. In \(R\sin(\theta + \alpha)\), the sine goes no higher than \(1\), so the maximum \(R\) is clear right away. |
| minimum | The smallest value a function can take. In \(R\sin(\theta + \alpha)\), the sine goes no lower than \(-1\), so the minimum \(-R\) is clear right away. |
| quadrant | One of the four regions the \(x\)-axis and \(y\)-axis divide the coordinate plane into. The upper right is Quadrant I, and Quadrants II, III and IV follow counterclockwise. Which quadrant the angle (the point on the unit circle) is in decides the signs of \(\cos\) and \(\sin\). |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to these topics is the fastest way forward.
| Working with square roots (Grade 8 and Algebra 1) |
|
| The Pythagorean theorem (Grade 8) |
|
| Right triangle trigonometry (Geometry) |
|
| The unit circle and radians (Algebra 2 and Precalculus) |
|
| Graphs of trig functions (Algebra 2 and Precalculus) |
|
| Angle addition formulas (Precalculus) |
|
How to calculate it in Excel
| Coefficient a of sin θ | 1 |
| Coefficient b of cos θ | 1 |
| Amplitude R | =SQRT(B1^2+B2^2) |
| Angle α (radians) | =ATAN2(B1,B2) |
| Angle α (degrees) | =DEGREES(B4) |
| Coefficient a of sin θ | 1 |
| Coefficient b of cos θ | 1 |
| Amplitude R | =SQRT(B1^2+B2^2) |
| Angle β (radians) | =ATAN2(B2,B1) |
| Angle β (degrees) | =DEGREES(B4) |
| Coefficient a of sin θ | 3 |
| Coefficient b of cos θ | 4 |
| Amplitude R | =SQRT(B1^2+B2^2) |
| Maximum | =B3 |
| Minimum | =-B3 |
| θ of the maximum (radians) | =PI()/2-ATAN2(B1,B2) |
"^" is a power, SQRT is the square root, and ATAN2(x, y) returns the angle in the direction of the point (x, y). α is the direction of the point (a, b), so it is =ATAN2(B1,B2), while β is the direction of the point (b, a), so it is =ATAN2(B2,B1). Watch out for the swapped order of the arguments.
The first table is for sin θ + cos θ: R is 1.41421… (= √2) and α is 0.78539… (= π/4) = 45°.
The third table is for 3 sin θ + 4 cos θ: the maximum is 5, the minimum is −5, and the maximum occurs at θ = 0.64350… (radians).
How to calculate it in Google Sheets
| Coefficient a of sin θ | 1 |
| Coefficient b of cos θ | 1 |
| Amplitude R | =SQRT(B1^2+B2^2) |
| Angle α (radians) | =ATAN2(B1,B2) |
| Angle α (degrees) | =DEGREES(B4) |
| Coefficient a of sin θ | 1 |
| Coefficient b of cos θ | 1 |
| Amplitude R | =SQRT(B1^2+B2^2) |
| Angle β (radians) | =ATAN2(B2,B1) |
| Angle β (degrees) | =DEGREES(B4) |
| Coefficient a of sin θ | 3 |
| Coefficient b of cos θ | 4 |
| Amplitude R | =SQRT(B1^2+B2^2) |
| Maximum | =B3 |
| Minimum | =-B3 |
| θ of the maximum (radians) | =PI()/2-ATAN2(B1,B2) |
How to calculate it in Python
import math
sin_coefficient = 1 # a (coefficient of sin θ)
cos_coefficient = 1 # b (coefficient of cos θ)
# Amplitude R = √(a² + b²) (hypot returns the square root of the sum of squares)
amplitude = math.hypot(sin_coefficient, cos_coefficient)
# Angle α (the direction of the point (a, b), in radians)
alpha = math.atan2(cos_coefficient, sin_coefficient)
print(f"Amplitude R = {amplitude}")
print(f"Angle α = {alpha} radians = {math.degrees(alpha)} degrees")
print(f"Maximum = {amplitude}, minimum = {-amplitude}")
print(f"θ of the maximum = {math.pi / 2 - alpha} radians (+ 2nπ)")
How to write it in LaTeX and other math languages (copy and paste)
a·sinθ + b·cosθ = R·sin(θ + α)
a\sin\theta + b\cos\theta = R\sin(\theta + \alpha)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>a</mi><mo>⁢</mo><mi>sin</mi><mo>⁡</mo><mi>θ</mi>
<mo>+</mo>
<mi>b</mi><mo>⁢</mo><mi>cos</mi><mo>⁡</mo><mi>θ</mi>
<mo>=</mo>
<mi>R</mi><mo>⁢</mo><mi>sin</mi><mo>⁡</mo>
<mo>(</mo><mi>θ</mi><mo>+</mo><mi>α</mi><mo>)</mo>
</mrow>
</math>
a sin(theta) + b cos(theta) = R sin(theta + alpha)
a Sin[t] + b Cos[t] == Sqrt[a^2 + b^2] Sin[t + ArcTan[a, b]]
a*sin(theta) + b*cos(theta) = sqrt(a^2 + b^2)*sin(theta + arctan(b, a));
R = sqrt(a^2 + b^2); alpha = atan2(b, a); f = R*sin(theta + alpha);
a sin(θ) + b cos(θ) = R sin(θ + α)
R = √(a² + b²), cosα = a/R, sinα = b/R
R = \sqrt{a^{2} + b^{2}},\quad \cos\alpha = \frac{a}{R},\quad \sin\alpha = \frac{b}{R}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>R</mi><mo>=</mo>
<msqrt><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup></mrow></msqrt>
<mo>,</mo>
<mi>cos</mi><mo>⁡</mo><mi>α</mi><mo>=</mo>
<mfrac><mi>a</mi><mi>R</mi></mfrac>
<mo>,</mo>
<mi>sin</mi><mo>⁡</mo><mi>α</mi><mo>=</mo>
<mfrac><mi>b</mi><mi>R</mi></mfrac>
</mrow>
</math>
R = sqrt(a^2 + b^2), cos(alpha) = a/R, sin(alpha) = b/R
R = Sqrt[a^2 + b^2]; alpha = ArcTan[a, b]
R := sqrt(a^2 + b^2); alpha := arctan(b, a);
R = sqrt(a^2 + b^2); alpha = atan2(b, a);
R = √(a^2 + b^2), cos(α) = a/R, sin(α) = b/R
−R ≤ a·sinθ + b·cosθ ≤ R
-R \le a\sin\theta + b\cos\theta \le R
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mo>−</mo><mi>R</mi>
<mo>≤</mo>
<mi>a</mi><mo>⁢</mo><mi>sin</mi><mo>⁡</mo><mi>θ</mi>
<mo>+</mo>
<mi>b</mi><mo>⁢</mo><mi>cos</mi><mo>⁡</mo><mi>θ</mi>
<mo>≤</mo>
<mi>R</mi>
</mrow>
</math>
-R <= a sin(theta) + b cos(theta) <= R
MaxValue[a Sin[t] + b Cos[t], t]
maximize(a*sin(theta) + b*cos(theta), theta = 0 .. 2*Pi);
[tmin, fneg] = fminbnd(@(t) -(a*sin(t) + b*cos(t)), 0, 2*pi); fmax = -fneg;
−R ≤ a sin(θ) + b cos(θ) ≤ R
How to have ChatGPT do the calculation
You are a math calculation assistant for trigonometric functions. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). Write 3 sin θ + 4 cos θ in the form R sin(θ + α). Show each of the following: 1. The amplitude R (also as an exact value with a square root, if it can be written that way) 2. The values of cos α and sin α (as fractions), and approximate values of α (both in radians and degrees) 3. The maximum and minimum of this expression, and the θ where it is largest (in radians) In Python, use math.hypot and math.atan2. Show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
