When calculating simple harmonics, do you use sine or cosine?
Use this premium calculator to determine which form fits your starting conditions, compute displacement at any time, and visualize the motion. In simple harmonic motion, both sine and cosine are correct. The best choice depends on phase and the condition at time zero.
Your results will appear here
Enter values and click Calculate Harmonic Form to see whether sine or cosine is the most natural choice, along with displacement, velocity, period, angular frequency, and a live chart.
Expert guide: when calculating simple harmonics, do you use sine or cosine?
The short answer is simple: in simple harmonic motion, you can use either sine or cosine. They describe the same family of periodic motion. The only real difference is phase. If your motion starts at a maximum displacement when time equals zero, cosine is usually the cleanest choice. If your motion starts at zero displacement and moves upward, sine is usually the cleanest choice. Mathematically, both are equivalent because a sine wave is just a cosine wave shifted horizontally by one quarter of a cycle.
This matters because students often ask whether there is one correct formula for every harmonic motion problem. There is not. The truly general expression is: x(t) = A cos(ωt + φ) or, just as valid, x(t) = A sin(ωt + φ). Here, A is amplitude, ω is angular frequency, and φ is phase angle. Once phase is chosen correctly, either representation produces the same displacement, velocity, and acceleration. The skill is not memorizing one preferred trig function. The skill is matching the model to the initial conditions.
Why both functions work
Sine and cosine differ only by a phase shift of 90 degrees, or π/2 radians. That means: sin(θ) = cos(θ – π/2). So if a textbook writes simple harmonic motion with cosine and your instructor writes it with sine, those statements are not contradictory. They are simply expressing the same oscillation with different starting references on the cycle.
In physics, this is useful because many problems provide a starting position. If the oscillator is released from the farthest right position, then at time zero the displacement is maximum, the velocity is zero, and cosine is elegant because cos(0) = 1. If the oscillator passes through equilibrium at time zero moving in the positive direction, then sine is elegant because sin(0) = 0 and the slope starts positive.
The fastest rule to remember
- Use cosine when the motion starts at a maximum or minimum displacement.
- Use sine when the motion starts at zero displacement.
- Use either form with a phase angle when the starting condition is somewhere in between.
- If your answer matches the initial displacement and velocity, your choice is correct.
How initial conditions decide the function
Every simple harmonic motion problem is really an initial condition problem. The oscillator has some displacement at time zero and some velocity at time zero. Those two facts determine the phase. If you know both, the model is fixed.
| Initial condition at t = 0 | Most natural form | Equivalent phase in cosine form | Why it fits |
|---|---|---|---|
| x = +A, v = 0 | x(t) = A cos(ωt) | φ = 0 | Cosine begins at its positive peak. |
| x = 0, v positive | x(t) = A sin(ωt) | φ = -π/2 | Sine starts at zero and rises. |
| x = 0, v negative | x(t) = -A sin(ωt) | φ = +π/2 | The motion crosses equilibrium heading downward. |
| x = -A, v = 0 | x(t) = -A cos(ωt) | φ = π | Cosine begins at its negative peak after a half cycle shift. |
Understanding the physics behind the choice
In ideal simple harmonic motion, acceleration is proportional to displacement and opposite in direction: a = -ω²x. That equation does not mention sine or cosine directly, because both satisfy it. If you differentiate either representation twice, you get the same physical law. This is why the deeper answer is not “always use sine” or “always use cosine.” The deeper answer is “use the form that makes the initial condition transparent.”
For example, consider a mass on a spring released from rest after being pulled to the right. At release, displacement is positive and largest, and velocity is zero. A cosine model is immediately intuitive. Now consider the same mass passing through equilibrium at its highest speed. The displacement is zero at that instant, so a sine model is often more intuitive. The underlying motion is identical in type. Only the chosen zero point of time changes.
Step by step method for solving SHM problems correctly
- Identify the amplitude A.
- Determine frequency f or period T, then compute angular frequency using ω = 2πf = 2π/T.
- Read the initial displacement and initial velocity at time zero.
- Choose sine or cosine based on what makes the starting condition easiest to represent.
- Add phase angle φ if the motion does not start at a peak or a zero crossing.
- Check your formula by plugging in t = 0.
- Differentiate if you need velocity or acceleration.
Real comparison data: common periodic systems and quarter cycle timing
One practical way to understand phase is to think in terms of quarter cycles. A shift from cosine to sine is exactly one quarter of a cycle. The table below uses real frequency values from widely used physical and engineering systems, showing how long that quarter cycle actually is in time.
| Periodic system | Frequency | Period | Quarter cycle shift | Why it matters |
|---|---|---|---|---|
| North American AC power | 60 Hz | 16.67 ms | 4.17 ms | A sine and cosine representation differ by 4.17 ms at this frequency. |
| European AC power | 50 Hz | 20.00 ms | 5.00 ms | Phase shifts are often interpreted using this quarter cycle timing. |
| Concert A musical tone | 440 Hz | 2.27 ms | 0.568 ms | Audio waveforms are also sinusoidal and phase shifted versions of each other. |
| Middle C musical tone | 261.63 Hz | 3.82 ms | 0.956 ms | Useful for connecting harmonic math to real sound waves. |
Example 1: released from maximum displacement
Suppose a spring oscillator has amplitude 0.10 m and frequency 2 Hz. If it is released from its maximum positive displacement at time zero, cosine is the cleanest model: x(t) = 0.10 cos(4πt). Why? Because at t = 0, the displacement is 0.10 cos(0) = 0.10 m, exactly the amplitude. Velocity is zero because the slope of cosine at zero is zero. This instantly matches the physical picture.
Example 2: passing through equilibrium at t = 0
Now imagine the same oscillator passes through equilibrium going upward at time zero. Then a sine model is cleaner: x(t) = 0.10 sin(4πt). At t = 0, displacement is zero, and the positive slope means velocity is positive. Again, the same oscillator can be written in cosine form: x(t) = 0.10 cos(4πt – π/2). Same motion, different phase reference.
What if the problem gives a strange starting position?
That is exactly when phase angle becomes essential. If the initial displacement is not a peak and not zero, you should not force an unshifted sine or cosine formula. Use the general phase form. For example, if an oscillator starts at half the amplitude and is moving left, write: x(t) = A cos(ωt + φ) and solve for φ from the initial displacement and velocity. This is standard practice in advanced mechanics, signal processing, and electrical engineering.
Common mistakes students make
- Thinking sine is for math class and cosine is for physics class. This is false.
- Choosing a formula without checking the condition at time zero.
- Ignoring the sign of velocity, which is often what distinguishes rising from falling zero crossings.
- Forgetting that phase angle can fix almost any mismatch.
- Mixing degrees and radians when calculating angular phase.
Real comparison data: pendulum periods at small angle approximation
Simple harmonic motion is not only about springs. Small angle pendulum motion is also approximately harmonic. The periods below come from the standard small angle formula T = 2π√(L/g) using g = 9.81 m/s². These values help illustrate that harmonic timing changes with the physical system, but the sine versus cosine choice still depends only on initial conditions.
| Pendulum length | Approximate period | Frequency | Quarter cycle time | Natural starting form if released from edge |
|---|---|---|---|---|
| 0.25 m | 1.00 s | 1.00 Hz | 0.25 s | Cosine is natural |
| 0.50 m | 1.42 s | 0.70 Hz | 0.36 s | Cosine is natural |
| 1.00 m | 2.01 s | 0.50 Hz | 0.50 s | Cosine is natural |
| 2.00 m | 2.84 s | 0.35 Hz | 0.71 s | Cosine is natural |
How engineers and physicists think about it
In engineering, sinusoidal signals are commonly represented with phase because phase is the most portable way to describe timing differences. In vibration analysis, you may see displacement written with cosine because it pairs neatly with complex exponential methods and frequency response work. In introductory calculus or algebra settings, sine is often taught first because many wave examples begin at zero. Neither convention is superior in all contexts.
In fact, advanced treatments often convert both to a phasor or complex form and then return to real sine or cosine notation at the end. That should reassure you that the practical question is not “which function is truly correct?” but “which form expresses the starting point most clearly and minimizes algebra?”
Authoritative references for deeper study
- HyperPhysics at Georgia State University: Simple Harmonic Motion
- MIT OpenCourseWare: Vibrations and Waves
- NIST Time and Frequency Division
Final takeaway
When calculating simple harmonics, use sine or cosine based on the initial condition you are given. If the motion starts at a peak, cosine is usually the neatest. If it starts at zero crossing, sine is usually the neatest. If the starting point is somewhere else, use either with a phase angle. The important test is always the same: plug in t = 0 and confirm that your displacement and velocity match the problem statement.
So the expert answer is this: both are correct, phase decides the form, and initial conditions decide the phase. Once you understand that principle, simple harmonic motion becomes much easier to model, graph, and interpret.